question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid according to Policy: Policy expired.

See original GitHub issue

When I try to upload a document, I get this error from AWS: Invalid according to Policy: Policy expired.

Do you have any idea what this could be about? My server / computer time is correct. I also changed the x-amz-date to 20150323T160944Z (with time). No change.

Request parameters

...
"x-amz-algorithm": AWS4-HMAC-SHA256
"x-amz-credential": AKIAJIQBGKWIQFOB6BTA/20150323/us-east-1/s3/aws4_request
"x-amz-date": 20150323T00000Z
...

Response (403 Forbidden)


<Error>
  <Code>AccessDenied</Code>
  <Message>Invalid according to Policy: Policy expired.</Message>
  <RequestId>9002BD2AC1D05F0A</RequestId>
  <HostId>sKjnB//MBQ1woLqdccBdPbX4IySIZ4l+lPiDvkh3OEYYwhygc1Q/mBXnCWOPtdns</HostId>
</Error>

Repsonse Date

"date": Mon, 23 Mar 2015 16:09:44 GMT

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
eeiswerthcommented, Apr 6, 2015

For me, this issue is due to the inclusion of datejs (http://www.datejs.com). That library overrides Date.now(), which is used to create the expiration for the policy. The datajs version of this function does not return a timestamp, but instead returns an actual date object.

I overrode the implementation to behave as it should (i.e., return a timestamp) and my issue went away. This is not an issue with slingshot in my case.

0reactions
kennyhyuncommented, Sep 6, 2016

I’m seeing this error too. there were no problem this morning, but started just one or two hours ago. I have no idea what caused this (I haven’t added any package today).

and in my case, expire: 25 * 60 * 1000 gave about 10 minutes. so it resolves the error. Found "expiration":"2016-09-05T06:34:10.713Z" in upload.instructions.postData my time zone is AEST(+10)

** I’m using edgee:slingshot@0.7.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

S3 "Invalid according to Policy: Policy expired" - Stack Overflow
This can be caused due to "time drift", meaning that the server and client need to be synced time wise. If either drifts...
Read more >
How to handle common errors when the PostObject operation ...
ErrorCode: AccessDenied ErrorMessage: Invalid according to Policy: Policy expired. The expiration value is exceeded due to system time ...
Read more >
[Answered]-AWS S3 upload. Invalid according to Policy
To upload files, I'm using django-s3direct . When I upload files using my local machine on Eastern American time, it prevents me from...
Read more >
So when I upload a video (or try to) the video just gives me the ...
So when I upload a video (or try to) the video just gives me the error of upload failed: Invalid according to policy:...
Read more >
Profile picture - Udemy Instructor Community
The "Policy: Policy expired" can be caused due to "time drift", meaning that the server and client need to be synced time-wise. If...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found