阿里云OSS上传文件时报错:The difference between the request time and the current time is too large.

yuanheci 2022年12月19日 176次浏览

报错:The difference between the request time and the current time is too large.
(请求时间和当前时间之间的差异太大)

上网查了下原因,说需要同步系统时间。
Linux中使用date命令可以查看当前的系统时间,经过比对北京时间后,发现相差了15分钟。果然测试机问题不少。。。

linux中系统时钟和硬件时钟同步:

date -s "20221219 17:46:50" && hwclock --systohc

再次上传文件,成功~