package tomcat8 8.0.32-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Bug #1586054 reported by ali faizan
182
This bug affects 39 people
Affects Status Importance Assigned to Milestone
tomcat8 (Ubuntu)
Confirmed
High
Unassigned

Bug Description

trying to install tomcat using apt-get. same error occurred when tried to install tomcat7

ProblemType: Package
DistroRelease: Ubuntu 16.04
Package: tomcat8 8.0.32-1ubuntu1
ProcVersionSignature: Ubuntu 4.4.0-22.40-generic 4.4.8
Uname: Linux 4.4.0-22-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
Date: Thu May 26 18:55:02 2016
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationDate: Installed on 2016-04-25 (30 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
PackageArchitecture: all
RelatedPackageVersions:
 dpkg 1.18.4ubuntu1.1
 apt 1.2.10ubuntu1
SourcePackage: tomcat8
Title: package tomcat8 8.0.32-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
ali faizan (ali-faizan-dev) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in tomcat8 (Ubuntu):
status: New → Confirmed
Changed in tomcat8 (Ubuntu):
importance: Undecided → High
Revision history for this message
Bryn Jeffries (bryn-jeffries) wrote :

I have the same problem. The contents of /var/log/tomcat8/catalina.out say:
-Djava.endorsed.dirs=/usr/share/tomcat8/endorsed is not supported. Endorsed standards and standalone APIs
in modular form will be supported via the concept of upgradeable modules.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Revision history for this message
Bryn Jeffries (bryn-jeffries) wrote :

This seems to be related to https://bugs.openjdk.java.net/browse/JDK-8065675
The version of Java called seems to be using the CheckEndorsedAndExtDirs option and failing due to the definition of deprecated endorsed directory (see https://www.java.com/en/download/faq/release_changes.xml Java 8 Update 40 (8u40)). My fix is to remove all definitions of endorsed directories when calling java - see modified catalina.sh script attached. An alternative option might be to explicitly allow the deprecated API.

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

@Ali Faizan - are you facing the same java endorsed issue that Bryn pointed out?

Your logs themself as attached are not that useful as they have no more details on the issue than just:
  May 26 18:55:02 hostname systemd[1]: Failed to start LSB: Start Tomcat..
  May 26 18:55:02 hostname systemd[1]: tomcat8.service: Failed with result 'exit-code'.

The rest of the logs is mostly flooded with some pcie bus error related messages

Revision history for this message
Surfrock66 (surfrock66) wrote :
Download full text (3.6 KiB)

I just want to indicate that this issue is still happening on Ubuntu Server 16.10. Bryn Jeffries root cause does seem to be likely. Nevertheless, here's my debugging info in case it's useful:

Result of "sudo apt-get install tomcat8"

Selecting previously unselected package tomcat8.
(Reading database ... 322097 files and directories currently installed.)
Preparing to unpack .../tomcat8_8.0.32-1ubuntu1.2_all.deb ...
Unpacking tomcat8 (8.0.32-1ubuntu1.2) ...
Processing triggers for systemd (229-4ubuntu13) ...
Processing triggers for ureadahead (0.100.0-19) ...
Setting up tomcat8 (8.0.32-1ubuntu1.2) ...
Creating config file /etc/default/tomcat8 with new version
Adding system user `tomcat8' (UID 142) ...
Adding new user `tomcat8' (UID 142) with group `tomcat8' ...
Not creating home directory `/usr/share/tomcat8'.
Creating config file /etc/logrotate.d/tomcat8 with new version
Job for tomcat8.service failed because the control process exited with error code. See "systemctl status tomcat8.service" and "journalctl -xe" for details.
invoke-rc.d: initscript tomcat8, action "start" failed.
dpkg: error processing package tomcat8 (--configure):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (229-4ubuntu13) ...
Processing triggers for ureadahead (0.100.0-19) ...
Errors were encountered while processing:
 tomcat8
E: Sub-process /usr/bin/dpkg returned an error code (1)

Output of "systemctl status tomcat8.service":

● tomcat8.service - LSB: Start Tomcat.
   Loaded: loaded (/etc/init.d/tomcat8; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2017-01-18 13:21:14 PST; 1min 53s ago
     Docs: man:systemd-sysv-generator(8)

Jan 18 13:21:09 sr66-blade systemd[1]: Starting LSB: Start Tomcat....
Jan 18 13:21:09 sr66-blade tomcat8[22023]: * Starting Tomcat servlet engine tomcat8
Jan 18 13:21:14 sr66-blade tomcat8[22023]: ...fail!
Jan 18 13:21:14 sr66-blade systemd[1]: tomcat8.service: Control process exited, code=exited status=1
Jan 18 13:21:14 sr66-blade systemd[1]: Failed to start LSB: Start Tomcat..
Jan 18 13:21:14 sr66-blade systemd[1]: tomcat8.service: Unit entered failed state.
Jan 18 13:21:14 sr66-blade systemd[1]: tomcat8.service: Failed with result 'exit-code'.

Relevant output of "journalctl -xe":

Jan 18 13:21:09 sr66-blade systemd[1]: Starting LSB: Start Tomcat....
-- Subject: Unit tomcat8.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat8.service has begun starting up.
Jan 18 13:21:09 sr66-blade tomcat8[22023]: * Starting Tomcat servlet engine tomcat8
Jan 18 13:21:14 sr66-blade tomcat8[22023]: ...fail!
Jan 18 13:21:14 sr66-blade systemd[1]: tomcat8.service: Control process exited, code=exited status=1
Jan 18 13:21:14 sr66-blade systemd[1]: Failed to start LSB: Start Tomcat..
-- Subject: Unit tomcat8.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit tomcat8.service has failed.
--
-- The result is failed.
Jan 18 13:21:14 sr66-blade systemd[1]: tomcat8.service: Unit entered failed state.
Jan 18...

Read more...

Revision history for this message
Slava Sorokov (sawati) wrote :

I removed openjdk-9-jre-headless and installed default-jre.

Working now.

Revision history for this message
Thomas Mortagne (thomas-mortagne) wrote :

I got this issue during an upgrade but it was actually caused by a ghost of tomcat still running (so the start was failing because the ports were already in use). No idea how the service got lost.

so if you have this error:
* make sure you called "/etc/init.d/tomcat8 stop"
* check with "ps aux | grep java" if you still have a running Tomcat
* if that's the case kill it

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I'll note that the package wants "default-jre-headless" or "java7-runtime-headless", but the reporter's logs show that he was using oracle-java8-installer:
(...)
Setting up oracle-java8-installer (8u92+8u91arm-2~really8u91~webupd8~0) ...^M
No /var/cache/oracle-jdk8-installer/wgetrc file found.^M
Creating /var/cache/oracle-jdk8-installer/wgetrc and^M
using default oracle-java8-installer wgetrc settings for it.^M
Downloading Oracle Java 8...^M
--2016-05-10 20:48:59-- http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz^M
Resolving download.oracle.com (download.oracle.com)... 110.93.233.32, 110.93.233.18^M

# dpkg -s tomcat8-common|grep Depends
Depends: default-jre-headless | java7-runtime-headless | java7-runtime, libtomcat8-java (>= 8.0.32-1ubuntu1.4)

Revision history for this message
Bryn Jeffries (bryn-jeffries) wrote :

As Andreas says, the problem is due to the wrong JRE being installed, but at IIRC openjdk-9-jre-headless was the one installed by default in Ubuntu 16 when the Tomcat 8 package was installed. Perhaps an appropriate fix is to limit range of versions permitted.

Revision history for this message
weekleyj (weekleyj) wrote : Re: [Bug 1586054] Re: package tomcat8 8.0.32-1ubuntu1 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Perhaps a more appropriate fix is to keep the tomcat package properly
updated.

On 07/04/2017 02:12 PM, Bryn Jeffries wrote:
> As Andreas says, the problem is due to the wrong JRE being installed,
> but at IIRC openjdk-9-jre-headless was the one installed by default in
> Ubuntu 16 when the Tomcat 8 package was installed. Perhaps an
> appropriate fix is to limit range of versions permitted.
>

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

Revision history for this message
David Dombrowsky (davek) wrote :

So it looks like the bottom line is tomcat 8 doesn't support java 9?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.