Laravel 5.1 – HHVM – S3Exception in WrappedHttpHandler.php line 152

After upgrading to Laravel 5.1 from 5.0, I’m having problems with AWS S3.

I created a test route to verify that S3 was working and it seems that is is not:

get('/test', function() {
   return Storage::disk('s3')->exists('temp/file.jpg') ? 'true' : 'false';
});

The following error is returned:
S3Exception in WrappedHttpHandler.php line 152:
Error executing "HeadObject" on "https://s3.amazonaws.com/rugapp/temp/file.jpg"; AWS HTTP error: Client error response [url] https://s3.amazonaws.com/app/temp/file.jpg [status code] 403 [reason phrase] Forbidden (client): 403 Forbidden

After doing some research, it seems this issue may or may not be related to HHVM. I am using Laravel Homestead which runs the following:
  • Ubuntu 14.04
  • PHP 5.6
  • HHVM
  • Nginx

After reading this, I upgraded HHVM to 3.8-dev and restarted Nginx. The problem remained.

Does anyone have any insight on how to resolve this problem?

UPDATE: It seems to work fine now but I’m not sure why. I haven’t made any changes overnight. Strange.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Similar issue happens in my local homestead development while my app running on Linode works fine.

After checking S3 permission, checked out old version, etc., this problem disappear when I restart homestead.

homestead halt
homestead up --provision

Method 2

I had this same error. I believe it happened because I switched wireless networks as I was developing. After restarting the virtual machine, the error went away.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x