Help Center> Object Storage Migration Service> FAQs> Exception Recovery> What Problems May I Encounter If CDN Is Enabled at the Source?
Updated on 2024-04-19 GMT+08:00

What Problems May I Encounter If CDN Is Enabled at the Source?

Problem 1

The CDN domain name configuration fails the check before the migration, and the error code COMPARE_SRC_AND_CDN_FAILURE is returned.

Possible Causes

The object metadata obtained by OMS from the source bucket does not match the HTTP header in the response from CDN. To be specific, the object size is inconsistent or the last modification time of the cached object on CDN is earlier.

Solution

  1. Check whether the CDN domain name can be used to download the object from the CDN. OMS uses the URL consisting of the CDN domain name and the object name to download the object.
    1. If the URL cannot be accessed, check whether anti-leeching is enabled for CDN.
    2. If the URL can be accessed, go to 22.
  2. Check whether the values of Content-Length and Last-Modified in the HTTP response header are the same as those in the object metadata obtained from the source bucket.
    1. If the Content-Length value is inconsistent with that in the metadata, check whether image compression is enabled on CDN. If yes, disable image compression and perform the migration again.
      Figure 1 Object size in the metadata
      Figure 2 Compressed object size
    2. If the Last-Modified value is earlier than that in the metadata, refresh the CDN cache and perform the migration again.

Problem 2

The migration fails and the error code COMPARE_SRC_AND_CDN_FAILURE is displayed in the list of failed objects.

To obtain the list of failed objects, you can click the name of the failed migration task and in the task details displayed on the right, click the link next to Failed Object List Path.
Figure 3 Failed Object List Storage Path

Possible Causes

Before the migration, OMS detects that the size and the last modification time of the object obtained from the source bucket are inconsistent with those obtained from CDN.

If the source object is updated, but the CDN cache is not, this error will be reported.

Solution

Update the CDN cache so that the cached object on CDN is the latest.

Problem 3

The migration fails and the error code 403 is displayed in the list of failed objects.

To obtain the list of failed objects, you can click the name of the failed migration task and in the task details displayed on the right, click the link next to Failed Object List Path.
Figure 4 Failed Object List Storage Path

Possible Causes

403 indicates that OMS does not have the permissions to access the CDN domain name because:

  • The CDN is public, and anti-leeching was enabled for it.
  • The CDN is private, and CND authentication was not enabled for the migration task or task group.

Solutions

  • Disable anti-leeching. If anti-leeching cannot be disabled for security purposes, contact Huawei Cloud technical support.
  • Enable CND authentication and correctly enter the CDN verification key on when you configure a migration task or task group the OMS console.

Problem 4

The migration fails and the error code COMPARE_SRC_AND_CDN_FAILURE is displayed in the list of failed objects.

To obtain the list of failed objects, you can click the name of the failed migration task and in the task details displayed on the right, click the link next to Failed Object List Path.
Figure 5 Failed Object List Storage Path

Possible Causes

CDN performance optimization, such as Gzip compression or page optimization, is enabled at the source. OMS has learned how large the object is based on Content-Length of the object metadata obtained from the source bucket. However, when transmitting this object, OMS finds that the object is compressed and its size is smaller than what OMS has learned. OkHttp3 determines that the stream is interrupted during data transmission. As a result, the migration fails.

Solutions

  • Solution 1: Disable CDN performance optimization and then perform the migration again.
  • Solution 2: Use the URL list method to perform the migration. When configuring the advanced options, set Consistency Check to Not required.

Exception Recovery FAQs

more