Updating webmin-virtual-server (8.0.1.gpl) to webmin-virtual-server (8.1.0.gpl-1) gets stuck

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.621
Virtualmin version 8.1.0 GPL

Hello,

While running “sudo apt upgrade” via SSH to update Virtualmin 8.0.1 to 8.1.0, dpkg got stuck.
First this happened at 78%.
After waiting half an hour, nothing happened.
Opening Webmin showed that it had actually updated to 8.1.0, but apparently not completely, or DPKG didn’t think it succeeded, in any case, trying another “sudo apt upgrade” via SSH to finish the other updates gives the error message

dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

But doing this starts the "Setting up webmin-virtual-server (8.1.0.gpl-1) " over again, and it again gets stuck, this time at 71%.

Webmin and Virtualmin seem to be functioning correctly, but how to fix DPKG to get it to stop trying to re-run the webmin-virtual-server (8.1.0.gpl-1) update ?

It’s getting hung during the postinstall script, I assume. Which shouldn’t happen…you may want to strace the hung process PID to see what it’s trying to do.

You might also look at the webmin-virtual-server maintainer scripts in /var/lib/dpkg/info to see if anything jumps out as being an issue on your system. If not, you could add some debug “echo” lines to the postinst script to tell you where it’s hanging and then do dpkg --configure -a and see roughly where it hangs.

Many thanks.
It somehow resolved itself, and dpkg works normally again, so I have no idea what could have caused it.

I had the same problem and it showed, that my firewall is too aggressive, for this upgrade,
so I got a network failure. Maybe other users can “solve” this with a timeout for themself,
but my server (devuan6) was “endless” waiting. With a short period of time to allow traffic
since the upgrade, it was working normal. I only open webmin/usermin ports, when i am on
the server (like port-knocking), and again, if the ports are closed, this breaks the upgrade
on my machine.

That indicates a bug in our postinstall script. I assume it’s doing a config check or something else that uses our online tools for checking connectivity and such. But, a package simply isn’t allowed to do things that can hang. If an error can occur or there’s a network request that can fail, that’s going to cause problems for someone and leave the package manager in an unhappy state until it is manually corrected.

I’ll ask @Jamie to take a look.

/usr/bin/perl /usr/share/webmin/run-postinstalls.pl virtual-server

strace -p 1397 -f -tt -s 200

strace: Process 1397 attached
02:52:14.110875 connect(5, {sa_family=AF_INET, sin_port=htons(00000), sin_addr=inet_addr(“1.1.1.1”)}, 16

Is this enough information? I changed port/IP manually here for reporting.

That indicates a DNS lookup is happening, which isn’t a surprise since I’m assuming the problem is a network request happening.

I’m sure Jamie knows what it’s doing in the postinstall, it just shouldn’t be happening there. If those network requests really have to happen during package installation then it can’t be possible to fail (i.e. it has to timeout in a reasonable time/fashion and exit without error), but it’d be better if network requests don’t happen at all in a package during install.

There are packages that do it, but they always exit with true. One I know of is the freshclam package, which starts the service, which doesn’t block, and also uses || true: https://sources.debian.org/src/clamav/0.99%2Bdfsg-0%2Bdeb7u2/debian/clamav-freshclam.postinst.in/#L360

We certainly shouldn’t be doing any outgoing network requests as part of the postinstall, but I can’t guarantee we’re not doing any DNS lookups … especially for the names of hosted domains.

What are the actual IP and port in that connect call? We’d need that in order to determine what kind of network traffic is being blocked on.

It’s to 1.1.1.1, which is Cloudflare’s global DNS system. (Unless it’s not really that, and has been anonymized.)

Good point!

@Joncas @user1222 Apply this patch and let us know if it fixes your issue:

webmin patch https://github.com/virtualmin/virtualmin-gpl/commit/d455e858

I am really sorry for this missunderstanding. It’s not DNS, it was my fault to
anonymize this in a really bad way!

sin_port=htons(00000) ← is the webmin Port
sin_addr=inet_addr(“1.1.1.1”) ← is the main webmin-IP

1 Like