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

Debian package update failed because setup step tries to restart Jenkins service

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • packaging
    • None
    • Debain 9.5 (stretch)
    • 2.335

      On Debian stretch I had Jenkins configured to be run under Tomcat 8 server, hence in /etc/default/jenkins I have specified that:

      RUN_STANDALONE=false
      

      During package update (e.g. via apt-get update) the following error happened:

      Setting up jenkins (2.138.2) ...
      Job for jenkins.service failed because the control process exited with error code.
      See "systemctl status jenkins.service" and "journalctl -xe" for details.
      invoke-rc.d: initscript jenkins, action "start" failed.
      ● jenkins.service - LSB: Start Jenkins at boot time
         Loaded: loaded (/etc/init.d/jenkins; generated; vendor preset: enabled)
         Active: failed (Result: exit-code) since Mon 2018-11-05 00:31:47 CET; 20ms ago
           Docs: man:systemd-sysv-generator(8)
        Process: 29959 ExecStart=/etc/init.d/jenkins start (code=exited, status=1/FAILURE)
      
      Nov 05 00:31:47 debian systemd[1]: Starting LSB: Start Jenkins at boot time...
      Nov 05 00:31:47 debian jenkins[29959]: Not configured to run standalone
      Nov 05 00:31:47 debian systemd[1]: jenkins.service: Control process exited, code=exited status=1
      Nov 05 00:31:47 debian systemd[1]: Failed to start LSB: Start Jenkins at boot time.
      Nov 05 00:31:47 debian systemd[1]: jenkins.service: Unit entered failed state.
      Nov 05 00:31:47 debian systemd[1]: jenkins.service: Failed with result 'exit-code'.
      dpkg: error processing package jenkins (--configure):
       subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
       jenkins
      E: Sub-process /usr/bin/dpkg returned an error code (1)
      

      It looks that post-installation script tries to restart Jenkins service and/or check it's status but failed, as it was configured as embedded application.

      Expected that Jenkins update is possible despite of jenkins.service status or, in case restart is necessary, it checks that RUN_STANDALONE=true beforehand. Namely when RUN_STANDALONE=false, no restart should be performed as otherwise it fails:

      Unpacking jenkins (2.150.2) over (2.150.1) ...
      Setting up jenkins (2.150.2) ...
      Job for jenkins.service failed because the control process exited with error code.
      See "systemctl status jenkins.service" and "journalctl -xe" for details.
      invoke-rc.d: initscript jenkins, action "start" failed.
      ● jenkins.service - LSB: Start Jenkins at boot time
         Loaded: loaded (/etc/init.d/jenkins; generated; vendor preset: enabled)
         Active: failed (Result: exit-code) since Tue 2019-02-12 14:44:36 CET; 30ms ago
           Docs: man:systemd-sysv-generator(8)
        Process: 28490 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
      
      Feb 12 14:44:24 debian systemd[1]: Starting LSB: Start Jenkins at boot time...
      Feb 12 14:44:29 debian jenkins[28490]: Correct java version found
      Feb 12 14:44:34 debian jenkins[28490]: Starting Jenkins Automation Server: jenkinsThe selected http port (8080) on address 0.0.0.0 seems to be in use by another program
      Feb 12 14:44:34 debian jenkins[28490]: Please select another address/port combination to use for jenkins
      Feb 12 14:44:36 debian jenkins[28490]:  failed!
      Feb 12 14:44:36 debian systemd[1]: Failed to start LSB: Start Jenkins at boot time.
      Feb 12 14:44:36 debian systemd[1]: jenkins.service: Unit entered failed state.
      Feb 12 14:44:36 debian systemd[1]: jenkins.service: Failed with result 'exit-code'.
      

            basil Basil Crow
            dma_k dma_k
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: