Problem description
The object you want to access does not exist. This error is returned regardless of the operation type. The following operations can trigger it:
| Error code | Triggering operations |
|---|---|
NoSuchKey | GetObject, CopyObject, HeadObject, and any other operation that references an object by name |
NoSuchVersion | Any operation that specifies a VersionID that does not exist |
Causes
One of the following conditions caused the object to be unavailable:
The object was never successfully uploaded.
A lifecycle rule deleted the object.
An authorized user deleted the object through the OSS console, an OSS client, or an API operation.
Cross-region replication (CRR) synchronized a delete operation: a delete performed on an object with the same name in the source or destination bucket propagated to this bucket.
The
VersionIDspecified in the request does not match any existing version of the object.
Examples
The following CopyObject request returns this error if abc.txt does not exist in examplebucket:
PUT /xyz.txt HTTP/1.1
Host: destbucketname.oss-cn-hangzhou.aliyuncs.com
Date: GMT Date
Authorization: SignatureValue
x-oss-copy-source: /examplebucket/abc.txtSolutions
Work through the causes below until you find the one that matches your situation.
Cause 1: The object was never successfully uploaded
Uploads can fail silently if a request is interrupted or an error is not handled.
Fix: Confirm the object exists by calling HeadObject. If HeadObject returns HTTP 404, the upload did not complete. Before re-uploading, make sure the object name meets the following requirements:
Length: 1–1,023 characters
Encoding: UTF-8
Must not start with a forward slash (
/) or a backslash (\)
Cause 2: A lifecycle rule deleted the object
OSS automatically deletes objects that match an expiration rule.
Fix: Check the lifecycle rules configured for the bucket. For details, see Lifecycle rules based on the last modified time. If a rule deleted the object, adjust the rule or re-upload the object.
Cause 3: An authorized user deleted the object
Another user with the required permissions may have deleted the object through the OSS console, an OSS client, or an API operation.
Fix: Review access logs or coordinate with other users to determine whether the object was deleted intentionally. Re-upload the object if needed.
Cause 4: CRR propagated a delete operation
If CRR is configured for the bucket, a delete operation on an object with the same name in the source or destination bucket is synchronized and deletes the object in the other bucket.
Fix: Check the CRR rules configured for the bucket. For details, see CRR. If CRR caused the deletion, re-upload the object or adjust the CRR configuration.
Cause 5: The version ID does not exist
If versioning is enabled for the bucket and your request specifies a VersionID, this error is returned when no version matches that ID.
Fix: Call ListObjectVersions or GetBucketVersions to retrieve all version IDs for the object, then retry the request with a valid version ID.