Problem description
Image information cannot be retrieved during upload callback processing.
Causes
The callbackBody field includes image information variables such as imageInfo.height, imageInfo.width, or imageInfo.format as callback parameters. If OSS cannot access the image when the callback runs, it cannot read those variables and the request fails.
Examples
You set imageInfo.height, imageInfo.width, or imageInfo.format in the callbackBody field when uploading an image. After the upload completes, the callback fails because OSS cannot retrieve the image metadata.
Solutions
Work through the following checks in order.
Confirm the image was uploaded successfully. If the upload failed, call PutObject to upload the image again, then retry the callback.
Confirm the image still exists and is accessible. Check whether a lifecycle expiration rule has removed the image, or whether another user with sufficient permissions has deleted it. Either condition makes the image inaccessible to the callback.
Verify the image format is supported. OSS image processing supports JPG, PNG, BMP, GIF, WebP, TIFF, and HEIC. If the image is in a different format, OSS cannot read
imageInfo.*variables and the callback fails.Test whether image metadata is retrievable. Upload the image to OSS and run
x-oss-process=image/infoagainst it:https://<bucket-name>.oss-<region>.aliyuncs.com/<object-key>?x-oss-process=image/infoIf this request fails, the callback will also fail for the same reason.
Isolate the issue using a known-good image. If the test in step 4 fails unexpectedly, apply
x-oss-process=image/infoto the following public test image to verify that your OSS image processing configuration is working:https://image-demo.oss-cn-hangzhou.aliyuncs.com/f.jpgIf this request returns metadata successfully, your OSS setup is functional and the problem is specific to your image file.
References
For more information about how to obtain OSS image information, see Query the EXIF data of an image.
For information about the causes and solutions of HTTP status code 203, see Errors returned with HTTP status code 203.
For information about how the upload callback feature works, see Upload callbacks and Callbacks.
For more information about common errors when configuring upload callbacks, see Upload callbacks.
For more information about uploading data directly to OSS using POST policies with upload callbacks, see Overview.
For more information about setting up an OSS-based direct transfer service for mobile apps with upload callbacks, see Set up upload callbacks for mobile apps.