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

允我心安 提交于 2019-12-05 09:58:24

You will need to update the clock on your homestead installation. You can do this using ntpd to ensure that this keeps your clock up to date as systems can suffer from a reasonable amount of time during reboots. On VMs this seems to be even more significant (but I am not sure of the details why).

To get ntpd setup and running do the following in your homestead box;

sudo apt-get install ntp

Then you need to set your timeservers. Run the following;

sudo nano /etc/ntp.conf

Then make sure the file has the following contents;

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

Once you've saved those changes then run;

sudo service ntp restart

Once you have done this ntpd will take care of keeping your system clock correct minimising the risk of a drift error coming back from S3.

Finally I would note not to worry too much about breaking your homestead environment as it is a virtual machine. The beauty of which is you can very easily rebuild it if you get something wrong.

Diego Ortiz

My website is hosted in AWS with Ubuntu 14.04.5 and Apache

I was uploading files flawless and then I started getting the same error. Error executing "PutObject" on "...." .... RequestTimeTooSkewed

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

timedatectl

I got that my timezone was correct but:

  • NTP enabled: yes
  • NTP synchronized: no

The NTP was not synchronized, so I tried restarting NTP with:

sudo service ntp restart

It changed my NTP synchronized to YES and it solved the problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!