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

Cannot update Jenkins server 2.263.3 to latest

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      I currently have Jenkins 2.263.3 and need to update it to the latest version but cannot do it for  a couple of month. When I run the update it says it was successful but when I try to access it after the update it gives me errors and I have to go back to 2.263.3

      Here is the error log that it gives me:

      java.lang.IllegalStateException: An attempt to save the global configuration was made before it was loaded
          at jenkins.model.Jenkins.save(Jenkins.java:3461)
          at jenkins.model.Jenkins.saveQuietly(Jenkins.java:3480)
          at jenkins.model.Jenkins.setSecurityRealm(Jenkins.java:2707)
          at jenkins.model.Jenkins$15.run(Jenkins.java:3423)
          at org.jvnet.hudson.reactor.TaskGraphBuilder$TaskImpl.run(TaskGraphBuilder.java:169)
          at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:296)
          at jenkins.model.Jenkins$5.runTask(Jenkins.java:1160)
          at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:214)
          at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
          at jenkins.security.ImpersonatingExecutorService$1.run(ImpersonatingExecutorService.java:68)
          at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.base/java.lang.Thread.run(Unknown Source)
      Caused: org.jvnet.hudson.reactor.ReactorException
          at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:282)
          at jenkins.InitReactorRunner.run(InitReactorRunner.java:50)
          at jenkins.model.Jenkins.executeReactor(Jenkins.java:1193)
          at jenkins.model.Jenkins.<init>(Jenkins.java:991)
          at hudson.model.Hudson.<init>(Hudson.java:86)
          at hudson.model.Hudson.<init>(Hudson.java:82)
          at hudson.WebAppMain$3.run(WebAppMain.java:298)
      Caused: hudson.util.HudsonFailedToLoad
          at hudson.WebAppMain$3.run(WebAppMain.java:315)
      

       

        Attachments

          Activity

          Hide
          lubap Luba Pyat added a comment -

          this is the Jave versionm I have:

          openjdk version "11.0.5" 2019-10-15
          OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
          OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)

          Show
          lubap Luba Pyat added a comment - this is the Jave versionm I have: openjdk version "11.0.5" 2019-10-15 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)
          Hide
          ianw Ian Williams added a comment -

          Did you read the Upgrade Guide calling out the issue or newer Upgrade Guide or search StackOverflow or Reddit

          Show
          ianw Ian Williams added a comment - Did you read the Upgrade Guide calling out the issue or newer Upgrade Guide or search StackOverflow or Reddit
          Hide
          lubap Luba Pyat added a comment - - edited

          Ian Williams Yes, I did. Unfortunately it did not work for me  

          This is what work for people that have these issue, and I did the same but it did not work:

          "For anyone having this issue, yes downgrading to https://get.jenkins.io/war-stable/2.263.1/ first is required. Then restart the service, then upgrade all of your plugins, then try the LTS upgrade again, at least for me it worked just fine."

          I still got the same errors. PLEASE ADVICE!

           

          I also found below but where do I find  io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay system property and how to change it?

          "If you encounter the race condition Jenkins will fail to start with an exception message similar to the following:
           {{SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init
          java.lang.IllegalStateException: An attempt to save the global configuration
          was made before it was loaded}}
          If you encounter this, you can tell the plugin to delay configuration for an amount of time to give Jenkins time to load the global configuration before the configuration is applied by the plugin.
          To enable this set the io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay system property to a number of milliseconds to delay the initialisation. 

          Show
          lubap Luba Pyat added a comment - - edited Ian Williams  Yes, I did. Unfortunately it did not work for me   This is what work for people that have these issue, and I did the same but it did not work: "For anyone having this issue, yes downgrading to  https://get.jenkins.io/war-stable/2.263.1/  first is required. Then restart the service, then upgrade all of your plugins, then try the LTS upgrade again, at least for me it worked just fine." I still got the same errors. PLEASE ADVICE!   I also found below but where do I find   io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay  system property and how to change it? "If you encounter the race condition Jenkins will fail to start with an exception message similar to the following:  {{SEVERE jenkins.InitReactorRunner$1#onTaskFailed: Failed ConfigurationAsCode.init java.lang.IllegalStateException: An attempt to save the global configuration was made before it was loaded}} If you encounter this, you can tell the plugin to delay configuration for an amount of time to give Jenkins time to load the global configuration before the configuration is applied by the plugin. To enable this set the  io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay  system property to a number of milliseconds to delay the initialisation. 
          Hide
          lubap Luba Pyat added a comment -

          I tried everything but was able to update to version 2.263.4  but not anything above that.  Was able to downgrade to version 2.263.1 and update to 2.263.4 but that's it.

          Show
          lubap Luba Pyat added a comment - I tried everything but was able to update to version 2.263.4  but not anything above that.  Was able to downgrade to version 2.263.1 and update to 2.263.4 but that's it.
          Hide
          ianw Ian Williams added a comment -

          It says in the JCasc docs,

          java -Dio.jenkins.plugins.casc.ConfigurationAsCode.initialDelay=9000 -jar jenkins.war
          

          To enable this set the io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay system property to a number of milliseconds to delay the initialisation by. Exactly how and where you specify this option depends on the installation method used to install Jenkins.

          That might be in your jenkins.conf or the command line.

          I'm just another user, , so not sure I can help further

          Show
          ianw Ian Williams added a comment - It says in the JCasc docs, java -Dio.jenkins.plugins.casc.ConfigurationAsCode.initialDelay=9000 -jar jenkins.war To enable this set the io.jenkins.plugins.casc.ConfigurationAsCode.initialDelay system property to a number of milliseconds to delay the initialisation by. Exactly how and where you specify this option depends on the installation method used to install Jenkins. That might be in your jenkins.conf or the command line. I'm just another user, , so not sure I can help further
          Hide
          lubap Luba Pyat added a comment -

          Thank you Ian! I overcame the initial issue by updating Role Strategy plugin. It worked and it helped but I still cannot go above 2.263.4

          When I do it gives me general Ooups error and not an explanation. I tried all variations above 2.263.4

          Show
          lubap Luba Pyat added a comment - Thank you Ian! I overcame the initial issue by updating Role Strategy plugin. It worked and it helped but I still cannot go above 2.263.4 When I do it gives me general Ooups error and not an explanation. I tried all variations above 2.263.4
          Hide
          ianw Ian Williams added a comment -

          "Oops" will have a corresponding event in the Jenkins logs. Check that (and above) for evidence of the problem.

          Show
          ianw Ian Williams added a comment - "Oops" will have a corresponding event in the Jenkins logs. Check that (and above) for evidence of the problem.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            lubap Luba Pyat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: