Apache2 2.4.18-2ubuntu3.17 not working with apt autoupdate

Bug #1891760 reported by rjr162
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

We've had a few systems now over the past couple of days where Apache2 just quit running.
In looking at the systems, the following packages were upgrade using apt-get via apt auto update:

Start-Date: 2020-08-14 04:50:10
Commandline: /usr/bin/apt-get -o quiet=1 upgrade -y -o APT::Get::Show-Upgraded=true
Upgrade: apache2-data:amd64 (2.4.18-2ubuntu3.15, 2.4.18-2ubuntu3.17), apache2-bin:amd64 (2.4.18-2ubuntu3.15, 2.4.18-2ubuntu3.17), apache2:amd64 (2.4.18-2ubuntu3.15, 2.4.18-2ubuntu3.17), apache2-utils:amd64 (2.4.18-2ubuntu3.15, 2.4.18-2ubuntu3.17)

At the tail end of this, you can see there's an error in the sub-process /usr/bin/dpkg:
Error: Sub-process /usr/bin/dpkg returned an error code (1)

This is the first time in the logs this is showing up, all prior updates worked fine and no dpkg error was shown. Here's a snapshot of the prior update:
Start-Date: 2020-08-13 04:16:37
Commandline: /usr/bin/apt-get -o quiet=1 upgrade -y -o APT::Get::Show-Upgraded=true
Upgrade: python3-software-properties:amd64 (0.96.20.9, 0.96.20.10), software-properties-common:amd64 (0.96.20.9, 0.96.20.10)
End-Date: 2020-08-13 04:16:39

Even after this update happened, I saw the error in the logs:
Start-Date: 2020-08-15 04:53:49
Commandline: /usr/bin/apt-get -o quiet=1 autoremove -y
Error: Sub-process /usr/bin/dpkg returned an error code (1)
End-Date: 2020-08-15 04:53:49

After running 'apt upgrade' by hand, I saw php and the linux kernel were to be updated, but during this run I also got prompted about Apache2:

Unpacking php7.4-mysql (7.4.9-1+ubuntu16.04.1+deb.sury.org+1) ...
Preparing to unpack .../php-mysql_2%3a7.4+76+ubuntu16.04.1+deb.sury.org+9_all.deb ...
Unpacking php-mysql (2:7.4+76+ubuntu16.04.1+deb.sury.org+9) over (2:7.3+70+ubuntu16.04.1+deb.sury.org+6) ...
Processing triggers for libc-bin (2.23-0ubuntu11.2) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up apache2 (2.4.18-2ubuntu3.17) ...

Configuration file '/etc/apache2/apache2.conf'
 ==> Modified (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.
   What would you like to do about it ? Your options are:
    Y or I : install the package maintainer's version
    N or O : keep your currently-installed version
      D : show the differences between the versions
      Z : start a shell to examine the situation
 The default action is to keep your current version.
*** apache2.conf (Y/I/N/O/D/Z) [default=N] ?
Setting up libicu65:amd64 (65.1-1+ubuntu16.04.1+deb.sury.org+1) ...
Setting up libxml2:amd64 (2.9.10+dfsg-5+ubuntu16.04.1+deb.sury.org+3) ...
Setting up linux-modules-4.4.0-187-generic (4.4.0-187.217) ...

It seems to point to the fact that during the auto apt upgrade, apt-get even with the -y flag isn't selecting the default option of "n" to answer the prompt, causing dpkg to time out or others fail out in the eyes of the apt auto update.

I haven't encountered this before at all, so I'm going to have to guess and update to dpkg, apt, or the apache2 packages is causing some very expected behavior that's causing the Apache2 service to be stopped but then never restarted.

affects: errors → apache2 (Ubuntu)
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

Thanks for filing this bug and try to help to make Ubuntu better.

What you described does not seem a bug. Passing '-y' to apt-get does not imply it will handle conffiles in the way you expect. dpkg handles conffiles and if you want to make it work properly in a non-interactive way you need to tell it what you want. For instance, if you want to always keep the local config file instead of the one provided by the package you can use the --force-confold (force old conffile), you can also combine this option with --force-confdef which will make dpkg install new conffiles if you didn't change it locally.

To pass those options through apt-get CLI you can use something like this:

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" -o quiet=1 upgrade -y -o APT::Get::Show-Upgraded=true

For more information about those options you can take a look at:

http://manpages.ubuntu.com/manpages/xenial/en/man1/dpkg.1.html

(I am assuming you are using Xenial based on the version of the packages)

Since this is not a bug I am marking this as Invalid. If my explanation was not enough and you do not agree with it, please add more information here and change the status to New again, and we will revisit this bug.

Changed in apache2 (Ubuntu):
status: New → Invalid
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.