上传文件到阿里云对象存储服务报错,报错信息如下:
2019-06-11 19:09:15.474 WARN 1 --- [ Thread-910] com.aliyun.oss : [Server]Unable to execute HTTP request: The
difference between the request time and the current time is too large.,
[ErrorCode]: RequestTimeTooSkewed,
[RequestId]: 5CFF8BD8E4AB5A481681A6C6,
[HostId]: appbus.oss-cn-shanghai.aliyuncs.com,
[ResponseError]:,
<?xml version="1.0" encoding="UTF-8"?>,
<Error>,
<Code>RequestTimeTooSkewed</Code>,
<Message>The difference between the request time and the current time is too large.</Message>,
<RequestId>5CFF8BD8E4AB5A481681A6C6</RequestId>,
<HostId>appbus.oss-cn-shanghai.aliyuncs.com</HostId>,
<MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds>,
<RequestTime>2019-06-11T10:21:53.000Z</RequestTime>,
<ServerTime>2019-06-11T11:09:12.000Z</ServerTime>,
</Error>,
,
2019-06-11 19:09:17.488 WARN 1 --- [ Thread-1060] com.aliyun.oss : [Server]Unable to execute HTTP request: The
difference between the request time and the current time is too large.,
[ErrorCode]: RequestTimeTooSkewed,
[RequestId]: 5CFF8BD98FA8AA3EF259FAF8,
[HostId]: appbus.oss-cn-shanghai.aliyuncs.com,
[ResponseError]:,
<?xml version="1.0" encoding="UTF-8"?>,
<Error>,
<Code>RequestTimeTooSkewed</Code>,
<Message>The difference between the request time and the current time is too large.</Message>,
<RequestId>5CFF8BD98FA8AA3EF259FAF8</RequestId>,
<HostId>appbus.oss-cn-shanghai.aliyuncs.com</HostId>,
<MaxAllowedSkewMilliseconds>900000</MaxAllowedSkewMilliseconds>,
<RequestTime>2019-06-11T10:22:12.000Z</RequestTime>,
<ServerTime>2019-06-11T11:09:13.000Z</ServerTime>,
</Error>,
java.lang.reflect.InvocationTargetException
The difference between the request time and the current time is too large
请求时间和当前时间之间的差异太大了;
报错原因:服务器时间不对。OSS对上传文件的时间有严格要求,发起请求的服务器时间和阿里云OSS服务器时间相差超过15分钟,会抛出RequestTimeTooSkewed异常。
解决方法:检查服务器时间和GMT格林威治标准时间(北京时间=GMT时间+8小时)是否出现了较大偏差,调整服务器时间。