3

Assets has been working well for the past couple of weeks uploading files to Amazon S3. The past few days the customer has started uploading the main bulk of his files Wav files, approx. 10Mb up to 50Mb in size. All was working well, until last night it stopped.

When refreshing the bucket list in Asset Sources settings, it states: "Access denied by target host"

Access and Secret Keys are correct, I even tried creating new ones. S3 permissions on the bucket is correct. In fact nothing has changed our end.

I read online we should create a Bucket Policy. I did this, to no avail, same error. I even made a completely open policy allowing everyone to do everything, still same error.

I disabled our firewall, same error.

Just seems Amazon is blocking us all of a sudden for no reason.

Do you have any advice, it renders Assets and S3 useless and completely changes the way our site works.

Thanks in advance

  • I think Amazon is likely the best place to get help on figuring out why this error triggers. Is this you, Laurence? forums.aws.amazon.com/thread.jspa?messageID=449304 – Lisa May 8 '13 at 16:22
  • Yes I asked them also, hope thats OK. but we need a fast resolution, site is supposed to go live this week, then this happens. and we dont know if its Amazon, our server, or Assets! Does Assets leave any other kind of log somewhere we can interpret "Access denied by target host."? Is that all the message we have to go with? – Laurence Cope May 8 '13 at 22:33
  • Laurence, I think that is it - and I think that error is delivered by Amazon; but if you can go ahead and email some Super Admin details, I (and likely a dev!) will have a look-see. :) – Lisa May 9 '13 at 1:49
3

I have solved this issue.

The Assets error message did not seem very helpful, it was inconsistent with the issue. The Assets response implied the Amazon credentials were wrong, but they were not.

So therefore I needed to debug tha actual Amazon response.

So in the function listBuckets() in system/third_party/assets/sourses/s3/lib/S3.php I could see there is a response object being returned by Amazon, called $rest.

Outputting $rest to the screen showed me

error => Array
(
    code => RequestTimeTooSkewed
    message => The difference between the request time and the current time is too large.
)

From this I assumed my server time was wrong, and indeed it was, it was about 30 minutes out.

Correcting the server time fixed the issue.

Note: The server is UTC timezone, which is 1 hour behind the actual summer time here in the UK. So for example, if it was 20:30 I had to set the servet time to 19:30 for it to work.

So the problem is fixed BUT this has identified a lack of reporting in Assets.

I think Assets needs to output the actual Amazon error returned instead of showing a generic (and incorrect) error whenever any error is returned from Amazon.

| improve this answer | |
  • Thank you Laurence. I've sent this on as a feature request to our team. :) – Lisa May 13 '13 at 17:19
  • I have also just encountered this problem. I'm going to try and tweak the server time to hopefully resolve this. – Rob Hodges May 31 '13 at 9:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.