Cant start webmin after Debian Upgrade

SYSTEM INFORMATION
OS type and version Debian 11
Webmin version Unknown

● webmin.service - LSB: web-based administration interface for Unix systems
Loaded: loaded (/etc/init.d/webmin; generated)
Active: failed (Result: exit-code) since Thu 2024-05-16 00:14:50 CEST; 8h ago
Docs: man:systemd-sysv-generator(8)
Process: 2029 ExecStart=/etc/init.d/webmin start (code=exited, status=127)
CPU: 20ms

May 16 00:14:50 ns3sdfsdfds.eu systemd[1]: Starting LSB: web-based administration interface for Unix systems…
May 16 00:14:50 ns3dsfsdfsd.eu systemd[1]: webmin.service: Control process exited, code=exited, status=127/n/a
May 16 00:14:50 ns3dsfsdfsd.eu systemd[1]: webmin.service: Failed with result ‘exit-code’.
May 16 00:14:50 ns3dsfsdfsd.eu systemd[1]: Failed to start LSB: web-based administration interface for Unix systems.

I upgraded Debian 10 to 11, but the upgrade wasnt smooth… had issues… Later when Logged myself to vitualmin I saw many packages available to upgrade. I started upgrading them and then lost connection to webmin/virtualmin. Maybe there a webmin upgrade and then it got disappeared…

I dont see webmin in /etc also /var/webmin/miniserv.error doesnt exist. Something went wrong… shall I reinstall webmin/virtualmin from CLI? Would that harm existing virtual servers/settings? I would be glad for any tips/hints!

That’s a disaster. I hope you have a good backup.

Things are already harmed. Virtualmin domain metadata/configuration lives in /etc/webmin, if you don’t have backups and you really don’t have that directory, you no longer have Virtualmin settings, users, etc.

Are the VirtualHosts still present in the Apache (or nginx) configuration? If so, and if you don’t have backups, the best bet may be importing the domains (but that will likely involve some manual cleaning up of users and databases and such to make sure the right users own the right stuff).

You definitely should not run the Virtualmin install script on a system that isn’t a freshly installed OS. You might be able to safely install the webmin and virtualmin-lamp-stack or virtualmin-lemp-stack (for nginx, or the minimal variant if that’s what you had before) packages. I’d proceed with caution on that plan, though. What what’s being installed, don’t use the -y option, so you can stop it if it’s going to do something stupid, like remove packages you need.

Something had to have gone wrong aside from package upgrades. There’s no point in the upgrade where a packages configuration files are removed. That only happens if you purge a package. I would recommend you figure out what actually happened before deciding what to do.

A major version upgrade can get messy, but it doesn’t get messy in that way, at least that I’ve ever seen. Did you run apt autoremove after the upgrade? That can cause chaos if you don’t read what it’s removing. I’d recommend you review the package manager logs (maybe in /var/lib/dpkg or /var/lib/apt?) to see what actually happened.

I always updated the packages over virtualmin GUI and never faced a problem before. But I also dont have a backup :frowning:

I still have a webmin file under
/etc/init.d and /etc/pam.d

Also I have a webmin folder here /usr/share/webmin/bootstrap

Usermin folder:
/etc/usermin

In apache2 /etc/apache2/sites-enabled
I see my websites.

The websites are running and seem to be okay with their databases etc.

When I go to /var/lib/dpkg or /var/lib/apt I see many folders and files, which one should I check?

You don’t backup /etc before distribution upgrade? It’s potentialy “way to hell”. Distribution upgrade is slightly different that strandard upgrade. Debian way is from commandline, and if you need upgrade it remotely, then best it use commandline over screen or tmux. And after modify sources.lists use apt update and first time only apt upgrade and second time apt dist-upgrade. I have server with Debian, that upgraded without reinstall from Etch version. With feew problems, but without reinstall.

@Anarchy did your system have etckeeper installed, does this not keep working copy of the etc directory in Git format.

/.git/

2 Likes

As shoulders said, you may have git history. Go to /etc and do git status just to see if you have a git repo to spelunk into. We install etckeeper as part of the Virtualmin install (to try to protect people who won’t keep backups from catastrophes like this), but there are a lot of ways it can get disabled…it’s unfortunately not super reliable if you don’t know how to maintain a git repo or working with etckeeper.

Ideally you’ll see:

On branch master
nothing to commit, working tree clean

But, if this is an old installation, it won’t have etckeeper installed. And, as I said, it’s also possible it stopped working at some point in the past. If you do have it, and if it worked up until the upgrade, you’ll be able to pull out the files you need.

Those don’t matter.

Also doesn’t matter (much). It just has Usermin configuration, which has nothing to do with Virtualmin…just some webmail stuff.

OK, so I guess if you don’t have backups, and if etckeeper doesn’t have the old copies in the git history (I continue to beg everyone to keep good backups, especially when doing something dramatic like major upgrades), you’ll need to use the Add Servers->Import Virtual Server feature in Virtualmin to try to bring those domains back under control of Virtualmin.

Guys thank you very much for your support, before this I upgraded debian 8 to 9 and then 9 to 10 easily. Basicly we just change the repositories to new distro and then give the upgrade commands… But 10 to 11 really killed everything. Im still trying to fix many other things :frowning: Now Im banging my head to walls and will do a backup of /etc everytime I do something new but it is a bit too late now… I didnt have etckeeper, but I just installed it now.

I will try to rescue the /etc with photorec but I dont have much hopes…

So installing Virtualmin new and then importing the domains one by one seems to be the only way for me?

Unless you can travel back in time and kick yourself in the butt for not keeping regular backups, especially before a major change, then, yes, I think you’re out of options. I’m certainly out of ideas.

1 Like

I feel your pain @Anarchy, but had to laugh a bit about Joe’s time travel theory. I learn from your mistake and will avoid this way of updating and will look into etckeeper too to be sure. Good luck with all the work!

I thank you all for the supportive words… I could not retrieve etc/webmin with photorec… I had no other choice but to reinstall virtualmin… The script warned me… hey you have php, mysql, apache, bind… do you really wanna continue… I took a backup of /etc, held my breath and hit y to continue :slight_smile: Installation was successful, I was hoping virtualmin could somehow identify its old virtual servers but no luck… Seems I have to use import virtual server… I hope that works… will try and give feedback later. Luckily the websites are running. I can login to websites which means mysql is also running.

After setup Virtualmin asked me for MariaDB root password so I gave a new one and overwrite the old… Because I didnt remember it. That shouldnt cause any harm?

Emails are currently not working, I noticed that the dovecot conf files were overwritten :frowning:

May 23 18:56:58 ns123.ip-xxx-x-xx.com dovecot[69064]: config: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 140: ssl_cert: Can't open file /etc/ssl/virtualmin/171asdasdasd65915/ssl.combined: No such file or directory
May 23 18:56:58 ns123.ip-xxx-x-xx.com dovecot[668]: master: Error: service(config): command startup failed, throttling for 60.000 secs
May 23 18:57:28 ns123.ip-xxx-x-xx.com dovecot[668]: master: Error: service(imap-login): Initial status notification not received in 30 seconds, killing the process
May 23 18:57:28 ns123.ip-xxx-x-xx.com dovecot[69064]: imap-login: Fatal: master: service(imap-login): child 79093 killed with signal 9
May 23 18:57:46 ns123.ip-xxx-x-xx.com dovecot[69064]: stats: Fatal: Error reading configuration: read(/run/dovecot/config) failed: read(size=8192) failed: Interrupted system call
May 23 18:57:46 ns123.ip-xxx-x-xx.com dovecot[668]: master: Error: service(stats): command startup failed, throttling for 60.000 secs
May 23 18:57:56 ns123.ip-xxx-x-xx.com dovecot[69064]: imap-login: Fatal: Error reading configuration: read(/run/dovecot/config) failed: read(size=8192) failed: Interrupted system call
May 23 18:57:56 ns123.ip-xxx-x-xx.com dovecot[668]: master: Error: service(imap-login): command startup failed, throttling for 60.000 secs
May 23 18:57:58 ns123.ip-xxx-x-xx.com dovecot[69064]: config: Fatal: Error in configuration file /etc/dovecot/dovecot.conf line 140: ssl_cert: Can't open file /etc/ssl/virtualmin/17sdadasdasd15/ssl.combined: No such file or directory
May 23 18:57:58 ns123.ip-xxx-x-xx.com dovecot[668]: master: Error: service(config): command startup failed, throttling for 60.000 secs

Also after completing the setup Virtualmin asked me where do you want to keep the certificates at home/installation or virtualmin/certificates. I thought it would be a good idea to keep all certificates at the same place… is the error above because of that? Im going to change with the old conf files and hoping the problem will be solved. Im getting " Connection to storage server failed" from roundcube when I try to login with a mail.

Update: Replacing dovecot conf files with the ex ones helped me to login. But I cant send mails, this problem existed before virtualmin installation too. I think some kind of certificate problem.

But I cant configure now an Email client Outlook/Thunderbird… always fails I changed the postfix configuration files back but still cant setup the client. It fails to confirm the configration. like 143, starttls, port, server…

New topic for new issues, please. Mail is wholly unrelated to starting Webmin.

https://forum.virtualmin.com/guidelines

Oh no. No one told you to do that. That’s not a good choice.

You needed to Import the domains, as I explained above. And, you still need to Import domains as I explained above, but you also broke some other stuff by reinstalling.

Oh, shit. Reading over your statement, you said, “So installing Virtualmin new and then importing the domains one by one seems to be the only way for me?”

I missed the “installing Virtualmin new”. I would have said, “no!” I’m sorry I missed it. That’s absolutely not what I suggested. I only suggested importing domains and then cleaning up whatever didn’t get imported fully (Virtualmin has to guess about things like domain ownership and email users in a domain when importing).

Reinstalling on an existing system is never the right answer. Literally never. It can only break things.

Importing domains was what you needed to do, and what you still need to do. I’m sorry I didn’t stop you from causing more damage by installing over an existing installation.

Hey Joe,

I thought you said yes unless I can go back in time :slight_smile: on the other hand importing domains would also not be possible because virtualmin was somehow was not known to the system it was deleted together with webmin. I couldnt login to IP:10000. But now I can after new installation.

So below is how you mean to import the domains right? Or is there another way?

Could you please hint me what will Find users by do? Which users will be found? Shall I leave it to Primary group? Is it better to leave home dir and prefix to automatic? How can I find the maria DB databases and username? Do I need to put comma or space between Database names?

Any other hints for my situation to make things better is mostly appreciated!

I can’t tell you wat to do, but just wonder. My hoster has the option to install a fresh image of choice of distro. When I messed up my server when I first started with virtualmin, I reinstalled that image so the server was fresh and clean. Did only sudo update/upgrade and then installed virtualmin again. After that I imported all the websites again. It only took me about an hour and most of that time was caused by the upload time of all the data.

Since your server seems quite a mess now, is there no way for you to do such a clean start? Just asking, don’t directly execute it :wink:

That is what I mean, and what I explicitly told you you need to do. I don’t know how to be more clear. If you want Virtualmin to know about and manage your domains that aren’t currently associated with Virtualmin, you need to Import them using the Add Servers->Import Virtual Server feature (as I said above, and the screen you’re showing).

That will find users “owned by” the domain, e.g. mail and FTP users. There is no concept of domains at the OS level; but Virtualmin sets them up using a common convention of having them all in the same group (the group of the domain owner user). Since you created everything with Virtualmin, most of the default settings are the right ones; these are somewhat common conventions, but not rules or enforced by the OS or anything like that (again, the OS has no idea what a website is or domains or users owned by a domain, we just sort of create a directory structure and a group that kinda looks like it does).

Probably? I believe it will use the home directory associated with the user, so that should do the right thing. The only way this could get weird is if you made dramatic changes to the Virtualmin configuration in those areas from before, when you originally made those domains. If you left user homes in /home and mail/ftp users in /home/domain/homes, you probably will have a very easy time bringing them in.

You don’t know what databases you’ve created? There will be an automatic database created if you enabled database for the domain, and it will have the same name as the domain (within the limits MySQL/Mariadb imposes), so if you look at your list of databases it should be obvious which ones were created by Virtualmin as part of the domain creation. Extra databases may be best left until after you’ve imported the domain (and then use the “Import Database” feature in the “Edit Databases” page for the domain), just to keep the import of the domain as simple as possible. If the website is working, it’s probably already got the right permissions for the users.

I’d recommend you do this one domain at a time, checking the state of things after. Since you created all these domains in Virtualmin, it will probably mostly Just Work, but some metadata was certainly lost when all the Virtualmin config files were lost.

They don’t have Virtualmin backups (which is why this thread is as long and tragic as it is). Starting fresh on a new system is just more work.

It may be that other stuff was destroyed in whatever incident destroyed all the Virtualmin configuration files. OP hasn’t mentioned that happening, though, and all their sites are reportedly working…so I’m assuming we’re just dealing with deleted Virtualmin configs. (And, then, some extra destruction to Postfix, Apache, etc. configs that happened when they reinstalled Virtualmin, but that’s relatively minor and can be addressed as problems are identified.)

Ouch, no backups at all. I thought only configs etc was the problem. Lesson for life for sure. Glad that the websites are running at least for now.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.