6

I'm using a Django server hosted on EC2 Singapore. I'm also using an S3 bucket to save files uploaded through the Django Admin panel. To upload files, I'm using django-s3direct.

When I upload files using my local machine on Eastern American time, it prevents me from uploading the files citing:

<Message>Invalid according to Policy: Policy expired.</Message>

I've tried the solutions from:
Fine Uploader getting "Policy expired" message sending to S3 for some and here: https://github.com/FineUploader/fine-uploader/issues/1387

When I check the uploaded time and the UTC time, there's no difference. How do I fix this error?

EDIT: To be noted, the upload works perfectly on localhost but doesn't work on the server hosted on AWS EC2.

Community
  • 1
  • 1
Newtt
  • 6,050
  • 13
  • 68
  • 106
  • If the question is still actual.. Have you checked system clock settings? – ZAN Mar 19 '16 at 15:37
  • Most likely the machine your are browsing from has an inaccurate clock. The server is irrelevant. – Ray Nicholus Mar 21 '16 at 18:34
  • As @RayNicholus said, it is most likely an inaccurate clock. Beware of the fact that it isn't the time zone that is taken into account here, but the clock itself. – Ghislaindj Mar 22 '16 at 11:20
  • @RayNicholus This problem is persisting across multiple machines. – Newtt Mar 22 '16 at 11:46
  • @Ghislaindj This problem is persisting across multiple machines. – Newtt Mar 22 '16 at 11:47
  • @Newtt I don't think time zones are a factor here. If that was improperly handled by Fine Uploader or AWS, there would have been a flood of support tickets. – Ray Nicholus Mar 22 '16 at 12:49

1 Answers1

2

Similar issues refer to an inaccurate clock. This should be the clock of the client not the server. I suggest writing code to check whether client's time in sync with a known and accurate time server. If the time is out of sync, a friendly message can be shown to the user to update the system's clock. If the time is in sync, you can then proceed with the upload.

koolkoda
  • 365
  • 3
  • 6
  • Or you can use [Fine Uploader S3's clock drift feature](http://docs.fineuploader.com/branch/master/features/s3.html#accounting-for-browserclient-clock-drift) to account for the out-of-sync clock on the client machine. – Ray Nicholus Mar 23 '16 at 14:03