This topic describes how to troubleshoot object upload and download failures in Object Storage Service (OSS).
Object upload failure
If an object upload failure occurs, perform the following steps for troubleshooting:
Check network connectivity between the local client and OSS by using the ping command. Before you proceed with the next troubleshooting step, make sure that network connectivity is normal.
Check whether the size of the object that you want to upload exceeds the limit.
When you use the OSS console, simple upload, form upload, or append upload to upload an object, the object cannot exceed 5 GB in size. For information about how to upload an object that is larger than 5 GB in size, see How do I upload large objects to OSS?
When you use multipart upload to upload an object, the object cannot exceed 48.8 TB in size.
Check whether your account has the object upload permissions. If you upload an object as a Resource Access Management (RAM) user, perform the following steps to check whether the RAM user has the object upload permissions on the bucket. If the RAM user does not have the required permissions, ask the administrator to grant the permissions. For more information, see Configure bucket policies to authorize other users to access OSS resources.
Log on to the RAM console, choose Identities > Users in the left-side navigation pane, and click the name of the RAM user.
Click the Permissions tab to check whether the RAM user has the upload permissions on the bucket or object.
Check the configurations of the upload task.
If you use OSS SDKs to upload an object, check the specified endpoint, bucket name, object name, AccessKey ID, and AccessKey secret.
Check whether the endpoint of the bucket is correct.
Make sure that the correct endpoint is used to access the bucket. For example, if you want to upload an object to a bucket in the China (Hangzhou) region (
oss-cn-hangzhou), you can use the public endpoint of the region, which isoss-cn-hangzhou.aliyuncs.com. For more information about endpoints, see OSS domain names.Make sure that the endpoint specified in the request is the same as the endpoint of the region in which the bucket to access is located. If you want to access buckets in the China (Qingdao) and China (Hangzhou) regions, you must create multiple OSSClient instances. When you specify endpoints, you must add the endpoints of the China (Qingdao) and China (Hangzhou) regions. For more information about the endpoints for different regions and network types, see Internal OSS endpoints and VIP ranges.
Check whether the AccessKey ID and AccessKey secret in the code are correct.
Check whether the bucket name and object name are valid. For more information, see Terms.
Bucket naming rules: The name of a bucket must be 3 to 63 characters in length and can contain only lowercase letters, digits, and hyphens (-). The name must start and end with a lowercase letter or a digit.
Object naming rules: The name of an object must be 1 to 1,023 bytes in length and encoded in UTF-8. The name cannot start with a forward slash (
/) or a backslash (\).
If you use an OSS tool to upload the object, check the limits of the tool as described in OSS tools. Select a tool that is suitable for your business scenario to prevent slow uploads or upload failures. We recommend that you use ossutil to upload an object. For more information, see ossutil.
If you encounter issues described in the following topics, use the corresponding solutions to troubleshoot the issues.
Object download failure
If an object download failure occurs, perform the following steps for troubleshooting:
Check network connectivity between the local client and OSS. If a network issue exists, resolve the network issue before you proceed with the next troubleshooting step.
Check whether the number of objects to download exceeds the limit. You can download up to 100 objects at a time in the OSS console.
Check whether the configurations are valid by performing Step 3 and Step 4 in the Object upload failure section.
Use one of the following tools to perform resumable download:
If you encounter issues described in the following topics, use the corresponding solutions to troubleshoot the issues.
References
OSS SDKs support the following upload methods:
Simple upload: Simple upload is suitable for object upload scenarios in which an object can be uploaded based on a single HTTP request. For example, you can use simple upload to upload an object that is smaller than 5 GB in size.
Form upload: You can call the PostObject operation to upload an object that is not larger than 5 GB in size.
Multipart upload and resumable upload: If a network issue occurs when you use simple upload (PutObject) to upload an object, the upload fails and you must upload the complete object again. To improve upload efficiency, you can use multipart upload to resume a failed upload from the failed part. Compared with other upload methods, multipart upload is more suitable for the following scenarios:
Poor network connectivity: For example, if a part fails to be uploaded from your mobile phone, you need to re-upload the failed part instead of all parts.
Resumable upload required: An upload in progress can be paused and resumed at any time.
Upload acceleration: When the object to be uploaded to OSS is large, multiple parts can be uploaded concurrently to speed up the process.
Streaming upload: Objects of unknown sizes can be uploaded at any time. Streaming upload is common in industry applications such as video surveillance.
Append upload: You can call the AppendObject operation to append content to an appendable object.
Direct client uploads: A direct client upload allows you to upload data directly to OSS from clients. If you use the direct client upload method, objects do not need to be transferred to and from the application server. Therefore, this solution helps accelerate the upload and reduce resource usage.
Stream ingest over RTMP: You can ingest H.264-encoded video streams and Advanced Audio Coding (AAC)-encoded audio streams to OSS. Video and audio uploaded to OSS can be played on demand. This upload method can also be used for livestreaming in latency-insensitive business scenarios.