即使使用正确的键,S3 boto连接也会导致ClientError

时间:2019-01-04 08:45:35

标签: python amazon-web-services amazon-s3 boto botocore

我正在运行命令:

aws s3 cp s3://full-key .

我确保两台计算机上都具有相同的键,但是,一台计算机能够访问该对象,而另一台却收到错误:

/usr/local/lib/python2.7/dist-packages/urllib3/util/ssl_.py:354: SNIMissingWarning: An HTTPS request has been made, but the SNI (Server Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
fatal error: An error occurred (403) when calling the HeadObject operation: Forbidden

请注意,我实例的时区为UTC 命令:

timedatectl status                   
      Local time: Fri 2019-01-04 09:04:39 UTC
  Universal time: Fri 2019-01-04 09:04:39 UTC
        Timezone: Etc/UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

但是当我输入date时我得到Fri Jan 4 09:05:44 UTC 2019 但是,Google将UTC时间显示为:8:52 am Friday, 4 January 2019 Coordinated Universal Time (UTC)

1 个答案:

答案 0 :(得分:1)

我注意到ec2实例上的奇数时间设置。尽管设置为UTC,但时间不是。当我尝试列出存储桶中的所有目录时,遇到错误:too much time difference resulting into timeout。因此,我手动将实例的时间更改为实际的UTC时间,然后再次尝试,然后可以访问存储桶。

为什么我要尝试时间设置?我读到某处的时间可能是这里的一个问题。