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

Jenkins fails to startup when a ComputerListener throws exception for onOnline() of the master node

      Original description:

      > Jenkins fails to startup if the EnvInject global system properties file is missing

      hudson.util.HudsonFailedToLoad: java.io.IOException: org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: The given properties file path '/Users/nenashev/Documents/jenkins/plugins/envinject-plugin/foo.prop' doesn't exist.
      	at hudson.WebAppMain$3.run(WebAppMain.java:237)
      Caused by: java.io.IOException: org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: The given properties file path '/Users/nenashev/Documents/jenkins/plugins/envinject-plugin/foo.prop' doesn't exist.
      	at org.jenkinsci.plugins.envinject.EnvInjectComputerListener.onOnline(EnvInjectComputerListener.java:171)
      	at jenkins.model.Jenkins.<init>(Jenkins.java:857)
      	at hudson.model.Hudson.<init>(Hudson.java:83)
      	at hudson.model.Hudson.<init>(Hudson.java:79)
      	at hudson.WebAppMain$3.run(WebAppMain.java:225)
      Caused by: org.jenkinsci.lib.envinject.EnvInjectException: java.io.IOException: The given properties file path '/Users/nenashev/Documents/jenkins/plugins/envinject-plugin/foo.prop' doesn't exist.
      	at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.getEnvVarsFileProperty(EnvInjectEnvVars.java:76)
      	at org.jenkinsci.plugins.envinject.EnvInjectComputerListener.getNewMasterEnvironmentVariables(EnvInjectComputerListener.java:69)
      	at org.jenkinsci.plugins.envinject.EnvInjectComputerListener.onOnline(EnvInjectComputerListener.java:168)
      	... 4 more
      Caused by: java.io.IOException: The given properties file path '/Users/nenashev/Documents/jenkins/plugins/envinject-plugin/foo.prop' doesn't exist.
      	at org.jenkinsci.plugins.envinject.service.PropertiesVariablesRetriever.invoke(PropertiesVariablesRetriever.java:91)
      	at org.jenkinsci.plugins.envinject.service.PropertiesVariablesRetriever.invoke(PropertiesVariablesRetriever.java:20)
      	at hudson.FilePath.act(FilePath.java:989)
      	at hudson.FilePath.act(FilePath.java:967)
      	at org.jenkinsci.plugins.envinject.service.EnvInjectEnvVars.getEnvVarsFileProperty(EnvInjectEnvVars.java:74)
      	... 6 more
      
      

          [JENKINS-38487] Jenkins fails to startup when a ComputerListener throws exception for onOnline() of the master node

          Oleg Nenashev created issue -
          Oleg Nenashev made changes -
          Summary Original: EnvInject fails to startup if the system properties file is missing New: Jenkins fails to startup if the global system properties file is missing
          Oleg Nenashev made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]
          Oleg Nenashev made changes -
          Component/s New: core [ 15593 ]
          Oleg Nenashev made changes -
          Summary Original: Jenkins fails to startup if the global system properties file is missing New: Jenkins fails to startup if the EnvInject global system properties file is missing

          Oleg Nenashev added a comment -

          Actually it's rather a Jenkins core issue, because it does not catch IOExceptions coming from listeners

          Oleg Nenashev added a comment - Actually it's rather a Jenkins core issue, because it does not catch IOExceptions coming from listeners
          Daniel Beck made changes -
          Labels New: robustness

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/slaves/ComputerListener.java
          core/src/main/java/jenkins/model/Jenkins.java
          test/src/test/java/jenkins/model/JenkinsTest.java
          http://jenkins-ci.org/commit/jenkins/58e1228c99fd3d5063b0967d7780dc536bc2c463
          Log:
          [FIXED JENKINS-38487] - Jenkins startup must not fail in the case of ComputerListener failure (#2610)

          Without this code Jenkinbs startup fails if EnvInject fails to find global property file on startup.

          Javadoc says "Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline." regarding the listener method exception, hence we should not block Jenkins startup

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/slaves/ComputerListener.java core/src/main/java/jenkins/model/Jenkins.java test/src/test/java/jenkins/model/JenkinsTest.java http://jenkins-ci.org/commit/jenkins/58e1228c99fd3d5063b0967d7780dc536bc2c463 Log: [FIXED JENKINS-38487] - Jenkins startup must not fail in the case of ComputerListener failure (#2610) Without this code Jenkinbs startup fails if EnvInject fails to find global property file on startup. Javadoc says "Exceptions will be recorded to the listener. Note that throwing an exception doesn't put the computer offline." regarding the listener method exception, hence we should not block Jenkins startup
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Oleg Nenashev added a comment -

          The fix has been integrated towards 2.28

          Oleg Nenashev added a comment - The fix has been integrated towards 2.28

            oleg_nenashev Oleg Nenashev
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: