[SRU] Tomcat6 fails to upgrade if JAVA_OPTS contains /

Bug #654549 reported by Nick W.
88
This bug affects 12 people
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Fix Released
Medium
Thierry Carrez
Maverick
Won't Fix
Medium
Unassigned

Bug Description

IMPACT:
This bug will impact tomcat6 installs upgrading to Maverick and updates in Maverick itself; its fixed in Natty.

Using the '/' character in JAVA_OPTS is quite common - its normally used to specify the filesystem location for additional application files such as those for Hudson:

 -Dhudson.home=/home/hudson

Updates/upgrades using this type of option will fail.

FIX:
tomcat6.postinst uses sed to parse various debconf answers into a template which is used to generate /etc/default/tomcat6; this currently uses '/' as the pattern delimiter - the fix switches this to '%' which is unlikely to be used in JAVA_OPTS.

PATCH:
See linked branch

TEST CASE 1:
sudo apt-get install tomcat6
sudo dpkg-reconfigure tomcat6
 Accept all default for user and group
 Add an additional parameter to JAVA_OPTS - "-Dtest.dir=/var/log/nonsense"

Reconfiguration will fail with "sed: -e expression #1, char 44: unknown option to `s'"

TEST CASE 2:
sudo apt-get install tomcat6
sudo vi /etc/default/tomcat6
 Add an additional parameter to JAVA_OPTS - "-Dtest.dir=/var/log/nonsense"
sudo dpkg-reconfigure tomcat6
 Accept all default values

Reconfiguration will fail with "sed: -e expression #1, char 44: unknown option to `s'"

IMPACT:
Minor change to maintainer script; already in development release so limited regression potential.

>>> Original bug report <<<

Binary package hint: tomcat6

tomcat upgrade fails with the following error:

"sed: -e expression #1, char 44: unknown option to `s'"

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: tomcat6 6.0.28-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.35-22.33-server 2.6.35.4
Uname: Linux 2.6.35-22-server x86_64
Architecture: amd64
Date: Mon Oct 4 15:51:21 2010
InstallationMedia: Ubuntu-Server 10.04.1 LTS "Lucid Lynx" - Release amd64 (20100816.2)
PackageArchitecture: all
ProcEnviron:
 LANG=en_GB.utf8
 SHELL=/bin/bash
SourcePackage: tomcat6

Related branches

Revision history for this message
Nick W. (nw221) wrote :
Revision history for this message
Thierry Carrez (ttx) wrote :

Could you attach your /etc/default/tomcat6 file, please.

Changed in tomcat6 (Ubuntu):
assignee: nobody → Thierry Carrez (ttx)
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Thierry Carrez (ttx) wrote :

Installed tomcat6 on Lucid, do-release-upgrade -d to maverick -> works.
So it's probably due to a missing or borked configuration.

Changed in tomcat6 (Ubuntu):
assignee: Thierry Carrez (ttx) → nobody
importance: High → Low
Revision history for this message
Thierry Carrez (ttx) wrote :

We'd like to figure out what's causing this bug for you, but we haven't heard back from you in a while. Could you please provide the requested information? Thanks!

Revision history for this message
StuartYeates (stuart-yeates) wrote :

I have this problem too. The source of the problem appears to be that I didn't accept the new version of the config file when asked but opted to keep my old version. Later processing assumed the new config file.

Revision history for this message
Thierry Carrez (ttx) wrote :

ok, I see it now. The sed call in the tomcat6.postinst doesn't filter out some characters (especially "/") so if you submit a JAVA_OPTS containing a / it will fail. Needs to be fixed.

Workaround is to edit your JAVA_OPTS before upgrade to make sure they don't contain /, then fix it up afterwards.

Changed in tomcat6 (Ubuntu):
importance: Low → Medium
status: Incomplete → Triaged
summary: - Cannot Upgrade Tomcat6 when doing release upgrade from lucid to maverick
+ Tomcat6 fails to upgrade if JAVA_OPTS contains /
Revision history for this message
Thierry Carrez (ttx) wrote : Re: Tomcat6 fails to upgrade if JAVA_OPTS contains /

Fixed in Debian 6.0.28-7, will sync.

Changed in tomcat6 (Ubuntu):
assignee: nobody → Thierry Carrez (ttx)
status: Triaged → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

Fixed in Natty in 6.0.28-7

Changed in tomcat6 (Ubuntu):
status: In Progress → Fix Released
Changed in tomcat6 (Ubuntu Maverick):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Assen Sharlandjiev (assen-sharlandjiev) wrote :

I can confirm that upgrade fails when I have the following set in my /etc/default/tomcat6:

JAVA_OPTS="${JAVA_OPTS} -DHUDSON_HOME=/opt/hudson"

Revision history for this message
Luis Arias (kaaloo) wrote :

I also confirm this bug is still present.

James Page (james-page)
Changed in tomcat6 (Ubuntu Maverick):
assignee: nobody → James Page (james-page)
summary: - Tomcat6 fails to upgrade if JAVA_OPTS contains /
+ [SRU] Tomcat6 fails to upgrade if JAVA_OPTS contains /
James Page (james-page)
Changed in tomcat6 (Ubuntu Maverick):
status: Confirmed → In Progress
James Page (james-page)
description: updated
Changed in tomcat6 (Ubuntu Maverick):
importance: Low → Medium
James Page (james-page)
description: updated
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

ACK on the debdiff. Package is now uploaded to -proposed for SRU team processing.

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Accepted tomcat6 into maverick-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in tomcat6 (Ubuntu Maverick):
status: In Progress → Fix Committed
tags: added: verification-needed
tags: added: testcase
Revision history for this message
James Page (james-page) wrote :

As this did not get verified in a timely fashion this change has not landed in maverick and has been superseded by the most recent security updates to land for tomcat6.

James Page (james-page)
Changed in tomcat6 (Ubuntu Maverick):
status: Fix Committed → Confirmed
James Page (james-page)
Changed in tomcat6 (Ubuntu Maverick):
assignee: James Page (james-page) → nobody
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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