This topic describes the cause of the "failed to leapp preupgrade" error message that is reported when you use Server Migration Center (SMC) to migrate a Linux operating system. This topic also describes how to resolve the error.
Problem description
The "failed to leapp preupgrade" error message is reported when a Linux operating system is being migrated by using SMC.
Cause
This error may occur due to the following causes:
Invalid package dependencies.
Failed to access Yellowdog Updater Modified (YUM) repositories.
Invalid mount configurations in the /etc/fstab file.
Invalid FTP configurations in the /etc/vsftpd/vsftpd.conf file.
Invalid file or path names in the / root directory.
Failed to create the specified user space.
Solution
Invalid package dependencies
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

Run the following command. The error message in the following figure is reported.
cat /var/log/leapp/leapp-preupgrade.log
The preceding error information indicates that invalid dependencies are found by the dnf_transaction_check actor during the update of software packages. This may occur if a required software package does not exist in the specified repository or software packages on which the current software package depends conflict with each other. For example, the preceding error information indicates that the
anolis-indexhtmlpackage on which the lynx package depends is not found in the specified repository during the update of the lynx package.Analyze the dependencies that are mentioned in the error information and uninstall the software package that causes the error. For example, to resolve the preceding error, run the following command to uninstall lynx:
yum remove lynx-2.8.8-0.3.dev15.1.al7.x86_64After the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.
Failed to access YUM repositories
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

Run the following command:
cat /var/log/leapp/leapp-preupgrade.logThe following error message is reported:
Errors during downloading metadata for repository 'docker-ce-stable-migrate': - Curl error (28): Timeout was reached for https://mirrors.aliyun.com/docker-ce/linux/centos/8/x86_64/stable/repodata/repomd.xml [Connection timed out after 30000 milliseconds] Error: Failed to download metadata for repo 'docker-ce-stable-migrate': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried Errors during downloading metadata for repository 'zabbix-migrate': - Curl error (28): Timeout was reached for http://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/repodata/repomd.xml [Connection timed out after 30000 milliseconds] Error: Failed to download metadata for repo 'zabbix-migrate': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were triedThe preceding error information indicates that the YUM repository configuration file is
/etc/leapp/files/leapp_upgrade_repositories.repo. In the configuration file, the following repositories are specified: https://rpm.nodesource.com/pub_18.x/el/8/$basearch, http://repo.zabbix.com/zabbix/5.0/rhel/8/$basearch/, and https://mirrors.aliyun.com/docker-ce/linux/centos/8/$basearch/stable.In this case, the public endpoints of the repositories for nodejs, zabbix, and docker-ce are specified. However, some Elastic Compute Service (ECS) instances cannot access the Internet.
Resolve the error based on the network condition of your ECS instance.
Your ECS instance cannot access the Internet
In the configuration file /etc/leapp/files/leapp_upgrade_repositories.repo, change the public endpoint
http://mirrors.aliyun.com/to the Virtual Private Cloud (VPC) endpointhttp://mirrors.cloud.aliyuncs.com/, or changeenabled=1toenabled=0for repositories that must be accessed over the Internet.Your ECS instance cannot access VPC
During the migration, the source server must be able to access the VPC endpoint
http://mirrors.cloud.aliyuncs.com/of YUM repositories. Check whether the source server can access only the classic network, and whether the configurations are valid in the DNS configuration file/etc/resolv.conf.
After the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.
Invalid mount configurations in the /etc/fstab file
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

Check the mount configurations in the
/etc/fstabfile based on the error information.Make sure that the entry for each file system is written in one line. Do not write an entry in multiple lines due to too many parameters.
Make sure that all file systems can be mounted. You can run the
mount -acommand to check whether a file system can be mounted.Make sure that the configuration file does not contain Chinese characters.
After the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.
Invalid FTP configurations in the /etc/vsftpd/vsftpd.conf file
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

The preceding error information indicates that the vsftpd_config_read actor is terminated due to an error. In this case, check the content of the FTP configuration file
/etc/vsftpd/vsftpd.conf. The following figure shows the sample content of the FTP configuration file.
Delete the Chinese characters from the
/etc/vsftpd/vsftpd.conffile. Chinese characters are not allowed in the FTP configuration file.After the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.
Invalid file or path names in the / root directory
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

The preceding error information indicates that the root_scanner actor is terminated due to an error. In this case, check the content of the / root directory. The following figure shows the sample content of the / root directory.

Make sure that no file or path names in the / root directory contain UTF-8 special characters that cannot be parsed.
After the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.
Failed to create the specified user space
Connect to the source server. For more information, see Connect to an instance.
View the error logs in the log directory of the SMC client.
For more information about the directories of the SMC client, see View the SMC client. Sample command:
cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.logIn the preceding command, 2.7.6 is the version number of the SMC client. Replace the version number with the actual value.

Run the following command. The error message in the following figure is reported.
cat /var/log/leapp/leapp-preupgrade.log
The preceding error information indicates that a mount error occurs because the versions of the system kernel and software packages are outdated, and the corresponding overlay driver is not loaded.
Run the following command to update the minor version of the system to CentOS 7.9 and update the kernel and related software packages:
yum updateRestart the source serve and run the following command to check whether the overlay driver is loaded:
lsmod |grep overlayAfter the error is resolved, run the SMC client and retry the migration job. For more information, see Run the SMC client.