Can't update due to DNSMasq

@nachoparker, All

Iā€™m currently running NC15.0.4 under NCPi 1.3.6, but am being told that 1.5.1 is available for update. However if I try it (either via the panel or the command line) itā€™s choking on the current dnsmasq install:

sudo apt-get upgrade
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
Calculating upgradeā€¦ Done
The following packages have been kept back:
certbot php7.2-bz2 php7.2-cli php7.2-common php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-json
php7.2-ldap php7.2-mbstring php7.2-mysql php7.2-opcache php7.2-readline php7.2-xml php7.2-zip python-acme
0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up dnsmasq (2.76-5+deb9u2) ā€¦
dpkg: error processing package dnsmasq (ā€“configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
dnsmasq
E: Sub-process /usr/bin/dpkg returned an error code (1)

If I try to configure it via dpkg --configure I get the same error code 1 as well and the update bombs out.

Can anyone advise what I should try to unstick things and let the update happen properly?

maybe try purging dnsmasq and installing it again. If you had it activated, run it from ncp-config to re-apply your settings.

@nachoparker - Thanks for the reply. Tried that, and it fails with both apt-get and dpkg:

root@2b900b399526:/# sudo apt-get purge dnsmasq
Reading package listsā€¦ Done
Building dependency tree
Reading state informationā€¦ Done
The following packages were automatically installed and are no longer required:
dnsmasq-base libnetfilter-conntrack3 libnfnetlink0
Use ā€˜sudo apt autoremoveā€™ to remove them.
The following packages will be REMOVED:
dnsmasq*
0 upgraded, 0 newly installed, 1 to remove and 17 not upgraded.
1 not fully installed or removed.
After this operation, 72.7 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ā€¦ 20024 files and directories currently installed.)
Removing dnsmasq (2.76-5+deb9u2) ā€¦
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of stop.
(Reading database ā€¦ 20015 files and directories currently installed.)
Purging configuration files for dnsmasq (2.76-5+deb9u2) ā€¦
dpkg: error processing package dnsmasq (ā€“purge):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
dnsmasq
E: Sub-process /usr/bin/dpkg returned an error code (1)

root@2b900b399526:/# sudo dpkg --purge dnsmasq
(Reading database ā€¦ 20010 files and directories currently installed.)
Purging configuration files for dnsmasq (2.76-5+deb9u2) ā€¦
dpkg: error processing package dnsmasq (ā€“purge):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
dnsmasq

Same error code as before, and looks like some problem with systemd?

@nachoparker Do you have any further thoughts, or am I looking at nuking the container and setting up a new one (again) to sort this out?

Is there any easier way to force a container reinstall from the image?

if you are in docker you can try to stop and remove the container and starting it again (you could also pull the latest one).

Just in case, always make backups or a copy of your volume

@nachoparker - unfortunately that seems to have completely broken it.

Stopped and removed the container, built a new one and now iā€™m getting this in the log:

Making /usr/local/bin persistent ā€¦

Starting PHP-fpm

Starting Apache

AH00526: Syntax error on line 5 of /etc/apache2/sites-enabled/ncp.conf:

SSLCertificateFile: file ā€˜/etc/letsencrypt/live/URLRemoved/fullchain.pemā€™ does not exist or is empty

Action ā€˜startā€™ failed.

The Apache error log may have more information.

Starting Redis

Starting Cron

Starting Postfix

ERROR 2002 (HY000): Canā€™t connect to local MySQL server through socket ā€˜/var/run/mysqld/mysqld.sockā€™ (2 ā€œNo such file or directoryā€)



e

Even removed the image and started afresh (but with same data stored on my USB drive as the original one) so looks like something has got very corrupted somewhere in there?

Am I forced to salvage what I can off the USB drive and then start totally afresh? Any other ideas to save my previous set-up?

Iā€™ve removed my url from the log, but aside from that itā€™s as seen.

well, normally the easiest is to restore a backup. You can also try to fix whatā€™s broken if you have some linux knowledge.

You can change the following lines in /etc/apache2/sites-available/ files nextcloud.conf and ncp.conf

   SSLCertificateFile      /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

Thanks :slight_smile:

In the end I blew the container away again, renamed the whole data folder tree and then started a fresh container. Then moved the user data folder from the old tree into the new one and had it rescan and now Iā€™ve got a working system again, fully up to date.

DNSMasq and LetsEncrypt are back up and working too, so at least for now things are good. Next will be to stop the whole server and back up the SD card just in case, and weā€™re good to go again.

1 Like