Fix the "failed to leapp preupgrade" error

Updated at:

Resolve the "failed to leapp preupgrade" error that occurs during Linux OS migration with SMC.

Problem description

The "failed to leapp preupgrade" error occurs during Linux OS migration with SMC.

Cause

Possible 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

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

    Run the following command to view the error details:

    cat /var/log/leapp/leapp-preupgrade.log

    image

    The dnf_transaction_check actor found invalid dependencies during package updates. A required package may be missing from the repository, or dependencies may conflict. In this example, the anolis-indexhtml package required by lynx is not found in the repository.

  3. Identify the problematic package from the error log and uninstall it. For example, uninstall lynx:

    yum remove lynx-2.8.8-0.3.dev15.1.al7.x86_64
  4. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.

Failed to access YUM repositories

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

    Run the following command:

    cat /var/log/leapp/leapp-preupgrade.log

    The 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 tried

    This error indicates that repositories in /etc/leapp/files/leapp_upgrade_repositories.repo are unreachable. The failing repositories include nodejs, zabbix, and docker-ce public endpoints.

    Some ECS instances cannot access these public endpoints.

  3. Fix the error based on your ECS instance network access:

    • Your ECS instance cannot access the Internet

      In /etc/leapp/files/leapp_upgrade_repositories.repo, replace the public endpoint http://mirrors.aliyun.com/ with the VPC endpoint http://mirrors.cloud.aliyuncs.com/, or set enabled=0 for Internet-only repositories.

    • Your ECS instance cannot access VPC

      The source server must access the VPC endpoint http://mirrors.cloud.aliyuncs.com/ during migration. Verify that the server is not limited to classic network and that /etc/resolv.conf is correctly configured.

  4. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.

Invalid mount configurations in the /etc/fstab file

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

  3. Verify the mount configurations in /etc/fstab:

    • Each file system entry must be on a single line.

    • All file systems must be mountable. Run mount -a to verify.

    • The file must not contain Chinese characters.

  4. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.

Invalid FTP configurations in the /etc/vsftpd/vsftpd.conf file

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

    This error indicates the vsftpd_config_read actor failed. Check /etc/vsftpd/vsftpd.conf for issues. The following figure shows sample content.

    image

  3. Remove Chinese characters from /etc/vsftpd/vsftpd.conf. Chinese characters are not supported in this file.

  4. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.

Invalid file or path names in the / root directory

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

    This error indicates the root_scanner actor failed. Check the / root directory for invalid characters. The following figure shows sample content.

    image

  3. Remove unparseable UTF-8 special characters from file and path names in the / root directory.

  4. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.

Failed to create the specified user space

  1. Connect to the source server. (Connect to an instance).

  2. Check the SMC client error logs.

    Locate the log directory (View the SMC client). Sample command:

    cat /smc/go2aliyun_client2.7.6_linux_x86_64/Logs/osm_prepare.log

    Replace 2.7.6 with your actual SMC client version.

    image

    Run the following command to view the error details:

    cat /var/log/leapp/leapp-preupgrade.log

    image

    This error indicates a mount failure caused by an outdated system kernel and software packages. The overlay driver is not loaded.

  3. Update the system to CentOS 7.9 to get the latest kernel and packages:

    yum update
  4. Restart the source server and verify that the overlay driver is loaded:

    lsmod |grep overlay
  5. After you resolve the network issue, run the SMC client to retry the operation. For more information, see Run the SMC client.