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

Let restart jenkins.war in Windows through URL with the /safeRestart pattern

    Details

    • Similar Issues:

      Description

      When Jenkins is started in Windows (either 7 or 10) through the jenkins.war file: 

      • java -jar jenkins.war --httpPort=9090

      Through a web browser the URL that works with the /safeRestart term
      does not work how is expected. Always appears the following message:

      • Jenkins cannot restart itself as currently configured.

      BTW, the URL with /safeRestart works fine in either Mac or Linux

      Furthermore, for example /safeExit works fine in all the OS

      For more details, read:

       * jenkins.war running - URL working with /safeRestart does not work in Windows

      Java used in these 3 OS is:

      > java --version
      openjdk 11.0.6 2020-01-14 LTS
      OpenJDK Runtime Environment Corretto-11.0.6.10.1 (build 11.0.6+10-LTS)
      OpenJDK 64-Bit Server VM Corretto-11.0.6.10.1 (build 11.0.6+10-LTS, mixed mode)
      

       
      Just wondered why the execution of jenkins.war file does not work in the same way in all the OS, practically is not portable in Windows
       

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          For Windows self-restart is supported when running as a Windows service: https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java . If you start with "-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle", it should self-restart well

          Show
          oleg_nenashev Oleg Nenashev added a comment - For Windows self-restart is supported when running as a Windows service:  https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java  . If you start with "-Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle", it should self-restart well
          Hide
          manueljordan Manuel Jordan added a comment -

          Hello Oleg

          Huge thanks, I used:

          java -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar jenkins.war --httpPort=9090
          

           And through the Web browser I am able to accomplish:

          http://192.168.1.#:9090/safeRestart 
          

          And works, but the server terminal remains showing the following:

          2020-05-16 18:37:30.785+0000 [id=19]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:37:37.102+0000 [id=14]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:37:42.140+0000 [id=20]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:37:47.214+0000 [id=15]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:37:49.382+0000 [id=84]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:37:55.059+0000 [id=19]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:38:00.131+0000 [id=14]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:38:04.217+0000 [id=15]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
          2020-05-16 18:38:09.645+0000 [id=20]    WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.
           

          And well, after of a time, nothing happens, I must use the Ctrl + C

          So, seems something is missing

          Again, thanks for your support

          Show
          manueljordan Manuel Jordan added a comment - Hello Oleg Huge thanks, I used: java -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar jenkins.war --httpPort=9090  And through the Web browser I am able to accomplish: http: //192.168.1.#:9090/safeRestart And works, but the server terminal remains showing the following: 2020-05-16 18:37:30.785+0000 [id=19] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:37:37.102+0000 [id=14] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:37:42.140+0000 [id=20] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:37:47.214+0000 [id=15] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:37:49.382+0000 [id=84] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:37:55.059+0000 [id=19] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:38:00.131+0000 [id=14] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:38:04.217+0000 [id=15] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session. 2020-05-16 18:38:09.645+0000 [id=20] WARNING h.s.HttpSessionContextIntegrationFilter2#hasInvalidSessionSeed: Encountered IllegalStateException trying to get a user. System init may not have completed yet. Invalidating user session.   And well, after of a time, nothing happens, I must use the Ctrl + C So, seems something is missing Again, thanks for your support

            People

            • Assignee:
              Unassigned
              Reporter:
              manueljordan Manuel Jordan
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: