[JIRA] [packaging] (JENKINS-31814) dpkg error installing jenkins 1.639 on debian platforms

41 views
Skip to first unread message

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 3:38:03 PM11/30/15
to jenkinsc...@googlegroups.com
Brandon Raabe created an issue
 
Jenkins / Bug JENKINS-31814
dpkg error installing jenkins 1.639 on debian platforms
Issue Type: Bug Bug
Assignee: Kohsuke Kawaguchi
Components: packaging
Created: 30/Nov/15 8:37 PM
Priority: Minor Minor
Reporter: Brandon Raabe

When installing Jenkins 1.639 from the jenkins-ci.org repository on a debian based system, I receive the following error during the installation:

{{Setting up jenkins (1.639) ...

  • Starting Jenkins Continuous Integration Server jenkins [fail]
    invoke-rc.d: initscript jenkins, action "start" failed.
    dpkg: error processing package jenkins (--configure):
    subprocess installed post-installation script returned error exit status 7}}

This same failure does not happen when installing the older 1.635 package. The issue appears to be with the get_running function which is called by the do_check_started_ok function in the init script. It seems get_running is returning an exit code of 2, which in turn causes the init script to exit 7. Here's a diff of the two init scripts.

{{$ diff ~/jenkins.1.639.sh ~/jenkins.1.635.sh
183,194d182
< # Verify the process did in fact start successfully and didn't just bomb out
< do_check_started_ok()

{ < sleep 1 < if [ "$1" -ne "0" ]; then return $1; fi < get_running < if [ "$?" -eq "0" ]; then < return 2 < else < return 0 < fi < }

<
199,200d186
< START_STATUS="$?"
< do_check_started_ok "$START_STATUS"
203c189
< 2) log_end_msg 1 ; exit 7 ;;

> 2) log_end_msg 1 ;;
211c197
< 2) log_end_msg 1 ; exit 100 ;;

> 2) log_end_msg 1 ;;
224,226d209
< START_STATUS="$?"
< sleep 1
< do_check_started_ok "$START_STATUS"
229,230c212,213
< 1) log_end_msg 1 ; exit 100 ;; # Old process is still running
< *) log_end_msg 1 ; exit 100 ;; # Failed to start

> 1) log_end_msg 1 ;; # Old process is still running
> *) log_end_msg 1 ;; # Failed to start}}

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265)
Atlassian logo

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 3:39:01 PM11/30/15
to jenkinsc...@googlegroups.com
Brandon Raabe updated an issue
Change By: Brandon Raabe
When installing Jenkins 1.639 from the jenkins-ci.org repository on a debian based system, I receive the following error during the installation:


{ { code}
Setting up jenkins (1.639) ...
 * Starting Jenkins Continuous Integration Server jenkins                                     [fail]

invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 7}}
{code}

This same failure does not happen when installing the older 1.635 package. The issue appears to be with the {{get_running}} function which is called by the {{do_check_started_ok}} function in the init script. It seems {{get_running}} is returning an exit code of {{2}}, which in turn causes the init script to exit {{7}}. Here's a diff of the two init scripts.


{{$ diff ~/jenkins.1.639.sh ~/jenkins.1.635.sh
183,194d182
< # Verify the process did in fact start successfully and didn't just bomb out
< do_check_started_ok() {
<     sleep 1
<     if [ "$1" -ne "0" ]; then return $1; fi
<     get_running
<     if [ "$?" -eq "0" ]; then
<         return 2
<     else
<         return 0
<     fi
< }
<
199,200d186
<     START_STATUS="$?"
<     do_check_started_ok "$START_STATUS"
203c189
<         2) log_end_msg 1 ; exit 7 ;;
---

>         2) log_end_msg 1 ;;
211c197
<         2) log_end_msg 1 ; exit 100 ;;
---

>         2) log_end_msg 1 ;;
224,226d209
<         START_STATUS="$?"
<         sleep 1
<         do_check_started_ok "$START_STATUS"
229,230c212,213
<           1) log_end_msg 1 ; exit 100 ;; # Old process is still running
<           *) log_end_msg 1 ; exit 100 ;; # Failed to start
---

>           1) log_end_msg 1 ;; # Old process is still running
>           *) log_end_msg 1 ;; # Failed to start}}

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 4:00:02 PM11/30/15
to jenkinsc...@googlegroups.com
Brandon Raabe updated an issue
When installing Jenkins 1.639 from the jenkins-ci.org repository on a debian based system, I receive the following error during the installation:

{code}
Setting up jenkins (1.639) ...
 * Starting Jenkins Continuous Integration Server jenkins                                     [fail]
invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 7}}
{code}

This same failure does not happen when installing the older 1.635 package. The issue appears to be with the {{get_running}} function which is called by the {{do_check_started_ok}} function in the init script. It seems {{get_running}} is returning an exit code of {{2}}, which in turn causes the init script to exit {{7}}. Here's a diff of the two init scripts.

{{ code}}

{{code
}}

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 4:01:04 PM11/30/15
to jenkinsc...@googlegroups.com
Brandon Raabe updated an issue
When installing Jenkins 1.639 from the jenkins-ci.org repository on a debian based system, I receive the following error during the installation:

{code}
Setting up jenkins (1.639) ...
 * Starting Jenkins Continuous Integration Server jenkins                                     [fail]
invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 7}}
{code}

This same failure does not happen when installing the older 1.635 package. The issue appears to be with the {{get_running}} function which is called by the {{do_check_started_ok}} function in the init script. It seems {{get_running}} is returning an exit code of {{2}}, which in turn causes the init script to exit {{7}}. Here's a diff of the two init scripts.

{ { code :diff } }
{ code} }

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 4:02:02 PM11/30/15
to jenkinsc...@googlegroups.com

brandocorp@gmail.com (JIRA)

unread,
Nov 30, 2015, 4:04:05 PM11/30/15
to jenkinsc...@googlegroups.com
Brandon Raabe updated an issue
When installing Jenkins 1.639 from the jenkins-ci.org repository on a debian based system, I receive the following error during the installation:

{code}
Setting up jenkins (1.639) ...
 * Starting Jenkins Continuous Integration Server jenkins                                     [fail]
invoke-rc.d: initscript jenkins, action "start" failed.
dpkg: error processing package jenkins (--configure):
 subprocess installed post-installation script returned error exit status 7}}
{code}

Tested against:
* Ubuntu 14.04
* Debian 8.1

This same failure does not happen when installing the older 1.635 package. The issue appears to be with the {{get_running}} function which is called by the {{do_check_started_ok}} function in the init script. It seems {{get_running}} is returning an exit code of {{2}}, which in turn causes the init script to exit {{7}}. Here's a diff of the two init scripts.


{code}

svanoort@cloudbees.com (JIRA)

unread,
Dec 10, 2015, 1:08:01 PM12/10/15
to jenkinsc...@googlegroups.com
Sam Van Oort assigned an issue to Sam Van Oort
Change By: Sam Van Oort
Assignee: Kohsuke Kawaguchi Sam Van Oort

svanoort@cloudbees.com (JIRA)

unread,
Dec 14, 2015, 2:29:01 PM12/14/15
to jenkinsc...@googlegroups.com
Sam Van Oort started work on Bug JENKINS-31814
 
Change By: Sam Van Oort
Status: Open In Progress

svanoort@cloudbees.com (JIRA)

unread,
Dec 14, 2015, 2:33:01 PM12/14/15
to jenkinsc...@googlegroups.com
Sam Van Oort commented on Bug JENKINS-31814
 
Re: dpkg error installing jenkins 1.639 on debian platforms

Brandon Raabe I'm looking into this, since it appears to be a regression introduced by fixes to better handle previously silent Jenkins startup failures from https://issues.jenkins-ci.org/browse/JENKINS-31064 – does this issue only occur with the initial startup after install, or does a 'service jenkins stop' followed by 'service jenkins start' trigger it too?

geoko86@gmail.com (JIRA)

unread,
Dec 15, 2015, 5:42:02 AM12/15/15
to jenkinsc...@googlegroups.com

I just ran into the same issue. Running "sudo apt-get install jenkins" on a fresh Ubuntu 14.04 resulted in the error as mentioned above.

After the installation, when I executed "sudo service jenkins stop" and "sudo service jenkins start", Jenkins comes up fine, so it appears to be only the initial startup that fails.

brandocorp@gmail.com (JIRA)

unread,
Dec 16, 2015, 5:53:03 PM12/16/15
to jenkinsc...@googlegroups.com

I can confirm Georg Koester answer. It only happens upon installation. A stop and start does not cause the same error.

mikelee3@gmail.com (JIRA)

unread,
Jan 14, 2016, 6:25:06 PM1/14/16
to jenkinsc...@googlegroups.com
Mike Lee commented on Bug JENKINS-31814

This is affecting us as well, on a clean Ubuntu 14.04 installation.

fayyaz.ur.rehman@gmail.com (JIRA)

unread,
Mar 1, 2016, 5:07:02 AM3/1/16
to jenkinsc...@googlegroups.com

I am facing the same issue on all jenkins versions > 1.638.

I am trying to build a vm with automatic script, using the latest version's of jenkins. It build the vm till version 1.638 and giving error all jenkins version starting from 1.639 and above.

Please let me know if there is any solution, which can be utilized to automate jenkins installation for latest releases.

tdjones@ualberta.ca (JIRA)

unread,
Mar 10, 2016, 2:44:01 PM3/10/16
to jenkinsc...@googlegroups.com

Jenkins now appears to require java 7.

This solved it for me on Ubuntu 12.04:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer

fayyaz.ur.rehman@gmail.com (JIRA)

unread,
Mar 14, 2016, 1:59:01 PM3/14/16
to jenkinsc...@googlegroups.com

another way to fix is to either replace the jenkins file with jenkins <1.638 or edit the new one as by following steps

mkdir tmp

  1. R| -raw-extract <deb> <directory>
    dpkg-deb -R jenkins_1.652_all.deb tmp
  2. edit tmp/etc/init.d/jenkins

mark the line 200 as below
#do_check_started_ok "$START_STATUS"

change line 203 as below
2) log_end_msg 1 ;;

edit line 211 as this
2) log_end_msg 1 ;;

change line 226, mark the line with # sign in the begging
#do_check_started_ok "$START_STATUS"

#Save the file and remake the deb package

dpkg-deb -b tmp jenkins_1.652_all.deb

blake@covarrubi.as (JIRA)

unread,
Mar 22, 2016, 1:01:02 PM3/22/16
to jenkinsc...@googlegroups.com

I've been troubleshooting this issue on Ubuntu 14.04, and determined the root cause to be incorrect ordering of installation dependencies.

APT attempt to install & start Jenkins before the installation of openjdk-7-jre-headless. This causes the do_start() function to fail & return a non-zero exit code.

My solution is to simply install openjdk-7-jre-headless before Jenkins.

apt-get install openjdk-7-jre-headless
apt-get install jenkins

blake@covarrubi.as (JIRA)

unread,
Mar 22, 2016, 1:01:02 PM3/22/16
to jenkinsc...@googlegroups.com
Blake Covarrubias edited a comment on Bug JENKINS-31814
I've been troubleshooting this issue on  a fresh  Ubuntu 14.04  system , and determined the root cause to be incorrect ordering of installation dependencies.

APT
 attempt  attempts  to install & start Jenkins *before* the installation of openjdk-7-jre-headless. This causes the do_start() function to fail & return a non-zero exit code.


My solution is to simply install openjdk-7-jre-headless before Jenkins.

apt-get install openjdk-7-jre-headless
apt-get install jenkins

db5331@gmail.com (JIRA)

unread,
Apr 16, 2016, 8:02:02 AM4/16/16
to jenkinsc...@googlegroups.com

I experience the same error with Jenkins v 1.656. Is there a workaround to install Jenkins on Ubuntu 14.04?

simi.jayant@gmail.com (JIRA)

unread,
Nov 8, 2016, 8:02:01 AM11/8/16
to jenkinsc...@googlegroups.com

I have also found same issue on Ubuntu 14.04 while trying to install jenkins using apt-get.

I was getting following exception in jenkins.log

Running from: /usr/share/jenkins/jenkins.war
Exception in thread "main" java.io.IOException: Jenkins has failed to create a temporary file in /tmp
at Main.extractFromJar(Main.java:368)
at Main._main(Main.java:210)
at Main.main(Main.java:112)
Caused by: java.io.IOException: Permission denied
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(File.java:2001)
at Main.extractFromJar(Main.java:365)
... 2 more

Then I checked the permission of /tmp and added write permission.

root@ubuntu-core-14043:~/jayant# ll -d /tmp/
drwxr-xr-t 16 root root 4096 Nov 8 12:53 /tmp//
root@ubuntu-core-14043:~/jayant# chmod a+w /tmp/
root@ubuntu-core-14043:~/jayant# ll -d /tmp/
drwxrwxrwt 16 root root 4096 Nov 8 12:53 /tmp//

And then installation successfully completed. Not sure why it is looking for so much permission of /tmp

This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

beox@gmx.net (JIRA)

unread,
Mar 8, 2017, 11:12:05 AM3/8/17
to jenkinsc...@googlegroups.com

Hi,

I had the same issue on clean Debian 8.7 while installing the latest LTS version 2.32.3.
If I install a Java version before the jenkins debian package then the installation succeeded. (Like Trevor Jones did in comment-250218)

The fix for me was to unpack the debian package and update the control file to add Pre-Depends. I can confirm what Blake Covarrubias mentioned in his post.

Unpack the debian package:

jenkins$ ar -x ./jenkins_2.32.3_all.deb
jenkins$ ls
control.tar.gz data.tar.xz debian-binary jenkins_2.32.3_all.deb

Unpack the control.tar.gz:

jenkins$ mkdir control
jenkins$ mv control.tar.gz control/
jenkins$ cd control/
jenkins/control$ tar -xzf control.tar.gz 
jenkins/control$ ls
conffiles control control.tar.gz md5sums postinst postrm prerm

Update the control file and add the following line before Depends:

Pre-Depends: default-jre-headless (>= 2:1.7) | java7-runtime-headless

(The Pre-Depends statement will ensure the dependencies are ready to use for jenkins in installation process.
Further reading: https://www.debian.org/doc/debian-policy/ch-relationships.html)

Pack the control.tar.gz with updated control file:

jenkins/control$ ls
conffiles control control.tar.gz md5sums postinst postrm prerm
jenkins/control$ rm control.tar.gz
jenkins/control$ tar -czvf ../control.tar.gz ./

Pack the debian package:

jenkins/control$ cd ..
jenkins$ ar -r jenkins_2.32.3_all.deb debian-binary control.tar.gz data.tar.xz

 

If installed through apt-get install from a debian repository server the installation will succeed.

Please add the Pre-Depends statement to the debian packages.

Thanks.

 

Regards
Patrik

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

beox@gmx.net (JIRA)

unread,
Mar 8, 2017, 11:16:04 AM3/8/17
to jenkinsc...@googlegroups.com

beox@gmx.net (JIRA)

unread,
Mar 9, 2017, 3:26:02 AM3/9/17
to jenkinsc...@googlegroups.com
Patrik Hagedorn edited a comment on Bug JENKINS-31814
Hi,

I had the same issue on clean Debian 8.7 while installing the latest LTS version 2.32.3.
If I install a Java version before the jenkins debian package then the installation succeeded. (Like [~tdjones] did in [#comment-250218])

The fix for me was to unpack the debian package and update the control file to add *Pre-Depends.* I can confirm what [~blake] mentioned in his post
[#comment-251511] .

Unpack the debian package:
{noformat}

jenkins$ ar -x ./jenkins_2.32.3_all.deb
jenkins$ ls
control.tar.gz data.tar.xz debian-binary jenkins_2.32.3_all.deb{noformat}
Unpack the control.tar.gz:
{noformat}

jenkins$ mkdir control
jenkins$ mv control.tar.gz control/
jenkins$ cd control/
jenkins/control$ tar -xzf control.tar.gz
jenkins/control$ ls
conffiles control control.tar.gz md5sums postinst postrm prerm{noformat}
Update the control file and add the following line before *Depends*:
{noformat}

Pre-Depends: default-jre-headless (>= 2:1.7) | java7-runtime-headless
{noformat}
(The *Pre-Depends* statement will ensure the dependencies are ready to use for jenkins in installation process.

Further reading: [https://www.debian.org/doc/debian-policy/ch-relationships.html)]

Pack the control.tar.gz with updated control file:
{noformat}

jenkins/control$ ls
conffiles control control.tar.gz md5sums postinst postrm prerm
jenkins/control$ rm control.tar.gz
jenkins/control$ tar -czvf ../control.tar.gz ./{noformat}
Pack the debian package:
{noformat}
jenkins/control$ cd ..
jenkins$ ar -r jenkins_2.32.3_all.deb debian-binary control.tar.gz data.tar.xz{noformat}

 

If installed through apt-get install from a debian repository server the installation will succeed.

Please add the *Pre-Depends* statement to the debian packages.

Thanks.

 

Regards
Patrik
Reply all
Reply to author
Forward
0 new messages