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

Jenkins shuts down instead of restarting on Mac M1

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • 2.449

      This issue appeared after migrating our Jenkins instance from a Macbook to a new Mac mini (M1). I could also reproduce it with a clean install on the M1 machine.

      It has been present in the last few versions (at least).

      Steps to reproduce:

      1. Go to http://[JENKINS_URL]/updateCenter/
      2. Check "Restart Jenkins when installation is complete and no jobs are running" (regardless of whether there's an upgrade or not)
      3. Observe what happens in the terminal - after 10 seconds, Jenkins process is killed instead of restarted.

      This is how the log looks like:

      2021-06-17 08:27:47.284+0000 [id=1066]	INFO	jenkins.model.Jenkins$20#run: Restart in 10 seconds
      2021-06-17 08:27:57.287+0000 [id=1066]	INFO	jenkins.model.Jenkins$20#run: Restarting VM as requested by admin
      2021-06-17 08:27:57.287+0000 [id=1066]	INFO	jenkins.model.Jenkins#cleanUp: Stopping Jenkins
      2021-06-17 08:27:57.339+0000 [id=1066]	INFO	jenkins.model.Jenkins$16#onAttained: Started termination
      2021-06-17 08:27:57.370+0000 [id=1066]	INFO	jenkins.model.Jenkins$16#onAttained: Completed termination
      2021-06-17 08:27:57.370+0000 [id=1066]	INFO	jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
      2021-06-17 08:27:57.379+0000 [id=1066]	INFO	jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
      2021-06-17 08:27:57.440+0000 [id=1066]	INFO	jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
      2021-06-17 08:27:57.443+0000 [id=1066]	INFO	jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
      2021-06-17 08:27:57.443+0000 [id=1066]	INFO	jenkins.model.Jenkins#cleanUp: Jenkins stopped
      [1]    72539 killed     jenkins
      

      Jenkins runs fine when manually started again (with "jenkins" command).

          [JENKINS-65911] Jenkins shuts down instead of restarting on Mac M1

          Jonatan created issue -
          Jonatan made changes -
          Description Original: This issue appeared after migrating our Jenkins instance from a Macbook to a new Mac mini (M1). I could also reproduce it with a clean install on the M1 machine.

          It has been present in the last few versions (at least).

          Steps to reproduce:
           # Go to [http://[JENKINS_URL]/updateCenter/|http://[jenkins_url]/updateCenter/]
           # Check "Restart Jenkins when installation is complete and no jobs are running" (regardless of whether there's an upgrade or not)
           # Observe what happens in the terminal - after 10 seconds, Jenkins process is killed instead of restarted.

          This is how the log looks like:

          {code:java}
          2021-06-17 08:27:47.284+0000 [id=1066] INFO jenkins.model.Jenkins$20#run: Restart in 10 seconds
          2021-06-17 08:27:57.287+0000 [id=1066] INFO jenkins.model.Jenkins$20#run: Restarting VM as requested by admin
          2021-06-17 08:27:57.287+0000 [id=1066] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
          2021-06-17 08:27:57.339+0000 [id=1066] INFO jenkins.model.Jenkins$16#onAttained: Started termination
          2021-06-17 08:27:57.370+0000 [id=1066] INFO jenkins.model.Jenkins$16#onAttained: Completed termination
          2021-06-17 08:27:57.370+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
          2021-06-17 08:27:57.379+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
          2021-06-17 08:27:57.440+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
          2021-06-17 08:27:57.443+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
          2021-06-17 08:27:57.443+0000 [id=1066] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
          [1] 72539 killed jenkins
          {code}

          Jenkins runs fine when manually started again (with "jenkins" command).
          New: This issue appeared after migrating our Jenkins instance from a Macbook to a new Mac mini (M1). I could also reproduce it with a clean install on the M1 machine.

          It has been present in the last few versions (at least).

          Steps to reproduce:
           # Go to http://[JENKINS_URL]/updateCenter/
           # Check "Restart Jenkins when installation is complete and no jobs are running" (regardless of whether there's an upgrade or not)
           # Observe what happens in the terminal - after 10 seconds, Jenkins process is killed instead of restarted.

          This is how the log looks like:

          {code:java}
          2021-06-17 08:27:47.284+0000 [id=1066] INFO jenkins.model.Jenkins$20#run: Restart in 10 seconds
          2021-06-17 08:27:57.287+0000 [id=1066] INFO jenkins.model.Jenkins$20#run: Restarting VM as requested by admin
          2021-06-17 08:27:57.287+0000 [id=1066] INFO jenkins.model.Jenkins#cleanUp: Stopping Jenkins
          2021-06-17 08:27:57.339+0000 [id=1066] INFO jenkins.model.Jenkins$16#onAttained: Started termination
          2021-06-17 08:27:57.370+0000 [id=1066] INFO jenkins.model.Jenkins$16#onAttained: Completed termination
          2021-06-17 08:27:57.370+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpDisconnectComputers: Starting node disconnection
          2021-06-17 08:27:57.379+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpShutdownPluginManager: Stopping plugin manager
          2021-06-17 08:27:57.440+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpPersistQueue: Persisting build queue
          2021-06-17 08:27:57.443+0000 [id=1066] INFO jenkins.model.Jenkins#_cleanUpAwaitDisconnects: Waiting for node disconnection completion
          2021-06-17 08:27:57.443+0000 [id=1066] INFO jenkins.model.Jenkins#cleanUp: Jenkins stopped
          [1] 72539 killed jenkins
          {code}

          Jenkins runs fine when manually started again (with "jenkins" command).

          Jonatan added a comment -

          This seems to be fixed in the 2.299 version, though it's not documented.

          Jonatan added a comment - This seems to be fixed in the 2.299 version, though it's not documented.

          Mark Waite added a comment -

          It is documented in the 2.297 changelog and in the 2.289.2 changelog

          Mark Waite added a comment - It is documented in the 2.297 changelog and in the 2.289.2 changelog
          Mark Waite made changes -
          Link New: This issue is related to JENKINS-65195 [ JENKINS-65195 ]
          Mark Waite made changes -
          Released As New: 2.297, 2.289.2
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]
          Tim Jacomb made changes -
          Resolution Original: Duplicate [ 3 ]
          Status Original: Closed [ 6 ] New: Reopened [ 4 ]
          Tim Jacomb made changes -
          Status Original: Reopened [ 4 ] New: Open [ 1 ]

          Tim Jacomb added a comment -

          This was not fixed, it was another issue

          Tim Jacomb added a comment - This was not fixed, it was another issue

          Tim Jacomb added a comment -

          I've been debugging it.

          It fails on this line:
          https://github.com/jenkinsci/jenkins/blob/195dacbf556fdf0a393d5d139df27ffba3a82b11/core/src/main/java/hudson/lifecycle/UnixLifecycle.java#L80

          The file descriptor it fails on changes in different runs normally between 820-840

          Catching error doesn't help:

          try {} catch (Error e)
          

          Not sure if basil would have any ideas on what to try from here =/

          Tim Jacomb added a comment - I've been debugging it. It fails on this line: https://github.com/jenkinsci/jenkins/blob/195dacbf556fdf0a393d5d139df27ffba3a82b11/core/src/main/java/hudson/lifecycle/UnixLifecycle.java#L80 The file descriptor it fails on changes in different runs normally between 820-840 Catching error doesn't help: try {} catch (Error e) Not sure if basil would have any ideas on what to try from here =/

            basil Basil Crow
            transcendd Jonatan
            Votes:
            3 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: