How to debug when Jenkins jobs fail with "java.io.IOException and unable to delete job

10,444

Solution 1

As Sagar already mentioned, it could be a permission issue, especially if you created the job outside of Jenkins. Check if the user your Jenkins server runs under has permissions. Another thing to check if the Jenkins user is not explicitly granted permissions, is the owner permissions. If the owner doesn't have granted or permitted any permissions, than you might need to fix it. For me, it meant explicitly granting the Jenkins user permissions.

Another obvious case this might happen (I discovered that quite a few times lately when setting up complicated jobs) is if another program blocks a file or folder. A command prompt or an editor among others are excellent candidates for this.

Solution 2

You could look at the system log. It should be at

http://yourserver/log/all

Also, it looks like a possible permissions issue, but you should know more from the log. What version of Jenkins are you using?

Share:
10,444
Deleted
Author by

Deleted

This account has been deleted.

Updated on June 05, 2022

Comments

  • Deleted
    Deleted almost 2 years

    I have a lot of jobs (not all) failing on my Jenkins-server (Windows 7, installed as service) with:

    10:04:01  Started by upstream project "X281-Integration" build number 324
    10:04:26  java.io.IOException: Unable to delete E:\jenkins\jobs\BusinessAdapterComponent\workspace\ControllerSW\Workspace\AccessoryBusinessAdapterComponentTest
    10:04:26      at hudson.Util.deleteFile(Util.java:263)
    10:04:26      at hudson.Util.deleteRecursive(Util.java:305)
    10:04:26      at hudson.Util.deleteContentsRecursive(Util.java:224)
    10:04:26      at hudson.Util.deleteRecursive(Util.java:304)
    10:04:26      at hudson.Util.deleteContentsRecursive(Util.java:224)
    10:04:26      at hudson.Util.deleteRecursive(Util.java:304)
    10:04:26      at hudson.Util.deleteContentsRecursive(Util.java:224)
    10:04:26      at hudson.FilePath$10.invoke(FilePath.java:836)
    10:04:26      at hudson.FilePath$10.invoke(FilePath.java:834)
    10:04:26      at hudson.FilePath.act(FilePath.java:756)
    10:04:26      at hudson.FilePath.act(FilePath.java:738)
    10:04:26      at hudson.FilePath.deleteContents(FilePath.java:834)
    10:04:26      at hudson.plugins.cloneworkspace.CloneWorkspaceSCM.checkout(CloneWorkspaceSCM.java:125)
    10:04:26      at hudson.model.AbstractProject.checkout(AbstractProject.java:1181)
    10:04:26      at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:536)
    10:04:26      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:424)
    10:04:26      at hudson.model.Run.run(Run.java:1374)
    10:04:26      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
    10:04:26      at hudson.model.ResourceController.execute(ResourceController.java:88)
    10:04:26      at hudson.model.Executor.run(Executor.java:145)
    10:04:26  [WARNINGS] Parsing warnings in console log...
    10:04:26  [WARNINGS] PC-Lint : Found 0 warnings.
    10:04:26  [WARNINGS] GNU compiler 4 (ld) : Found 0 warnings.
    10:04:26  [WARNINGS] GNU compiler 4 (gcc) : Found 0 warnings.
    

    I would like to debug this problem. Is there a way to see what is causing this using more logging? How would I go about setting that up?

    It is recurring on some job where it happens every time. Is there a tool I could use to log which processes are using the path above?