Bug#1016131: libapache2-mod-jk: Apache does not start after upgrade (JkWorkersFile only allowed once)

2023-02-06 Thread Markus Koschany
Hello,

On Wed, 27 Jul 2022 20:36:06 +0200 Thorsten Glaser  wrote:
> Package: libapache2-mod-jk
> Version: 1:1.2.48-1
> Severity: critical
> Justification: breaks unrelated software
> X-Debbugs-Cc: t...@mirbsd.de
> 
> After upgrading from buster to bullseye, apache2 does not start any more
> if libapache2-mod-jk was installed and active prior to the upgrading:

I had only a quick look at this issue. I remember that one configuration file
was wrongly named back when Stretch was oldstable and Buster the new stable
distribution. For now I suggest to downgrade this bug to important because the
issue is not present when upgrading from Bullseye to Bookworm. I can take a
look at it later. We probably only need to use a maintscript file to remove the
obsolete configuration file on upgrade.

Regards,

Markus


signature.asc
Description: This is a digitally signed message part


Bug#1016131: libapache2-mod-jk: Apache does not start after upgrade (JkWorkersFile only allowed once)

2022-07-27 Thread Thorsten Glaser
Package: libapache2-mod-jk
Version: 1:1.2.48-1
Severity: critical
Justification: breaks unrelated software
X-Debbugs-Cc: t...@mirbsd.de

After upgrading from buster to bullseye, apache2 does not start any more
if libapache2-mod-jk was installed and active prior to the upgrading:

$ sudo cleanenv / /etc/init.d/apache2 start
Starting Apache httpd web server: apache2 failed!
The apache2 configtest failed. ... (warning).
Output of config test was:
AH00526: Syntax error on line 23 of /etc/apache2/mods-available/httpd-jk.conf:
JkWorkersFile only allowed once
Action 'configtest' failed.
The Apache error log may have more information.

This is caused by:

$ sudo fgrep -ri JkWorkersFile /etc/
/etc/apache2/mods-available/jk.conf:JkWorkersFile 
/etc/libapache2-mod-jk/workers.properties
/etc/apache2/mods-available/httpd-jk.conf:JkWorkersFile 
/etc/libapache2-mod-jk/workers.properties

Both files exist…

$ ll /etc/apache2/mods-available/jk.conf 
/etc/apache2/mods-available/httpd-jk.conf
-rw-r--r-- 1 root root 4802 Oct 14  2018 
/etc/apache2/mods-available/httpd-jk.conf
-rw-r--r-- 1 root root 4802 Jun  4  2020 /etc/apache2/mods-available/jk.conf

… and belong to the same package(!):

$ dpkg -S /etc/apache2/mods-available/jk.conf 
/etc/apache2/mods-available/httpd-jk.conf
libapache2-mod-jk: /etc/apache2/mods-available/jk.conf
libapache2-mod-jk: /etc/apache2/mods-available/httpd-jk.conf


My best guess is that the conffile was renamed but the renaming
process was done improperly / violating Policy.

As both files are identical…

$ md5sum /etc/apache2/mods-available/jk.conf 
/etc/apache2/mods-available/httpd-jk.conf
f6ebd56d10bf0dcb17d79b2133cb9f5c  /etc/apache2/mods-available/jk.conf
f6ebd56d10bf0dcb17d79b2133cb9f5c  /etc/apache2/mods-available/httpd-jk.conf

… I guess I can manually deactivate and remove one. Looking at
https://packages.debian.org/bullseye/libapache2-mod-jk and
https://packages.debian.org/bullseye/amd64/libapache2-mod-jk/filelist
httpd-jk.conf seems to be the one that has to go (this is a hint for
other people running into this issue).


The root cause of this is that applications using mod_jk in buster
had to do a workaround to load httpd-jk.conf due to #928813 so…

# work around Debian #928813

# either /etc/apache2/conf-available/httpd-jk.conf with a2enconf 
httpd-jk
# *or*   /etc/apache2/mods-available/jk.conf   with a2enmod jk
# would be correct, but here we are
Include /etc/apache2/mods-available/httpd-jk.conf


… ends up loading this twice because the old file was not removed
during the upgrade.

$ sudo rm /etc/apache2/mods-available/httpd-jk.conf
$ sudo cleanenv / /etc/init.d/apache2 start
Starting Apache httpd web server: apache2 ..

This helped, indeed.



-- System Information:
Debian Release: 11.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'oldstable-updates'), (500, 'stable'), (500, 'oldstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.19.0-21-amd64 (SMP w/3 CPU threads)
Locale: LANG=C.UTF-8, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/lksh
Init: sysvinit (via /sbin/init)

Versions of packages libapache2-mod-jk depends on:
ii  apache2-bin [apache2-api-20120211]  2.4.54-1~deb11u1
ii  libc6   2.31-13+deb11u3

libapache2-mod-jk recommends no packages.

Versions of packages libapache2-mod-jk suggests:
pn  libapache-mod-jk-doc  
ii  tomcat9   9.0.64-1wtf1

-- no debconf information