Problem description
The date value provided for the x-oss-user-last-modified request header is invalid.
Cause
This error occurs if the date value specified for the x-oss-user-last-modified request header is earlier than or equal to 1970-01-01 00:00:00 UTC.
OSS requires this value to be later than 1970-01-01 00:00:00 UTC because the system uses a UNIX timestamp, which starts at 1970-01-01 00:00:00 UTC.
Example
In the following request, the value of x-oss-user-last-modified is "Thu, 01 Jan 1970 00:00:00 GMT". This value is invalid because it must be later than 1970-01-01 00:00:00 UTC.
PUT /example-object.txt HTTP/1.1
Host: example-bucket.oss-cn-hangzhou.aliyuncs.com
Date: Mon, 20 Mar 2024 10:30:00 GMT
x-oss-user-last-modified: Thu, 01 Jan 1970 00:00:00 GMT
Content-Length: 1234
Authorization: OSS LTAI****************:miAo****************
[Object Content]The following error message is returned:
HTTP/1.1 400 Bad Request
Server: AliyunOSS
Date: Mon, 20 Mar 2024 10:30:00 GMT
Content-Type: application/xml
Content-Length: 534
Connection: keep-alive
x-oss-request-id: 68C05BB8785D7A3133226E20
x-oss-server-time: 0
x-oss-ec: 0017-00000134
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>InvalidArgument</Code>
<Message>Invalid date. Must be later than 1970-01-01 00:00:00.</Message>
<RequestId>68C05BB8785D7A3133226E20</RequestId>
<HostId>example-bucket.oss-cn-hangzhou.aliyuncs.com</HostId>
<ArgumentName>x-oss-user-last-modified</ArgumentName>
<ArgumentValue>Thu, 01 Jan 1970 00:00:00 GMT</ArgumentValue>
<EC>0017-00000134</EC>
<RecommendDoc>https://api.aliyun.com/troubleshoot?q=0017-00000134</RecommendDoc>
</Error>Solution
Ensure that the value of the x-oss-user-last-modified request header is later than 1970-01-01 00:00:00 UTC.
Correct example:
PUT /example-object.txt HTTP/1.1
Host: example-bucket.oss-cn-hangzhou.aliyuncs.com
Date: Mon, 20 Mar 2024 10:30:00 GMT
x-oss-user-last-modified: Wed, 15 Mar 2024 08:20:30 GMT
Content-Length: 1234
Authorization: OSS LTAI****************:miAo****************
[Object Content]Key requirements:
The date format must comply with the HTTP date format (RFC 2616), such as Wed, 15 Mar 2024 08:20:30 GMT.
The date value must be later than 1970-01-01 00:00:00 UTC.
If you do not need to specify the last modified time, you can omit this request header. In this case, OSS uses the actual time of the upload or modification.
References
For more information about uploading objects, see PutObject.