python - 即使使用正确的键,S3 boto 连接也会导致 ClientError
问题描述
我正在运行一个命令:
aws s3 cp s3://full-key .
我已确保两台 pc 上的键相同,但是,一台 pc 能够访问该对象,而另一台收到错误:
/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
但是,谷歌将 utc 时间显示为:8:52 am Friday, 4 January 2019 Coordinated Universal Time (UTC)
解决方案
我注意到我的 ec2 实例上的奇怪时间设置。虽然设置是 UTC,但时间不是。当我尝试列出存储桶中的所有目录时,我遇到了一个错误:too much time difference resulting into timeout
. 因此,我手动将实例的时间更改为实际的 UTC 时间并再次尝试,然后可以访问存储桶。
为什么我要尝试时间设置?我在某处读到时间可能是这里的一个问题。
推荐阅读
- xamarin - 如何调试 Xamarin iOS 应用程序访问 localhost asp.net 核心 API
- reactjs - 更改使用地图呈现的元素的样式
- autofixture - 创建列表时出现 AutoFixture.ObjectCreationException
- xcode - 当我将图像添加到 spritekit 节点时,xcode 崩溃
- python-2.7 - 返回一个lamba函数JSON
- database-design - 在 DynamoDB 中创建统计表的推荐方法是什么?
- perl - 安装模块后无法在 @INC 中找到 perl 模块
- python - 带有 PK 而不是用户名的选择字段的 ModelForm
- asp.net - 未收到 Bot Framework Slack 消息反应
- twitter-bootstrap - 如何在将鼠标悬停在工具提示本身上时保持 bootstrap4 工具提示打开?