Migration error

I get this error when my migration gets down to re-creating mail and FTP users.
Any ideas?

Error
-----
Missing file to read at virtual_server::/usr/share/webmin/virtual-server/feature-ssl.pl line 1418
-----
SYSTEM INFORMATION
OS type and version Ubuntu Linux 24.04.3
Webmin version 2.520
Usermin version 2.420
Virtualmin version 7.50.0 GPL
Theme version 25.20
Apache version 2.4.58
Package updates All installed packages are up to date

I think we need more details.

What are you migrating from and to? Was the relevant software on the old server up to date?

Im going from this

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.520
Usermin version 2.420
Virtualmin version 7.50.0 GPL
Theme version 25.20
Apache version 2.4.52
Package updates All installed packages are up to date

I don’t think there’s anything special about the setups. I think it’s the mail aliases that are causing an issue. I transfered a server without them and there were no problems and the ones that error out have their users on the remote site but not the aliases.

I’m confused by the error, though, as feature-ssl.pl is not involved in mail aliases or FTP users.

Is there any more informative logging I can do?

This server only has the main user and a bunch of aliases. It fails the same for servers that have users and aliases though

Transferring vs.com to remotehost.net ..
Backing up to destination system ..
Testing backup destination /tmp/virtualmin-transfer-138120 on SSH server remotehost.net ..
.. done
Creating backup for virtual server vs.com ..
Copying virtual server configuration ..
.. done
Backing up Cron jobs ..
.. none defined
Copying records in DNS domain ..
.. done
Saving mail aliases ..
.. done
Saving mail and FTP users ..
.. done
Backing up mail and FTP user Cron jobs ..
.. none to backup
Copying Apache virtual host configuration ..
.. done
Copying Apache log files ..
.. done
Copying SSL Apache virtual host configuration and certificate ..
.. done
Copying Logrotate configuration ..
.. done
Copying MariaDB user details ..
.. done
Dumping MariaDB database vs ..
.. done
Dumping MariaDB database vs_roundcube ..
.. done
Copying Procmail and SpamAssassin configuration files ..
.. done
Backing up Webmin ACL files ..
.. done
Backing up AWStats configuration file ..
.. done
Creating TAR file of home directory ..
.. done
Uploading archive to SSH server remotehost.net ..
.. done
.. completed in 13 seconds
1 virtual servers backed up successfully
.. backup done
Validating backup ..
.. all domains transferred successfully
Restoring backup on destination system ..

.. restore failed :
root@remotehost.net's password: 
Checking for missing features ..
.. all features in backup are supported

Checking for errors in backup ..
.. no errors found

Starting restore..
Extracting backup archive files ..
.. done

Restoring backup for virtual server host.com ..
    Restoring virtual server password, quota and other details ..
    .. done

    Updating administration password and quotas ..
    .. done

    Restoring Cron jobs ..
    .. done

    Extracting TAR file of home directory ..
    .. done

    Setting ownership of home directory ..
    .. done

    Re-creating records in DNS domain ..
    .. done

    Restoring Apache virtual host configuration ..
    .. done

    Checking restored PHP execution mode ..
    .. mode FCGI works for this system

    Updating home directory in PHP configuration ..
    .. done

    Changing CGI scripts execution mode to suEXEC ..
    .. done

    Restoring Apache log files ..
    .. done

    Restoring SSL Apache virtual host configuration and certificate ..
    .. done

    Restoring Logrotate configuration ..
    .. done

    Restoring allowed MariaDB hosts ..
    .. done

    Re-loading MariaDB database vs ..
    .. done

    Restoring SpamAssassin and Procmail configurations ..
    .. done

    Restoring Webmin ACL files ..
    .. done

    Restoring AWStats configuration file ..
    .. done

    Re-creating mail and FTP users ..
[25/Oct/2025:07:11:11 +0800] Missing file to read at virtual_server::/usr/share/webmin/virtual-server/feature-ssl.pl line 1418
Error
-----
Missing file to read at virtual_server::/usr/share/webmin/virtual-server/feature-ssl.pl line 1418
-----
.. transfer failed

Try making a domain backup on the original server, copying the resulting file over to the new one, and restore the domain on the new server…preferably on the command line. I don’t know where to start troubleshooting this, and maybe doing the restore on the command line will provide more clues about what’s going wrong.

LIne 1418 is looking for the servers private key. Strange because the path to ssl.key is the same on the remote server. Same username.

I get the same error when manually transferring the file and restoring it on the remote host.
If I do the restore in the GUI and de-select mail and FTP users I don’t get an error.

There were some changes in the backup code recently around the ssl files, and a bug related to ssl.ca restoration. Maybe this is related to that somehow.

@Ilia have you seen this? Any idea what’s happening here?

With some LLM help I replaced

my $lref = &read_file_lines($key, 1);

With

if (!$key) {
    &error("Empty SSL key path (undef or empty)");
}
if (!-e $key) {
    &error("SSL key does not exist: $key");
}
if (!-r $key) {
    &error("SSL key not readable (perms/ownership): $key");
}

my $lref;
my $ok = eval {
    $lref = &read_file_lines($key, 1);
    1;
};
if (!$ok) {
    # If read_file_lines() throws, this will show the file path in the UI
    &error("Failed to read SSL key with read_file_lines: $key");
}

And now I get
Empty SSL key path (undef or empty)

It’s a DKIM error.
Probably because I have a global DKIM key on the sending server and nothing on the receiving in Virtualmin

It’s because I set up opendkim, openarc and opendmarc on the receiving server so it mirrored the sending but I should have enabled DKIM in Virtualmin first before I manually tweaked everything.

1 Like

It’s a bug that restoring a backup fails because of that, though. Backups and restores should always been really reliable and resilient even if something is different on the new system.

I’ll ask @Jamie to take a look.

1 Like

@Joe, I’m not sure offhand what’s causing it, but if I had a backup file and have it failing on my system, I could take a closer look and likely fix it—unless Jamie gets to it first.

Right now, though, I’m focused on wrapping up reworking the UI and trying not to get sidetracked, since switching between different kinds of work slows things down quite a bit.

@Pook, can you send it as a private message like @staff and attach a backup file for download? Try to find the smallest domain; we just need to see the problem.

Taking a look at this now ..

I checked in a fix that should solve this here : Don't get type of key that doesn't exist · virtualmin/virtualmin-gpl@d8e0b52 · GitHub

1 Like

Isn’t this a workaround for the actual issue? Where did the key go?

I’m sure I caused it by not having DKIM enabled in virtualmin but setting opendkim, openarc and opendmarc up so everything worked but wasn’t enabled in the GUI.

I added this in to track it down;

if (!$key) {
    require Carp;
    &error("Empty SSL key passed to get_ssl_key_type()\n".
           Carp::longmess("call stack:"));
}

Empty SSL key passed to get_ssl_key_type() call stack: at /usr/share/webmin/virtual-server/dkim-lib.pl line 780. virtual_server::get_dkim_pubkey(HASH(0x613493a77640), HASH(0x613495fb5d48)) called at /usr/share/webmin/virtual-server/dkim-lib.pl line 766 virtual_server::get_dkim_dns_pubkey(HASH(0x613493a77640), HASH(0x613495fb5d48)) called at /usr/share/webmin/virtual-server/dkim-lib.pl line 1116 virtual_server::add_domain_dkim_record(HASH(0x613495fb5d48), HASH(0x613493a77640), ARRAY(0x613497b9ef18), "/var/lib/bind/vs.com.au.hosts") called at /usr/share/webmin/virtual-server/dkim-lib.pl line 1085 virtual_server::add_dkim_dns_records(ARRAY(0x613498cc6e70), HASH(0x613493a77640)) called at /usr/share/webmin/virtual-server/dkim-lib.pl line 1414 virtual_server::save_domain_dkim_key(HASH(0x613495fb5d48), "") called at /usr/share/webmin/virtual-server/feature-mail.pl line 3240 virtual_server::restore_mail(HASH(0x613495fb5d48), "/tmp/.webmin/555563_1171196_1_restore-domain.pl/vs.co"..., HASH(0x6134959a2708), HASH(0x613490d96070), undef, HASH(0x6134966288a0), 0, undef) called at /usr/share/webmin/virtual-server/backups-lib.pl line 3164 virtual_server::restore_domains("/root/vs.tar.gz", ARRAY(0x613490db22d8), ARRAY(0x613490d95920), HASH(0x613490d96070), ARRAY(0x613490d962c8), undef, HASH(0x613490d814a0), 0, ...) called at /usr/share/webmin/virtual-server/restore-domain.pl line 471

Seems like somehow Virtualmin thinks DKIM is setup, but cannot find any key in the config?

Is there a dkim_enabled line in your /etc/webmin/virtual-server/config file?