Vpro Customer: Install script fails to install on new clean Ubuntu 22.04.3 server

Probably you just have to run virtualmin script like this:

./virtualmin-install.sh --setup

because ubuntu server has some required packages installed and virtualmin try to install them again, but who knows…

Ubuntu server has nothing installed except for minimal system as per DVD installer. Only ssh is installed.

I am 100% sure this issue is caused by IPV6 being disabled. But not sure how to solve it.

Cheers
Spart

In second part of the article I linked is how you enable IPv6

BUT: my server doesn’t have IPv6 and virtualmin worked out of the box.

Just tested on clean OS with no IPv6, no issue. You may need to do a fresh install again seeing this is a new system as its not a issue with the script.

Did you disable IPv6 before you ran updates to the OS and ran script? Maybe it IPv4 not working correctly.

1 Like

Thank you for your efforts. As I said this is not my first rodeo. Me posting here is a last resort. I have gone around this loop 3 times now.

With IPV6 disabled the script fails and leaves a mess. With it enabled it installs and completes.

I will keep working on this.

Cheers
Spart

That appears to be solved. Is there more than one way to disable IP6? Perhaps disabling it (somehow) also affects IP4 and the install process or even wget.

We know that IP6 is not required - (everyone would be complaining. I too have installs both with and without IP6)

There is nothing wrong with IP4 it works fine. Speedtests, packets drops, sustained down and uploads etc. etc.

I am currently running another install. The only change is disable IPV6 in grub.

This is what I get every time:

[INFO] Started installation log in /root/virtualmin-install.log
▣◻◻◻ Phase 1 of 4: Check
Checking system time                                                         ✔ 
Checking Perl installation                                                   ✔ 
Checking CA certificates package                                             ✔ 
Checking HTTP client                                                         ✔ 
Checking GPG package                                                         ✔ 

▣▣◻◻ Phase 2 of 4: Setup
Downloading Virtualmin 7 key                                                 ✔ 
Installing Virtualmin 7 key                                                  ✔ 
Downloading Webmin key                                                       ✔ 
Installing Webmin key                                                        ✔ 
Downloading repository metadata                                              ✔ 
Enabling universe repositories, if not already available                     ✔ 
Disabling cdrom: repositories                                                ✔ 
Cleaning up software repo metadata                                           ✔ 

▣▣▣◻ Phase 3 of 4: Installation
Checking and installing system package updates                               ✔ 
Installing Virtualmin 7 and all related packages                            [ERROR] Failed with error: 100
 ✘ 

[ERROR] Something went wrong. Exiting.
[ERROR] The last few log entries were:
Processing triggers for php8.1-cli (8.1.2-1ubuntu2.14) ...
Processing triggers for php8.1-cgi (8.1.2-1ubuntu2.14) ...
Processing triggers for php8.1-fpm (8.1.2-1ubuntu2.14) ...
NOTICE: Not enabling PHP 8.1 FPM by default.
NOTICE: To enable PHP 8.1 FPM in Apache2 do:
NOTICE: a2enmod proxy_fcgi setenvif
NOTICE: a2enconf php8.1-fpm
NOTICE: You are seeing this message because you have apache2 package installed.
Errors were encountered while processing:
 dovecot-core
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
Installing Virtualmin 7 and all related packages: [2023-09-04 10:45:32 UTC] [ERROR] Failed with error: 100
[2023-09-04 10:45:32 UTC] [ERROR] Something went wrong. Exiting.
[2023-09-04 10:45:32 UTC] [ERROR] The last few log entries were:

This is a problem with the config file for Dovecot as it appears that it is configuring a listener to use both IP4 and IP6 OOTB. With no IP6 available it fails to start and the installer bombs out.

If you got it install OOTB with IP6 disabled then I have no idea how. Because it is impossible to start dovecot with this line in the config if you have ip6 disabled. Below is the critical part of the debugging.

Processing triggers for dovecot-core (1:2.3.16+dfsg1-3ubuntu2.2) ...
Job for dovecot.service failed because the control process exited with error code.
See "systemctl status dovecot.service" and "journalctl -xeu dovecot.service" for details.
invoke-rc.d: initscript dovecot, action "restart" failed.
^[[0;1;31m×^[[0m dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (^[]8;;file://newcloud.twhg.co.uk/lib/systemd/system/dovecot.service^G/lib/systemd/system/dovecot.service^[]8;;^G; enabled;>
     Active: ^[[0;1;31mfailed^[[0m (Result: exit-code) since Mon 2023-09-04 10:45:29 UTC; 9ms ago
       Docs: ^[]8;;man:dovecot(1)^Gman:dovecot(1)^[]8;;^G
             ^[]8;;https://doc.dovecot.org/^Ghttps://doc.dovecot.org/^[]8;;^G
    Process: 63336 ExecStart=/usr/sbin/dovecot -F ^[[0;1;31m(code=exited, status=89)^[[0m
   Main PID: 63336 (code=exited, status=89)
        CPU: 30ms

Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: service(imap-login): listen(::, 143) failed: A>
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: Error: socket() failed: Address family not supported by protocol
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: Error: service(imap-login): listen(::, 993) failed: Address family not supported by protocol
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: socket() failed: Address family not supported >
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Error: service(imap-login): listen(::, 993) failed: A>
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: Fatal: Failed to start listeners
Sep 04 10:45:29 newcloud.twhg.co.uk dovecot[63336]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mmaster: Fatal: Failed to start listeners^[[0m
Sep 04 10:45:29 newcloud.twhg.co.uk systemd[1]: ^[[0;1;39m^[[0;1;31m^[[0;1;39mdovecot.service: Main process exited, code=exited, status=89/n/a^>
Sep 04 10:45:29 newcloud.twhg.co.uk systemd[1]: ^[[0;1;38;5;185m^[[0;1;39m^[[0;1;38;5;185mdovecot.service: Failed with result 'exit-code'.^[[0m
Sep 04 10:45:29 newcloud.twhg.co.uk systemd[1]: ^[[0;1;31m^[[0;1;39m^[[0;1;31mFailed to start Dovecot IMAP/POP3 email server.^[[0m
dpkg: error processing package dovecot-core (--configure):

It fails to start he listeners because they are trying to bind to IP6!

This is the line is the dovecot config:

# A comma separated list of IPs or hosts where to listen in for connections. 
# "*" listens in all IPv4 interfaces, "::" listens in all IPv6 interfaces.
# If you want to specify non-default ports or anything more complex,
# edit conf.d/master.conf.
#listen = *, ::

The default is to listen on both IP4 and IP6.

This is what it needs to be for dovecot to start.

listen = *

Without that change you cannot start dovecot when you have IP6 disabled.

Cheers
Spart

I really do not see how the rest of us manage to run the installation without an IP6.
If it were the case that Dovecot requires IP6 we would all be shouting about it wouldn’t we?

Not neccessarily. Are you telling me when you run ip a it does not show any ip 6 address?

If you disabled IP6 using sysctl then it doesn’t work fully and still leaves IP6 subsytem operating.

Most people will have no idea they have IP6 enabled. SImple test run ip a and see if you have any IP related info.

I do not as IPV6 is disabled before the OS boots.

Cheers
Spart

There is simply no way for you to run the installer on 22.04.3 with IPV6 disabled as the default dovecot config tries to bind to IP6 and fails to start. Triggering the installer script to fail.

Cheers
Spart

The only way I can see around this for now is to enable IPv6, run the installer. Hack the config files. Run the post install config in webmin and see what happens. But what about postfix, named etc. etc.

Until we have the security infrastructure in place on our network. IPV6 is not allowed. SO is blocked by our switches, firewalls and routers.

Maybe a hack to the installer script to catch the error, amend the config file and restart dovecot before continuing?

I am not a scripter but that would seem to be a work around. Set a flag with the installer to signify ipv4 only etc.

I am in touch with the developer of dovecot to see if they can do a graceful fail and fallback to IP4 if IP6 does not exist.

Cheers
Spart

In all my Debian servers I disabled IPv6 before running the Virtualmin installation. I encountered no issues with Dovecot so far. In addition its configuration can be edited later to use only IPv4.

If you properly disabled IPV6 then dovecot will fail to start and the installer will exit. This is simple. Either IP6 stack is there when systemd tries to start it or it fails. This is not a my system issue. Maybe the OOTB config file on debian is different and only has listen =* rather than listen = *, :: which is the cause of the problem.

We don’t use debian so no idea. But I can assure you, if you do not have IPV6 on your system then the installer will fail and dovecot is the culprit.

Already confirmed this with the devs of dovecot.

Cheers
Spart

I just finished with my workaround above.

Enabled IPV6 installed virtualmin. Disabled IPV6 in grub, dovecot conf and named.

Reboot and I now have a virtualmin system running with NO IPV6 stack enabled.

Now to snapshot and see if we can get a working virtual server.

Everything appears to up and running:

└─system.slice 
             ├─fail2ban.service 
             │ └─823 /usr/bin/python3 /usr/bin/fail2ban-server -xf start
             ├─apache2.service 
             │ ├─1129 /usr/sbin/apache2 -k start
             │ ├─1149 /usr/sbin/apache2 -k start
             │ ├─1150 /usr/sbin/apache2 -k start
             │ └─1151 /usr/sbin/apache2 -k start
             ├─saslauthd.service 
             │ ├─885 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             │ ├─896 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             │ ├─897 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             │ ├─898 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             │ └─899 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
             ├─clamav-daemon.service 
             │ └─723 /usr/sbin/clamd --foreground=true
             ├─usermin.service 
             │ └─1441 /usr/bin/perl /usr/share/usermin/miniserv.pl /etc/usermin/miniserv.conf
             ├─systemd-networkd.service 
             │ └─798 /lib/systemd/systemd-networkd
             ├─systemd-udevd.service 
             │ └─543 /lib/systemd/systemd-udevd
             ├─cron.service 
             │ └─828 /usr/sbin/cron -f -P
             ├─mariadb.service 
             │ └─957 /usr/sbin/mariadbd
             ├─polkit.service 
             │ └─1033 /usr/libexec/polkitd --no-debug
             ├─networkd-dispatcher.service 
             │ └─718 /usr/bin/python3 /usr/bin/networkd-dispatcher --run-startup-triggers
             ├─multipathd.service 
             │ └─540 /sbin/multipathd -d -s
             ├─proftpd.service 
             │ └─1392 proftpd: (accepting connections)
             ├─webmin.service 
             │ └─1769 /usr/bin/perl /usr/share/webmin/miniserv.pl /etc/webmin/miniserv.conf
             ├─systemd-journald.service 
             │ └─494 /lib/systemd/systemd-journald
             ├─unattended-upgrades.service 
             │ └─842 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
             ├─milter-greylist.service 
             │ └─768 /usr/sbin/milter-greylist -u greylist
             ├─ssh.service 
             │ └─887 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups
             ├─spamassassin.service 
             │ ├─1080 /usr/bin/perl -T -w /usr/sbin/spamd -d --pidfile=/run/spamd.pid --create-prefs --max-children 5 --helper-home-dir
             │ ├─1766 spamd child
             │ └─1767 spamd child
             ├─named.service 
             │ └─890 /usr/sbin/named -u bind
             ├─clamav-freshclam.service 
             │ └─820 /usr/bin/freshclam -d --foreground=true
             ├─firewalld.service 
             │ └─712 /usr/bin/python3 /usr/sbin/firewalld --nofork --nopid
             ├─lookup-domain.service 
             │ └─886 /usr/share/webmin/virtual-server/lookup-domain-daemon.pl
             ├─system-postfix.slice 
             │ └─postfix@-.service 
             │   ├─1758 /usr/lib/postfix/sbin/master -w
             │   ├─1761 pickup -l -t unix -u -c
             │   └─1762 qmgr -l -t unix -u
             ├─dovecot.service 
             │ ├─822 /usr/sbin/dovecot -F
             │ ├─900 dovecot/anvil
             │ ├─901 dovecot/log
             │ └─902 dovecot/config
             ├─php8.1-fpm.service 
             │ ├─ 829 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
             │ ├─1055 php-fpm: pool www
             │ └─1056 php-fpm: pool www
             ├─systemd-resolved.service 
             │ └─802 /lib/systemd/systemd-resolved
             ├─dbus.service 
             │ └─710 @dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             ├─systemd-timesyncd.service 
             │ └─703 /lib/systemd/systemd-timesyncd
             ├─system-getty.slice 
             │ └─getty@tty1.service 
             │   └─860 /sbin/agetty -o -p -- \u --noclear tty1 linux
             ├─postgrey.service 
             │ └─1036 postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023
             └─systemd-logind.service 
               └─720 /lib/systemd/systemd-logind

Cheers
Spart

Congratulations, good luck

I have to admit that is not something I run on a new box provided by DO or Linode.

I just accept it as a “clean” install. If I then want IP6 they provide it and I just use it but nearly always after I have installed Virtualmin on the box. I have just assumed that when I get the box it is without IP6 (this must also be true as I have to go into their DNS management and add the AAAA record). Also as @stefan1959 posted above you do not need IP6. I also do not think this is a peculiarity of Ubuntu 22.04.3

If this really is a fault of the installer of Dovecot then it should bypass at least until IP6 is known to be available. Or perhaps it should be optional. What fails if it is not installed?

It’s not a fault of the installer of dovecot. It’s the default configuration that simply assumes IPV6 is there so tries to start a listener on a non-existent IPV6 stack! Then rather than fallback to IPV4 it crashes and brings the house down :slight_smile:

Currently working with my workaround above. Just testing virtual server creation, mail, apache etc. etc. etc.

Cheers
Spart

That show that new is not always better, and old is not always unusable (Dovecot could try to use it).

I just had to try this out for myself.

One brand new box from DO.

Deliberately refused to add IP6.

box created Ubuntu 22.04.3

ran ip a
results in:
inet6 fe80::dce7:4dff:fe51:4b61/64 scope link

which surprises me!

Then Virtualmin loads without a hiccup.

Maybe is OP particular setup (machines receive an IPv6 but routers refuse connection, but the machines think they have connection), as you and stefan demonstrated.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html

I’m glad that VIrtualmin has no problem regarding this.