systemd unable to detect running apache if invoked via "apache2ctl graceful"

Bug #1832182 reported by RedScourge on 2019-06-10
36
This bug affects 6 people
Affects Status Importance Assigned to Milestone
apache2 (Debian)
New
Unknown
apache2 (Ubuntu)
Status tracked in Hirsute
Xenial
High
Bryce Harrington
Bionic
High
Bryce Harrington
Focal
High
Bryce Harrington
Groovy
High
Bryce Harrington
Hirsute
High
Bryce Harrington

Bug Description

[Impact]

Unattended upgrade will attempt to gracefully reload the Apache2 httpd service, but it reloads apache directly, not via systemd, so systemctl will mis-report the true status. This can cause unexpected and unnecessary server outages when e.g. upgrading from one LTS to another.

[Test Case]

root@server:/usr/local/sbin# apache2ctl stop
root@server:/usr/local/sbin# apache2ctl graceful
httpd not running, trying to start
root@server:/usr/local/sbin# systemctl status apache2.service
? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           +-apache2-systemd.conf
   Active: inactive (dead) since Mon 2019-06-10 01:04:13 MDT; 17s ago
  Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
 Main PID: 1849 (code=exited, status=0/SUCCESS)

Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/...
Jun 08 19:11:24 server systemd[1]: Started The Apache HTTP Server.
Jun 09 06:25:04 server systemd[1]: Reloading The Apache HTTP Server.
Jun 09 06:25:04 server systemd[1]: Reloaded The Apache HTTP Server.
Jun 10 01:04:13 server apachectl[27370]: httpd (no pid file) not running

Output after customizing the apache2ctl script and restarting it:

root@server:/usr/local/sbin# apache2ctl_custom graceful
Invoking 'systemctl start apache2'.
Use 'systemctl status apache2' for more info.
root@server:/usr/local/sbin# systemctl status apache2.service
? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           +-apache2-systemd.conf
   Active: active (running) since Mon 2019-06-10 01:04:50 MDT; 4s ago
  Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 27432 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 27444 (apache2)
    Tasks: 6 (limit: 2318)
   CGroup: /system.slice/apache2.service
           +-27444 /usr/sbin/apache2 -k start
           +-27448 /usr/sbin/apache2 -k start
           +-27449 /usr/sbin/apache2 -k start
           +-27451 /usr/sbin/apache2 -k start
           +-27454 /usr/sbin/apache2 -k start
           +-27455 /usr/sbin/apache2 -k start

Jun 10 01:04:50 server systemd[1]: Starting The Apache HTTP Server...
Jun 10 01:04:50 server systemd[1]: Started The Apache HTTP Server.

[Fix]

The fix is made somewhat obvious due to the fact that the issue was fixed for "apache2ctl start" in 18.04 LTS by replacing the regular call (which resolves to "/usr/sbin/apache2 -k start") with a check for presence of systemd, followed by an invocation of "systemctl start apache2.service" if that check is affirmative, or falling back to the old start command if that check is negative.

Attached to this bug report is a diff of the file before and after I copied the fixed invocation from the "start" subsection to the "graceful" subsection in 18.04 LTS. A fix for 16.04 LTS would require copying that block both into the "start" and "graceful" subsections.

[Regression Potential]

This alters the behavior of Debian's apache2ctl script for managing the service state. No other Apache2 code is modified. Thus things to watch for new regressions would deal with the apache service's state itself, not crashes or behavioral changes.

With a manual sysadmin-supervised service restart, if there are problems the sysadmin can intervene. The real risk of regression here would be for unsupervised or automated service updates.

[Original Report]

When starting or restarting Apache via the /usr/sbin/apache2ctl script, systemd becomes unaware of the state of Apache, causing "systemctl status apache2.service" to report "Active: inactive (dead)". Below I describe the issue and a fix; attached is the output of the diff command after I fixed it on my own 18.04 LTS system.

Despite this issue, Apache itself generally runs fine, so this is not an absolutely critical issue, however as both "systemctl status apache2.service" and "service apache2 status" become unable to detect its running state, and as some people may be scripting Apache service checks using those commands, they may experience server outages when they migrate from 14.04 LTS to 16.04 LTS or 18.04 LTS, so this could potentially have serious consequences. I suspect this caused or at least contributed to at least one outage of a web server I am responsible for, as the web file backup script was unable to restart the apache process after stopping it.

This issue affects Ubuntu 16.04 LTS when using "apache2ctl start" or "apache2ctl graceful", and Ubuntu 18.04 LTS just when using "apache2ctl graceful".

[Additional information]

lsb_release -rd :

Description: Ubuntu 18.04.2 LTS
Release: 18.04

apt-cache policy apache2:

apache2:
  Installed: 2.4.29-1ubuntu4.6
  Candidate: 2.4.29-1ubuntu4.6

Related branches

RedScourge (redscourge) wrote :

Output showing how to reproduce the issue:

root@server:/usr/local/sbin# apache2ctl stop
root@server:/usr/local/sbin# apache2ctl graceful
httpd not running, trying to start
root@server:/usr/local/sbin# systemctl status apache2.service
? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           +-apache2-systemd.conf
   Active: inactive (dead) since Mon 2019-06-10 01:04:13 MDT; 17s ago
  Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
 Main PID: 1849 (code=exited, status=0/SUCCESS)

Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/russianfake
Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/russianfake
Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/stratmeme.c
Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/stratmeme.c
Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/wasteofcach
Jun 08 19:11:24 server.wasteofcache.com apachectl[1408]: AH00112: Warning: DocumentRoot [/srv/apache2/www/wasteofcach
Jun 08 19:11:24 server.wasteofcache.com systemd[1]: Started The Apache HTTP Server.
Jun 09 06:25:04 server.wasteofcache.com systemd[1]: Reloading The Apache HTTP Server.
Jun 09 06:25:04 server.wasteofcache.com systemd[1]: Reloaded The Apache HTTP Server.
Jun 10 01:04:13 server.wasteofcache.com apachectl[27370]: httpd (no pid file) not running

Output after customizing the apache2ctl script and restarting it:

root@server:/usr/local/sbin# apache2ctl_custom graceful
Invoking 'systemctl start apache2'.
Use 'systemctl status apache2' for more info.
root@server:/usr/local/sbin# systemctl status apache2.service
? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           +-apache2-systemd.conf
   Active: active (running) since Mon 2019-06-10 01:04:50 MDT; 4s ago
  Process: 27370 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 11462 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 27432 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 27444 (apache2)
    Tasks: 6 (limit: 2318)
   CGroup: /system.slice/apache2.service
           +-27444 /usr/sbin/apache2 -k start
           +-27448 /usr/sbin/apache2 -k start
           +-27449 /usr/sbin/apache2 -k start
           +-27451 /usr/sbin/apache2 -k start
           +-27454 /usr/sbin/apache2 -k start
           +-27455 /usr/sbin/apache2 -k start

Jun 10 01:04:50 server.wasteofcache.com systemd[1]: Starting The Apache HTTP Server...
Jun 10 01:04:50 server.wasteofcache.com systemd[1]: Started The Apache HTTP Server.

RedScourge (redscourge) wrote :

(if someone could redact the domain names and file paths from the above comment that would be much appreciated)

The attachment "diff of /usr/sbin/apache2ctl after correcting issue" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Andreas Hasenack (ahasenack) wrote :

Thanks for the detailed report. It looks like it's the same issue as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=927302, so I'm linking them both together.

Changed in apache2 (Ubuntu):
status: New → Triaged
tags: added: server-next
Changed in apache2 (Ubuntu):
importance: Undecided → Low
Changed in apache2 (Debian):
status: Unknown → New
Andreas Hasenack (ahasenack) wrote :

Acknowledging that the bug still exists and is in our queue, but not at high priority.

RedScourge (redscourge) wrote :

UPDATE: I just had a server experience downtime due to this bug. An update of the apache2 package was automatically triggered on a client's 16.04 LTS server on Aug 31 via the unattended-upgrades cron script, and apparently before this update, the last time the Apache service had been restarted was done via "apachectl graceful", without an appropriately modified /usr/sbin/apachectl as described in my initial report, so the usual unattended-upgrades stop-and-start which follows an Apache update failed to perform as expected, leaving the service in the stopped state.

Therefore, it appears there is now a definite case where a user invoking "apachectl graceful" leads to downtime. To mitigate this, you can either disable/uninstall unattended-upgrades, or patch the /usr/sbin/apachectl file as described in this bug report.

I have deleted the old patch file and replaced it with an actual correct one based on the apache2ctl file on my client's server after the latest apache2 package update, now that I know how diff patch files are generated

Bryce Harrington (bryce) wrote :

Bumping importance on this bug, since it is causing downtime on production systems. It is already on our server-next queue and known in debian BTS.

Changed in apache2 (Ubuntu):
importance: Low → High
faisal (alfaesal18) on 2019-11-05
Changed in apache2 (Ubuntu):
status: Triaged → Fix Committed
faisal (alfaesal18) on 2019-11-26
Changed in apache2 (Ubuntu):
status: Fix Committed → Fix Released
Bryce Harrington (bryce) wrote :

@faisal, please don't change status on bugs without an explanation.

Changed in apache2 (Ubuntu):
status: Fix Released → Triaged
faisal (alfaesal18) on 2020-02-29
affects: apache2 (Ubuntu) → apache2 (Juju Charms Collection)
Haw Loeung (hloeung) on 2020-02-29
affects: apache2 (Juju Charms Collection) → apache2 (Ubuntu)
Haw Loeung (hloeung) on 2020-07-22
Changed in apache2 (Debian):
importance: Unknown → High
Paride Legovini (paride) wrote :

Hi RedScourge,

the attached patch is a bit dirty, probably because it has been generated by diffing apache2ctl from different package versions, and I think it has a bug: you call

  systemctl start "$APACHE_SYSTEMD_SERVICE"

in the 'restart|graceful)' case stanza, while we want 'systemctl reload' there. I'd also move the need_systemd detection logic out of the "case" to avoid duplication. For the rest I think your proposed solution is essentially correct, thanks for providing it.

Changed in apache2 (Debian):
importance: High → Unknown
Bryce Harrington (bryce) on 2020-09-28
description: updated
Changed in apache2 (Ubuntu Focal):
status: New → Triaged
importance: Undecided → High
Bryce Harrington (bryce) on 2020-09-28
Changed in apache2 (Ubuntu Bionic):
status: New → Triaged
Changed in apache2 (Ubuntu Xenial):
status: New → Triaged
Changed in apache2 (Ubuntu Bionic):
importance: Undecided → High
Changed in apache2 (Ubuntu Xenial):
importance: Undecided → High
Bryce Harrington (bryce) on 2020-09-30
Changed in apache2 (Ubuntu Groovy):
assignee: nobody → Bryce Harrington (bryce)
Bryce Harrington (bryce) on 2020-10-05
description: updated
Bryce Harrington (bryce) on 2020-11-19
Changed in apache2 (Ubuntu Xenial):
status: Triaged → Fix Committed
Changed in apache2 (Ubuntu Bionic):
status: Triaged → Fix Committed
Changed in apache2 (Ubuntu Focal):
status: Triaged → Fix Committed
Changed in apache2 (Ubuntu Groovy):
status: Triaged → Fix Committed
Changed in apache2 (Ubuntu Hirsute):
status: Triaged → Fix Committed
Changed in apache2 (Ubuntu Focal):
assignee: nobody → Bryce Harrington (bryce)
Changed in apache2 (Ubuntu Bionic):
assignee: nobody → Bryce Harrington (bryce)
Changed in apache2 (Ubuntu Xenial):
assignee: nobody → Bryce Harrington (bryce)

Hello RedScourge, or anyone else affected,

Accepted apache2 into groovy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apache2/2.4.46-1ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-groovy to verification-done-groovy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-groovy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-groovy
tags: added: verification-needed-focal
Timo Aaltonen (tjaalton) wrote :

Hello RedScourge, or anyone else affected,

Accepted apache2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-bionic
Timo Aaltonen (tjaalton) wrote :

Hello RedScourge, or anyone else affected,

Accepted apache2 into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apache2/2.4.29-1ubuntu4.15 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed-xenial
Timo Aaltonen (tjaalton) wrote :

Hello RedScourge, or anyone else affected,

Accepted apache2 into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/apache2/2.4.18-2ubuntu3.18 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Download full text (8.3 KiB)

Cool, glad to hear that an issue I uncovered has been fixed...a little
confused as to why an official fix took 18 months to deploy though,
considering it took me about 18 minutes.

On Fri, Nov 27, 2020 at 8:42 AM Timo Aaltonen <email address hidden>
wrote:

> Hello RedScourge, or anyone else affected,
>
> Accepted apache2 into focal-proposed. The package will build now and be
> available at
> https://launchpad.net/ubuntu/+source/apache2/2.4.41-4ubuntu3.2 in a few
> hours, and then in the -proposed repository.
>
> Please help us by testing this new package. See
> https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
> to enable and use -proposed. Your feedback will aid us getting this
> update out to other Ubuntu users.
>
> If this package fixes the bug for you, please add a comment to this bug,
> mentioning the version of the package you tested, what testing has been
> performed on the package and change the tag from verification-needed-
> focal to verification-done-focal. If it does not fix the bug for you,
> please add a comment stating that, and change the tag to verification-
> failed-focal. In either case, without details of your testing we will
> not be able to proceed.
>
> Further information regarding the verification process can be found at
> https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in
> advance for helping!
>
> N.B. The updated package will be released to -updates after the bug(s)
> fixed by this package have been verified and the package has been in
> -proposed for a minimum of 7 days.
>
> ** Tags added: verification-needed-bionic
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1832182
>
> Title:
> systemd unable to detect running apache if invoked via "apache2ctl
> graceful"
>
> Status in apache2 package in Ubuntu:
> Fix Committed
> Status in apache2 source package in Xenial:
> Fix Committed
> Status in apache2 source package in Bionic:
> Fix Committed
> Status in apache2 source package in Focal:
> Fix Committed
> Status in apache2 source package in Groovy:
> Fix Committed
> Status in apache2 source package in Hirsute:
> Fix Committed
> Status in apache2 package in Debian:
> New
>
> Bug description:
> [Impact]
>
> Unattended upgrade will attempt to gracefully reload the Apache2 httpd
> service, but it reloads apache directly, not via systemd, so systemctl
> will mis-report the true status. This can cause unexpected and
> unnecessary server outages when e.g. upgrading from one LTS to
> another.
>
>
> [Test Case]
>
> root@server:/usr/local/sbin# apache2ctl stop
> root@server:/usr/local/sbin# apache2ctl graceful
> httpd not running, trying to start
> root@server:/usr/local/sbin# systemctl status apache2.service
> ? apache2.service - The Apache HTTP Server
> Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor
> preset: enabled)
> Drop-In: /lib/systemd/system/apache2.service.d
> +-apache2-systemd.conf
> Active: inactive (dead) since Mon 2019-06-10 01:04:13 MDT; 17s ago
> Process: 27370 ExecStop=/usr/sbin/apachectl s...

Read more...

All autopkgtests for the newly accepted apache2 (2.4.18-2ubuntu3.18) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

passenger/5.0.27-2 (amd64, armhf, s390x, arm64, ppc64el, i386)
mod-wsgi/4.3.0-1.1ubuntu1 (amd64, armhf, s390x, arm64, ppc64el, i386)
apache2/2.4.18-2ubuntu3.18 (amd64, armhf, s390x, arm64, ppc64el, i386)
horizon/2:9.1.2-0ubuntu5 (amd64, armhf, s390x, arm64, ppc64el, i386)
libapache2-mod-python/3.3.1-11ubuntu2 (amd64, armhf, s390x, arm64, ppc64el, i386)
subversion/1.9.3-2ubuntu1.3 (amd64, armhf, s390x, arm64, ppc64el, i386)
php7.0/7.0.33-0ubuntu0.16.04.16 (amd64, armhf, s390x, arm64, ppc64el, i386)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

All autopkgtests for the newly accepted apache2 (2.4.29-1ubuntu4.15) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntuone-dev-tools/13.10-0ubuntu6 (amd64)
pinto/0.97+dfsg-4ubuntu1 (arm64)
cacti/1.1.38+ds1-1 (s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

All autopkgtests for the newly accepted apache2 (2.4.46-1ubuntu1.1) for groovy have finished running.
The following regressions have been reported in tests triggered by the package:

nova/unknown (armhf)
lemonldap-ng/2.0.8+ds1-2 (arm64)
gvfs/1.46.1-1ubuntu1 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/groovy/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

All autopkgtests for the newly accepted apache2 (2.4.41-4ubuntu3.2) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

plinth/20.3 (s390x)
munin/2.0.56-1ubuntu1 (arm64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Richard Hansen (rhansen) wrote :

apache2 2.4.18-2ubuntu3.18 fails to start on my ppc machine (4.4.0-197-powerpc-smp #229-Ubuntu):

Nov 28 14:42:31 macmini systemd[1]: Starting LSB: Apache2 web server...
Nov 28 14:42:31 macmini apache2[1284]: * Starting Apache httpd web server apache2
Nov 28 14:43:03 macmini apache2[1284]: Invoking 'systemctl start '.
Nov 28 14:43:03 macmini apache2[1284]: Use 'systemctl status ' for more info.
Nov 28 14:43:03 macmini apache2[1284]: Failed to mangle name: Invalid argument
Nov 28 14:43:03 macmini apache2[1284]: Failed to expand names: Invalid argument
Nov 28 14:43:03 macmini apache2[1284]: Action 'start' failed.
Nov 28 14:43:03 macmini apache2[1284]: The Apache error log may have more information.
Nov 28 14:43:03 macmini apache2[1284]: *
Nov 28 14:43:03 macmini apache2[1711]: * Stopping Apache httpd web server apache2
Nov 28 14:43:03 macmini apache2[1711]: *
Nov 28 14:43:03 macmini systemd[1]: Started LSB: Apache2 web server.

Downgrading to 2.4.18-2ubuntu3.17 works.

tags: added: regression-proposed
Richard Hansen (rhansen) wrote :

My ppc machine is running Xenial. I realize that ppc isn't supported, and Xenial is on its last legs, so if ppc is the only platform where this SRU fails then I can figure out a way to live with it. But I thought I'd report it anyway in case it's not only failing on ppc.

Richard Hansen (rhansen) wrote :

These are the binary packages from the apache2 source package I have installed:

apache2
apache2-bin
apache2-data
apache2-utils

tags: added: verification-failed-xenial
removed: verification-needed-xenial
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apache2 - 2.4.46-1ubuntu2

---------------
apache2 (2.4.46-1ubuntu2) hirsute; urgency=medium

  * d/apache2ctl: Also use systemd for graceful if it is in use.
    (LP: #1832182)
    - This extends an earlier fix for the start command to behave
      similarly for restart / graceful. Fixes service failures on
      unattended upgrade.

 -- Bryce Harrington <email address hidden> Mon, 05 Oct 2020 16:06:32 -0700

Changed in apache2 (Ubuntu Hirsute):
status: Fix Committed → Fix Released

Richard Hansen (rhansen)

I have same problem. Did you solve this?

systemctl status apache2
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: inactive (dead) since Вск 2020-11-29 17:43:15 EET; 18min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13871 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 13852 ExecStart=/etc/init.d/apache2 start (code=exited, status=0/SUCCESS)

Ноя 29 17:43:15 ns2 apache2[13852]: Invoking 'systemctl start '.
Ноя 29 17:43:15 ns2 apache2[13852]: Use 'systemctl status ' for more info.
Ноя 29 17:43:15 ns2 apache2[13852]: Failed to mangle name: Invalid argument
Ноя 29 17:43:15 ns2 apache2[13852]: Failed to expand names: Invalid argument
Ноя 29 17:43:15 ns2 apache2[13852]: Action 'start' failed.
Ноя 29 17:43:15 ns2 apache2[13852]: The Apache error log may have more information.
Ноя 29 17:43:15 ns2 apache2[13852]: *
Ноя 29 17:43:15 ns2 apache2[13871]: * Stopping Apache httpd web server apache2
Ноя 29 17:43:15 ns2 apache2[13871]: *
Ноя 29 17:43:15 ns2 systemd[1]: Started LSB: Apache2 web server.

Richard Hansen (rhansen) wrote :

> I have same problem.

What architecture? (you can run "uname -m")
What version of Ubuntu? (you can run "lsb_release -a")
What version of apache2?

> Did you solve this?

Yes, by downgrading to 2.4.18-2ubuntu3.17.

Zsolt Jónás (jonas-zsolt) wrote :

I had the same problem.

# uname -m
x86_64

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial

# dpkg -l \*apache\* | grep ^i
ii apache2 2.4.18-2ubuntu3.18 amd64 Apache HTTP Server
ii apache2-bin 2.4.18-2ubuntu3.18 amd64 Apache HTTP Server (modules and other binary files)
ii apache2-data 2.4.18-2ubuntu3.18 all Apache HTTP Server (common files)
ii apache2-dev 2.4.18-2ubuntu3.18 amd64 Apache HTTP Server (development headers)
ii apache2-utils 2.4.18-2ubuntu3.18 amd64 Apache HTTP Server (utility programs for web servers)

only solution for me was to downgrade back to 2.4.18-2ubuntu3.17 too

Zsolt Jónás (jonas-zsolt) wrote :

> do you have a how to for downgrading to 2.4.18-2ubuntu3.17?

# wget https://<your-ubuntu-mirror>/ubuntu/pool/main/a/apache2/apache2-bin_2.4.18-2ubuntu3.17_amd64.deb
# wget https://<your-ubuntu-mirror>/ubuntu/pool/main/a/apache2/apache2-data_2.4.18-2ubuntu3.17_all.deb
# wget https://<your-ubuntu-mirror>/ubuntu/pool/main/a/apache2/apache2-dev_2.4.18-2ubuntu3.17_amd64.deb
# wget https://<your-ubuntu-mirror>/ubuntu/pool/main/a/apache2/apache2-utils_2.4.18-2ubuntu3.17_amd64.deb
# wget https://<your-ubuntu-mirror>/ubuntu/pool/main/a/apache2/apache2_2.4.18-2ubuntu3.17_amd64.deb

or those packages what you have installed and after downloading:

# dpkg -i apache2*.deb

Valentin Steiner (vsteiner) wrote :

I got the same problem, apache2 doesn't start after the update to 2.4.18-2ubuntu3.18. I got the same output as in Comment 25. I noticed the problem in the browser when I couldn't get to my locally served web pages.

$ uname -m
x86_64

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.7 LTS
Release: 16.04
Codename: xenial

I also had to downgrade to get apache2 running again, using:

aptitude install apache2-bin=2.4.18-2ubuntu3.17 apache2-data=2.4.18-2ubuntu3.17 apache2=2.4.18-2ubuntu3.17

Bryce Harrington (bryce) wrote :

Thanks for testing and reporting the regression for xenial. I'll investigate.

[Note that the update is currently only available if you have the xenial-proposed pocket enabled in your server. We really do appreciate people testing and reporting problems against -proposed, but definitely note that if this impacted a production server you may want to consider enabling only xenial-updates and not xenial-proposed, to help avoid surprises like this.]

Bryce Harrington (bryce) wrote :

And yes, the command Valentin posted in comment #30 is the correct workaround:

sudo apt-get install apache2-bin=2.4.18-2ubuntu3.17 apache2-data=2.4.18-2ubuntu3.17 apache2=2.4.18-2ubuntu3.17

Bryce Harrington (bryce) on 2020-12-01
Changed in apache2 (Ubuntu Xenial):
status: Fix Committed → In Progress
Nolan Casados (nolan-casados) wrote :

It seems the problem is an undefined variable APACHE_SYSTEMD_SERVICE. I think that's supposed to be defined in /etc/init.d/apache2.

Bryce Harrington (bryce) wrote :

@Nolan ah you're probably correct.

Meanwhile, I've prepared a PPA package that simply reverts the change. If someone can please install and test that this removes the problem, I will go ahead and upload it to back out the problematic change so it doesn't hit other folks.

All autopkgtests for the newly accepted apache2 (2.4.18-2ubuntu3.18) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

libapache2-mod-python/3.3.1-11ubuntu2 (amd64, armhf, arm64, i386, ppc64el, s390x)
php7.0/7.0.33-0ubuntu0.16.04.16 (amd64, armhf, arm64, i386, ppc64el, s390x)
mod-wsgi/4.3.0-1.1ubuntu1 (amd64, armhf, arm64, i386, ppc64el, s390x)
subversion/1.9.3-2ubuntu1.3 (amd64, armhf, arm64, i386, ppc64el, s390x)
horizon/2:9.1.2-0ubuntu5 (amd64, armhf, arm64, i386, ppc64el, s390x)
apache2/2.4.18-2ubuntu3.18 (amd64, armhf, arm64, i386, ppc64el, s390x)
passenger/5.0.27-2 (amd64, armhf, arm64, i386, ppc64el, s390x)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

All autopkgtests for the newly accepted apache2 (2.4.18-2ubuntu3.18) for xenial have finished running.
The following regressions have been reported in tests triggered by the package:

mod-wsgi/4.3.0-1.1ubuntu1 (arm64, s390x, amd64, i386, armhf, ppc64el)
php7.0/7.0.33-0ubuntu0.16.04.16 (arm64, s390x, amd64, i386, armhf, ppc64el)
passenger/5.0.27-2 (arm64, s390x, amd64, i386, armhf, ppc64el)
apache2/2.4.18-2ubuntu3.18 (arm64, s390x, amd64, i386, armhf, ppc64el)
subversion/1.9.3-2ubuntu1.3 (arm64, s390x, amd64, i386, armhf, ppc64el)
horizon/2:9.1.2-0ubuntu5 (arm64, s390x, amd64, i386, armhf, ppc64el)
libapache2-mod-python/3.3.1-11ubuntu2 (arm64, s390x, amd64, i386, armhf, ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/xenial/update_excuses.html#apache2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

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

Other bug subscribers

Remote bug watches

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