OSS 上传文件 报 Invalid according to Policy: Policy expired

请求报403 ,阿里工单,回复policy 超时。

我试用了大部门解决方案,最终是     linux没联网。。。。。太尴尬了。忘了配置了DNS了。

联网请参考 :https://blog.csdn.net/hochoy/article/details/80697454 中 网络配置部分。

如果不是联网的问题,解决方法:

方法1、 查看系统时间,更新到最新网络时间。

a、 查看时间 : date

b、手动设置时间  : date -s "20190712 18:30:50"

设置完后还要执行如下命令保存一下设置:  hwclock --systohc

C 、同步网络时间:

安装ntp服务命令:

(1)apt-get install ntp  或者 yum install ntp

(2)ntpdate 0.asia.pool.ntp.org

若上面的时间服务器不可用,也可以改用如下服务器进行同步:

  • time.nist.gov
  • time.nuri.net
  • 0.asia.pool.ntp.org
  • 1.asia.pool.ntp.org
  • 2.asia.pool.ntp.org
  • 3.asia.pool.ntp.org
[root@localhost network-scripts]#  yum install ntp
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: ap.stykers.moe
 * updates: ftp.sjtu.edu.cn
Setting up Install Process
Package ntp-4.2.6p5-15.el6.centos.x86_64 already installed and latest version
Nothing to do
[root@localhost network-scripts]# ntpdate 0.asia.pool.ntp.org
 6 Jul 13:59:58 ntpdate[9093]: step time server 133.243.238.163 offset 2.542950 sec
[root@localhost network-scripts]# ntpdate 0.asia.pool.ntp.org
 6 Jul 14:00:55 ntpdate[9100]: adjust time server 119.28.183.184 offset 0.038002 sec
[root@localhost network-scripts]# date
Mon Jul  6 14:01:29 CST 2020
[root@localhost network-scripts]# 

(3)最后执行如下命令将系统时间同步到硬件,防止系统重启后时间被还原。
hwclock --systohc

方法2、设置policy超时时间,我这里是120s 两分钟。在有成功的情况下,有的地方能上传成功,就不是这个问题。

方法3、再检查一遍,linux 网络是否能连上网。 ping 8.8.8.8   或者  ping www.baidu.com ,其实这一步在第一步的时候 就可以检测出来,因为时间没法同步,如果不是手动设置时间选择网络同步时间的话。

[root@localhost network-scripts]# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=115 time=91.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=115 time=95.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=115 time=89.4 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=115 time=89.6 ms
64 bytes from 8.8.8.8: icmp_seq=5 ttl=115 time=90.5 m

这样就是联网了。

猜你喜欢

转载自blog.csdn.net/somdip/article/details/107156675