simperreault
simperreault

Reputation: 906

AWS::S3::Errors::ExpiredToken with Paperclip when uploading for the first time

I currently have a Rails API with AngularJS frontend that upload picture to Amazon S3. But when I do, I get that error: AWS::S3::Errors::ExpiredToken The provided token has expired..

The strange thing is that if I reupload a file right away, it works. I guess when the token expired, it try to get a new one and the upload works on the second time.

My code is pretty basic, no need to share. I included basic paperclip functionality into my model and my configuration file are fine too.

Any Idea ?

Upvotes: 1

Views: 915

Answers (2)

dominicbri7
dominicbri7

Reputation: 2599

I think your problems are due to IAM permissions.

Make sure your permissions are on the same users as your elastic bean stalk.

Upvotes: 1

Alpha Beta Charlie
Alpha Beta Charlie

Reputation: 841

Make sure your local or server has the correct time setup.

If you server is few minutes ahead of the AWS server it will fail the first time but will work few minutes after.

Upvotes: 0

Related Questions