Laravel 5 Amazon AWS S3 Error: Client Error: 403 RequestTimeTooSkewed

I am trying to upload files to S3 bucket via laravel app

I am getting the following error:

S3Exception at WrappedHttpHandler.php line 152: Executing "PutObject" error on " https://s3-ap-southeast-1.amazonaws.com/

AWS HTTP Error: Client Error: 403 RequestTimeTooSkewed (Client): The difference between the request time and the current time is too great

I have done some research and many say my machine time is out of sync. I'm afraid to mess with the manor because I'm afraid to break something . Can I change the time zone of the app? I'm not really sure.

Please help and thank you for taking the time

+3


source to share


2 answers


You will need to update the clock on your homestead. You can do this with ntpd to ensure that it allows you to update your clocks as systems can suffer a reasonable amount of time during reboots. On virtual machines, this seems even more significant (but I'm not sure in the details why).

To get ntpd up and running, do the following in your manor box:

sudo apt-get install ntp

      

Then you need to set your timers. Do the following:

sudo nano /etc/ntp.conf

      

Then make sure the file has the following content:



server ntp.ubuntu.com
server pool.ntp.org

      

After saving these changes, run

sudo service ntp restart

      

Once you do this, ntpd will make sure your system clock is correct, which minimizes the risk of a drift error returned from S3.

Finally, I would like to point out that you shouldn't worry too much about breaking your home environment as this is a virtual machine. A beauty that you can easily rearrange if something is wrong with you.

+7


source


My site is hosted on AWS with Ubuntu 14.04.5 and Apache

I downloaded the files flawlessly and then started getting the same error. Error while executing "PutObject" in "...." .... RequestTimeTooSkewed

So with @marcus approach, I didn't see these server ntp.ubuntu.com and server.ntp.org server files ... but with the command

timedatectl

      

I figured out that my timezone is correct, but:



  • NTP enabled: yes
  • NTP sync: no

NTP was not synchronized, so I tried to restart NTP with

sudo service ntp restart

      

He changed my NTP synced to YES and he solved the problem.

0


source







All Articles