简体   繁体   中英

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 ?

I think your problems are due to IAM permissions.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM