python - 间歇性'NoAuthHandlerFound' boto 错误 | django + kinesis 客户端
问题描述
即使在尝试解决方案之后:Boto3 间歇性 NoAuthHandlerFound 错误得到以下错误:
[Tue Aug 04 12:55:09.460312 2020] [wsgi:error] [pid 24727:tid 140597795952384] creds = self._get_credentials_from_metadata(metadata)
[Tue Aug 04 12:55:09.460342 2020] [wsgi:error] [pid 24727:tid 140597795952384] File "/usr/local/lib/python3.5/dist-packages/boto/provider.py", line 424, in _get_credentials_from_metadata
[Tue Aug 04 12:55:09.460373 2020] [wsgi:error] [pid 24727:tid 140597795952384] "%s" % (msg))
[Tue Aug 04 12:55:09.460415 2020] [wsgi:error] [pid 24727:tid 140597795952384] boto.exception.InvalidInstanceMetadataError: Expected a dict type of credentials instead received an empty string
[Tue Aug 04 12:55:09.460450 2020] [wsgi:error] [pid 24727:tid 140597795952384] You can set the 'metadata_service_num_attempts' in your boto config file to increase the number of times boto will attempt to retrieve credentials from the instance metadata service.
我AWS_METADATA_SERVICE_NUM_ATTEMPTS
在机器上和 django settings.py 中都设置为 4。当我在代码中尝试手动重试时,它可以工作,但响应时间太长,并且请求排队并抛出 502、503 错误。
注意:身份验证是通过 IAM 角色进行的。
解决方案
推荐阅读
- python - 在 pandas groupby 上使用 map 或 applymap
- actions-on-google - CameraStream 特征不接受 PIN 验证
- google-maps - 为什么我的自定义 Google 地图不再起作用?
- javascript - 当前 div 的 LocalStorage?
- ssis - ssis 中 ODBC 连接的更新表
- excel - 如何修复主键中的重复值?
- xcode - 当我将反应原生 iOS 应用程序上传到 App Store Connect 时,我得到了空版本
- swift - Swift:Twilio 发送短信,需要“收件人”电话号码
- google-bigquery - Airflow 如何将 API 请求结果写入 BigQuery 表或 GCS 文件
- c - C - 打印 ref 传递的成员链表