java.io.IOException: .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted

Jenkins JIRA | Jesse Glick | 3 years ago
tip
Do you know that we can give you better hits? Get more relevant results from Samebug’s stack trace search.
  1. 0

    Sometimes "log rotation" fails with an exception like {code:none} SEVERE hudson.model.Run#execute: Failed to rotate log java.io.IOException: .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted at hudson.model.Run.delete(Run.java:1432) at hudson.maven.MavenModuleSetBuild.delete(MavenModuleSetBuild.java:420) at hudson.tasks.LogRotator.perform(LogRotator.java:136) at hudson.model.Job.logRotate(Job.java:437) at hudson.maven.MavenModuleSet.logRotate(MavenModuleSet.java:851) at hudson.model.Run.execute(Run.java:1728) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) {code} Usually {{MavenModuleSetBuild}} is involved, perhaps suggesting a problem with deleted or skipped module builds (I cannot reproduce in either scenario), though I think I have also seen this happen for freestyle builds. Unclear whether the directory actually exists but {{File.isDirectory}} thinks it does not (the code originally tried to delete the dir without checking this and failed with "... is in use"); or whether the directory was actually deleted earlier but this {{Run}} was not cleaned up properly for some reason. Hypothesis: {{AbstractLazyLoadRunMap.idOnDisk}} is not removed by {{removeValue}}, called from {{AbstractProject.removeRun}} (from {{Run.delete}}). Perhaps something is later resurrecting the {{AbstractBuild}} from {{idOnDisk}}, making it again available for another round of log rotation? But if the actual directory was deleted, it is hard to see how: {{load}} would just fail. Or perhaps {{Run.delete}} is the race condition: the run is removed from the parent after its directory has been deleted. The method is {{synchronized}}, but that does not help if two copies of the {{Run}} exist, which might happen due to other lazy-loading bugs. Diagnostics added to date: * https://github.com/jenkinsci/jenkins/commit/446783fb882b41ac9b39d3dbd3c17c919acc6df2 (1.501) * https://github.com/jenkinsci/jenkins/commit/f209a75d672e0bd318ba5e2458abcb208d2b6aa6 (1.526) * https://github.com/jenkinsci/jenkins/commit/5d92b45f47e630b6d9790a7d91b877c4f0acc449 and https://github.com/jenkinsci/jenkins/commit/3eb3126e00f6e6ab42f59475c91d2b634b4dd8a7 (1.558)

    Jenkins JIRA | 3 years ago | Jesse Glick
    java.io.IOException: .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted
  2. 0

    Sometimes "log rotation" fails with an exception like {code:none} SEVERE hudson.model.Run#execute: Failed to rotate log java.io.IOException: .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted at hudson.model.Run.delete(Run.java:1432) at hudson.maven.MavenModuleSetBuild.delete(MavenModuleSetBuild.java:420) at hudson.tasks.LogRotator.perform(LogRotator.java:136) at hudson.model.Job.logRotate(Job.java:437) at hudson.maven.MavenModuleSet.logRotate(MavenModuleSet.java:851) at hudson.model.Run.execute(Run.java:1728) at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:246) {code} Usually {{MavenModuleSetBuild}} is involved, perhaps suggesting a problem with deleted or skipped module builds (I cannot reproduce in either scenario), though I think I have also seen this happen for freestyle builds. Unclear whether the directory actually exists but {{File.isDirectory}} thinks it does not (the code originally tried to delete the dir without checking this and failed with "... is in use"); or whether the directory was actually deleted earlier but this {{Run}} was not cleaned up properly for some reason. Hypothesis: {{AbstractLazyLoadRunMap.idOnDisk}} is not removed by {{removeValue}}, called from {{AbstractProject.removeRun}} (from {{Run.delete}}). Perhaps something is later resurrecting the {{AbstractBuild}} from {{idOnDisk}}, making it again available for another round of log rotation? But if the actual directory was deleted, it is hard to see how: {{load}} would just fail. Or perhaps {{Run.delete}} is the race condition: the run is removed from the parent after its directory has been deleted. The method is {{synchronized}}, but that does not help if two copies of the {{Run}} exist, which might happen due to other lazy-loading bugs. Diagnostics added to date: * https://github.com/jenkinsci/jenkins/commit/446783fb882b41ac9b39d3dbd3c17c919acc6df2 (1.501) * https://github.com/jenkinsci/jenkins/commit/f209a75d672e0bd318ba5e2458abcb208d2b6aa6 (1.526) * https://github.com/jenkinsci/jenkins/commit/5d92b45f47e630b6d9790a7d91b877c4f0acc449 and https://github.com/jenkinsci/jenkins/commit/3eb3126e00f6e6ab42f59475c91d2b634b4dd8a7 (1.558)

    Jenkins JIRA | 3 years ago | Jesse Glick
    java.io.IOException: .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted
  3. 0

    [JIRA] (JENKINS-42096) SEVERE: Failed to rotate log

    Google Groups | 2 months ago | frederi...@agfa.com (JIRA)
    java.io.IOException: K:\JENKINS\jobs\HMP\jobs\HMP_DEV_TRUNK_CpoeMe\builds\104 is in use
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.io.IOException

      .../jobs/.../modules/...$.../builds/2013-... looks to have already been deleted

      at hudson.model.Run.delete()
    2. Hudson
      Run.delete
      1. hudson.model.Run.delete(Run.java:1432)
      1 frame
    3. Hudson Maven Embedder
      MavenModuleSetBuild.delete
      1. hudson.maven.MavenModuleSetBuild.delete(MavenModuleSetBuild.java:420)
      1 frame
    4. Hudson
      Job.logRotate
      1. hudson.tasks.LogRotator.perform(LogRotator.java:136)
      2. hudson.model.Job.logRotate(Job.java:437)
      2 frames
    5. Hudson Maven Embedder
      MavenModuleSet.logRotate
      1. hudson.maven.MavenModuleSet.logRotate(MavenModuleSet.java:851)
      1 frame
    6. Hudson
      Run.execute
      1. hudson.model.Run.execute(Run.java:1728)
      1 frame
    7. Hudson Maven Embedder
      MavenModuleSetBuild.run
      1. hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:509)
      1 frame
    8. Hudson
      Executor.run
      1. hudson.model.ResourceController.execute(ResourceController.java:88)
      2. hudson.model.Executor.run(Executor.java:246)
      2 frames