Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-11563

Jenkins should fail initialization if it can not parse a job history

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Linux/tomcat - Jenkins version 1.436

      If the file

      configuration/jobs/<job>/nextBuildNumber

      is empty, Jenkins will still initialize but the job will "disappear" from the dashboard. This will be logged, but may go unnoticed.

      Oct 27, 2011 3:10:24 PM jenkins.model.Jenkins$6 onTaskFailed
      SEVERE: Failed Loading job accurev_trigger
      hudson.util.IOException2: <path>/configuration/jobs/<job>/nextBuildNumber doesn't contain a number

          [JENKINS-11563] Jenkins should fail initialization if it can not parse a job history

          emanuelez added a comment -

          I'm taking a look at this. The problem here is wether we want to
          1) fix the root cause (finding out why the nextBuildNumber file is empty)
          2) fixing the symptom (inserting an appropriate number in the file)
          3) setting up a notification system to tell the user what happened and how to fix it.

          Right now I'm taking a look at option 2) which is in theory the ugliest solution but also one that does not require user intervention

          emanuelez added a comment - I'm taking a look at this. The problem here is wether we want to 1) fix the root cause (finding out why the nextBuildNumber file is empty) 2) fixing the symptom (inserting an appropriate number in the file) 3) setting up a notification system to tell the user what happened and how to fix it. Right now I'm taking a look at option 2) which is in theory the ugliest solution but also one that does not require user intervention

          emanuelez added a comment -

          emanuelez added a comment - My fix is here: https://github.com/jenkinsci/jenkins/pull/303

          Code changed in jenkins
          User: Emanuele Zattin
          Path:
          changelog.html
          core/src/main/java/hudson/model/Job.java
          http://jenkins-ci.org/commit/jenkins/8affa6d912f2f0777487990f2d7ef2813a19b04c
          Log:
          [FIXED JENKINS-11563]

          It would be better to find out why the nextBuildNumber is at times empty.
          In the mean time this will find the appropriate number and write it to the file.

          Compare: https://github.com/jenkinsci/jenkins/compare/3fb9bdb...8affa6d

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Emanuele Zattin Path: changelog.html core/src/main/java/hudson/model/Job.java http://jenkins-ci.org/commit/jenkins/8affa6d912f2f0777487990f2d7ef2813a19b04c Log: [FIXED JENKINS-11563] It would be better to find out why the nextBuildNumber is at times empty. In the mean time this will find the appropriate number and write it to the file. Compare: https://github.com/jenkinsci/jenkins/compare/3fb9bdb...8affa6d

          Given that the write to the nextBuildNumber is protected in the atomic write, I'm not sure how it can be empty, but I'm merging pull #303 anyway as a defensive measure.

          Kohsuke Kawaguchi added a comment - Given that the write to the nextBuildNumber is protected in the atomic write, I'm not sure how it can be empty, but I'm merging pull #303 anyway as a defensive measure.

          pickgr added a comment -

          When we've seen this happen, it's usually due to some catastrophic event where the hard drive has crashed or the server that Jenkins was running on was not gracefully shutdown (power-outage). It's happened enough times though that I think this will be a very beneficial improvement for us. Thanks!

          pickgr added a comment - When we've seen this happen, it's usually due to some catastrophic event where the hard drive has crashed or the server that Jenkins was running on was not gracefully shutdown (power-outage). It's happened enough times though that I think this will be a very beneficial improvement for us. Thanks!

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1262
          [FIXED JENKINS-11563]

          Kohsuke Kawaguchi : 8affa6d912f2f0777487990f2d7ef2813a19b04c
          Files :

          • core/src/main/java/hudson/model/Job.java
          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #1262 [FIXED JENKINS-11563] Kohsuke Kawaguchi : 8affa6d912f2f0777487990f2d7ef2813a19b04c Files : core/src/main/java/hudson/model/Job.java changelog.html

            Unassigned Unassigned
            pickgr1 pickgr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: