What do I do if the "Please set the etag of expose-headers in OSS" error message appears when I use multipart upload to upload an object?

Updated at:

Resolve the "Please set the etag of expose-headers in OSS" error that occurs during multipart upload by adding ETag to your CORS Exposed Headers configuration.

Problem

When using multipart upload to upload objects to OSS, the following error occurs:

Please set the etag of expose-headers in OSS

Cause

The client cannot retrieve the ETag value after uploading a part. The ETag is required to complete the multipart upload. Common causes:

  • Missing ETag in Exposed Headers: The CORS rule does not include ETag in Exposed Headers. The client cannot access the ETag response header required for multipart upload completion.

  • Conflicting CORS rules: Multiple CORS rules exist with conflicting configurations, preventing proper header exposure.

Solution

Add ETag to Exposed Headers

Configure your bucket's CORS rule to expose the ETag header.

  1. Log on to the OSS console.

  2. In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the bucket.

  3. Choose Content Security > Cross-Origin Resource Sharing (CORS).

  4. Create or edit a CORS rule:

    • If no rule exists, click Create Rule.

    • If a rule exists, click Edit in the Actions column for that rule.

  5. Configure the CORS rule parameters:

    • Source: Set to * to allow all origins, or specify your application's domain.

    • Allowed Methods: Select GET, PUT, DELETE, POST, and HEAD.

    • Allowed Headers: Set to * to allow all request headers.

    • Exposed Headers: Add ETag to allow the client to read the ETag from the response. CORS configuration with ETag in Exposed Headers

  6. Click OK to save the configuration.

Remove Conflicting CORS Rules

If multiple CORS rules exist, review each rule and delete any that conflict or are no longer needed. Conflicting rules can override the ETag exposure configuration.

Verify the Solution

After updating the CORS configuration, verify the fix.

  1. Wait a few moments for the configuration to take effect.

  2. Retry the multipart upload operation.

  3. The upload should complete successfully without the error.