Solution to failure to migrate OSS resources by using the data migration tool ossimport

Updated at:

Challenge

When you use Alibaba Cloud Object Storage Service (OSS), you can use the ossimport tool to migrate local, third-party, and Object Storage Service (OSS) data from any region to OSS. This topic describes the causes and solutions of errors that fail to migrate OSS resources by using the data migration tool ossimport.

Cause

Common causes of migration failures using ossimport include the following:

  • If the files in the source path are modified during upload, an error that contains SIZE_NOT_MATCH are recorded in log/audit.log. In this case, only the files before modification are uploaded to OSS.
  • If the source file is deleted during upload, the migration job may fail.
  • If the name of the file to upload does not conform to the naming conventions of OSS (for example, start with a forward slash or be empty), the upload fails.
  • If you failed to download the source object from OSS because of network conditions or insufficient permissions, view logs/ossimport2.log or logs/import.log to identify the cause of the failure.
  • The program exits unexpectedly and the job status is Abort. In this case, contact Alibaba Cloud technical support.

Solution

If the migration fails, run the bash console.sh stat command to view the status of the migration task. If the JobState parameter is failed, the migration task fails. View the log of the migration failure. For more information, see the following content to resolve the errors in the log. You can use the retry command to retry after you resolve these problems:

Note

Note: The path of logs that fail to be migrated to OSS is master/jobs/[$JobName]/failed_tasks/[$TaskName]/audit.log.

  • [$JobName]: task name, string.
  • [$TaskName]: the task name.

Error codes Error message Error cause Solution
AccessDenied The bucket you are attempting to access must be addressed using the specified endpoint The error message returned because the srcDomain or destDomain is incorrect.

Enter the correct endpoint based on the Domain Name List.

SignatureDoesNotMatch The request signature we calculated does not match the signature you provided

destAccessKey and destSecretKey are wrong.

Enter the correct AK information.
N/A The bucket name “xxx/xx” is invalid

The configuration items destBucket is incorrect.

Check whether the configuration items destBucket is entered correctly. The bucket name does not contain forward slashes (/) and paths.
ConnectionTimeout Connect to xxx.oss-cn-beijing-internal.aliyuncs.com:80 timed out

This is a connection timeout error. Usually, the reason is that the device used for migration is not an ECS instance or an ECS instance in the same region as OSS, but the configuration file uses the internal domain name of OSS. The internal endpoint supports access only from ECS instances that are located in the same region as OSS instances.

This problem can be solved in the following ways:

  • Set the domain name to a public endpoint in the configuration file. Delete the migration job and submit the job again.
  • Use an ECS instance that is located in the same region as OSS instances to implement the migration job.
InvalidBucketName The specified bucket is not valid

The domain name configured by the destDomian in the configuration file is the endpoint of the region where the bucket is located, not the second-level domain name with the bucket name.

Enter the endpoint of the region where the bucket is located. For example, if the bucket is in China (Beijing), you should enter the oss-cn-beijing.aliyuncs.com. For more information, see Sample configuration files.
RequestTimeTooSkewed Unable to execute HTTP request: The Difference between... is too large

This error may be caused by the following conditions:

  • The difference between the system time of the machine or device sending the request and the system time adopted by OSS exceeds 15 minutes. This is the most common situation.
  • A large number of requests are sent at the same time, resulting in a high CPU utilization and slow concurrent uploads.

This problem can be solved in the following ways:

  • Set the system time of the machine or device that is sending the request to the same time adopted by OSS.
  • If the error is caused by high concurrency, you can reduce the number of requests that are sent at a time. You can set workerTaskThreadNum of the sys.properties file to a smaller value.
N/A The object key "/xxxxx.jpg” is invalid

This error may be caused by the following conditions:

  • srcPrefix as a directory but does not end with a forward slash (/).
  • destPrefix start with a forward slash (/) or a backslash (\).

This problem can be solved in the following ways:

  • Check whether srcPrefix is set to a folder but its value does not end with a forward slash (/). If you set the value to a folder, it must end with a forward slash (/).
  • Check whether the value of destPrefix starts with a forward slash (/) or a backslash (\). If yes, delete forward slashes (/) or backslashes (\), destPrefix cannot start with forward slashes (/) or backslashes (\).
N/A No route to host

in this case, the network is blocked due to local firewalls or iptables.

Run the ping command to test whether the migration server to the source and target network are normal.
  • If the network connection is normal, you can check if there are restrictions configured by the computer firewalls and local firewalls. You can also try disabling the firewall.
  • If the network connection is abnormal, troubleshoot the problem and try again.
N/A Unknown http list file format

When using HTTP mode migration, the problem is because the specified HTTP list file format is incorrect or the content does not conform to the specification.

This problem can be solved in the following ways:

  • If it is a file copied from other operating systems, Linux can use mac2unix, dos2unix and other related commands to convert the file format; Windows systems can use conversion tools to convert formats.
  • If the format of the HTTP list file content is invalid, change the content to the valid format. For more information about the format of the HTTP list file content, see the "Configuration files" section in Architectures and configurations.

SLB parameters

Solution for successful migration after repeated retries after some file migration failures:

  1. View the list master/jobs/[$JobName]/failed_tasks/[$TaskName]/error.list of files that failed to be migrated to obtain the relative paths of the failed files.
  2. Check whether you are authorized to access these files, whether these files are deleted, whether they are symbolic links, and whether the file names are garbled.
  3. After the preceding problems are resolved, run the retry command to migrate the files again.

Applicable scope

  • Object Storage Service (OSS)
  • ossimport