Forum: 

WEBMIN error after apt-upgrade

ClayB's picture

Can't access my Webmin interface, http://192.168.100.8:12321.

I ran an apt-dist upgrade and after a while, everything went according to plan, other than not being able to access webmin anymore. Sites all function properly, adminer and shell still function (at ports 12320 and 12322).

Any ideas what happened and can it be reversed or salvaged?

Jeremy Davis's picture

We have just updated the available webmin packages in our archive. The new Webmin package has been tested and works fine, but it shuts Webmin as part of the upgrade process but doesn't restart it. So you need to do that manually or simply reboot. You'll probably also want to install the new HTML file manager.
service webmin start
apt-get install webmin-filemin

Having said that this is probably a good reminder. Although commands like "apt-get upgrade" or "apt-get dist-upgrade" should be relatively safe, on a production server (or any server that contains data you care about) you should always have a current working backup handy to restore to if need be...

TurnKey appliances have security updates auto installed nightly so there generally isn't a need to do upgrades anyway.

ClayB's picture

How many times will I overlook the simple things before trying them first?!?! Reboot solved the problem, thanks for the info!

Marmite Sandwich's picture

I seem to get this situation from time to time where the webmin port (12321) is unresponsive. Rebooting brings it back to life, but can be rather inconvenient. Is there an easier way to restart/wake up webmin? I tried the 2 commands above without success. Marmite
Jeremy Davis's picture

Webmin runs as it's own service, but is hidden behind stunnel, so I'd check both of those to see which one has crashed. You can start/stop/restart and check the status of services with the 'service' command. The specific service names in this case are 'webmin' and 'stunnel4'. The service command works like this:
service <SERVICE_NAME> <status|start|stop[|restart]>
So to see if those services are running, check like this:
service webmin status
service stunnel4 status

Look for a line that starts with 'Active:'. If everything is as it should be, it will be 'active (running)'. Services that are not enabled to auto start or have been manually stopped will report 'inactive (dead)'. A service which has crashed will report as 'active (exited)'. E.g. here's the status of Webmin on my TKLDev server (Webmin is disabled by default on TKLDev):

# service webmin status
* webmin.service - LSB: Webmin
   Loaded: loaded (/etc/init.d/webmin)
   Active: inactive (dead)
And on a fileserver I have running locally (Webmin is running):
# service webmin status
* webmin.service - LSB: Webmin
   Loaded: loaded (/etc/init.d/webmin)
   Active: active (running) since Sat 2017-04-29 05:12:41 UTC; 2 days ago
   CGroup: /system.slice/webmin.service
           `-853 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

Apr 29 05:12:38 fileserver perl[515]: pam_unix(webmin:auth): authentication failure; logname= uid=0 euid=0 tty= ruser= rhost=  user=root
Apr 29 05:12:40 fileserver webmin[515]: Webmin starting
Apr 29 05:12:41 fileserver webmin[500]: Starting webmindone.
Apr 29 05:12:41 fileserver systemd[1]: Started LSB: Webmin.

So if either of those are not in a 'active (running)' state then you'll need to start (or restart) them. In this case, restart is a fine option although note that some services need to be 'stop'/'start' cycled and will error if you 'restart', but it's worth a try! :) So restart is like this:

service webmin restart
service stunnel4 restart

It's probably also worth trying to track down the cause of the crashes. As a general rule, services crashing unexpectedly is a sign that something is not right. Linux in general, but Debian (what TurnKey is based on) in particular should be rock solid stable! So it could be warning you of something wrong. E.g. insufficient resources (most likely RAM or disk space), something configured incorrectly (e.g. services fighting for use of a particular port (only one application can use a port at a time), early stages of hardware failure (RAM and/or disk corruption).

Marmite Sandwich's picture

Many thanks Jeremy.  It will be a few days before I can try this out.  I will let you know the outcome.  Regards  Marmite 
Marmite Sandwich's picture

That was a very useful response, Jeremy, and I was able to restart webmin as a result. However, I am a bit worried that the service is crashing in the first place, because it suggests something is wrong. My Linux skills don't go far enough to understand the responses I got. First the status:-
root@fileserver ~# service webmin status
* webmin.service - LSB: Webmin
   Loaded: loaded (/etc/init.d/webmin)
   Active: active (exited) since Mon 2017-05-08 15:08:14 BST; 1 day 4h ago

May 08 15:08:14 fileserver webmin[535]: Starting webmindone.
May 08 15:08:14 fileserver systemd[1]: Started LSB: Webmin.
May 08 15:16:34 fileserver webmin[945]: Timeout of session for !root
May 08 17:13:20 fileserver webmin[945]: Timeout of session for root
May 08 17:13:20 fileserver webmin[945]: Timeout of session for root
May 08 17:13:20 fileserver webmin[945]: Timeout of session for !root
May 08 17:13:20 fileserver webmin[945]: Timeout of session for !root
May 08 17:13:20 fileserver webmin[945]: Timeout of session for root
May 08 21:44:11 fileserver perl[6075]: pam_unix(webmin:session): session opened for user root by (uid=0)
May 08 21:44:11 fileserver webmin[6075]: Successful login as root from 127.0.0.1

So the service started yesterday (May 8) at 15:08, and when I tried to access it, I was successful initially and at 21:44, although it looks like I omitted to log out properly the first time. But by today (May 9 @ 19:25) it had exited and would not come up in Chrome. This is what the restart looked like:-
root@fileserver ~# service webmin restart
root@fileserver ~# service webmin status
* webmin.service - LSB: Webmin
   Loaded: loaded (/etc/init.d/webmin)
   Active: active (running) since Tue 2017-05-09 19:28:48 BST; 9s ago
  Process: 20426 ExecStop=/etc/init.d/webmin stop (code=exited, status=1/FAILURE)
  Process: 20433 ExecStart=/etc/init.d/webmin start (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/webmin.service
           `-20436 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf

May 09 19:28:44 fileserver systemd[1]: Unit webmin.service entered failed state.
May 09 19:28:44 fileserver systemd[1]: Starting LSB: Webmin...
May 09 19:28:45 fileserver perl[20435]: pam_unix(webmin:auth): authentication failure; logname= uid...root
May 09 19:28:47 fileserver webmin[20435]: Webmin starting
May 09 19:28:48 fileserver webmin[20433]: Starting webmindone.
May 09 19:28:48 fileserver systemd[1]: Started LSB: Webmin.
Hint: Some lines were ellipsized, use -l to show in full.
It looks like it wasn't happy about something, but the browser came up ok. Any suggestions about what might be going on much appreciated. Marmite
Jeremy Davis's picture

I suggest that next time, you run the status command before you restart. That way you should see the log entries of what caused the issue (instead of info about it restarting). BTW the restart looks fine. The line "pam_unix(webmin:auth): authentication failure; logname= uid...root" is expected on start up.

You can access the full log info pretty easy. Try this command to see the history. What we're looking for is when the service actually crashed. The error message related to that will (hopefully) give us a better understanding of what is going wrong. So try this:

journalctl -u webmin

It's interactive so you can browse up and down through the history and exit with the 'q' key. If you see anything that looks relevant please post the line and the few above and below it. Although, often the more the better... So if you want to post the full last day or so (so long as it's failed within that time).

Marmite Sandwich's picture

I have other services which stop mysteriously, so I am starting another thread about this. Many thanks to Jeremy for help to date. Marmite
Marmite Sandwich's picture

Struggling to start new post because of spam filter. Lost 30 mins work composing my first attempt. Will keep trying.

Marmite

Jeremy Davis's picture

So you should miss most of the spam measures now.

Also FWIW, I use a chrome extension called Lazarus: Form Recovery. It hasn't been updated for a while and isn't as reliable as it used to be. But it still saves me tons of lost typing on websites! Maybe there's a newer/better alternative.

Post new comment