【发布时间】:2020-11-19 15:16:03
【问题描述】:
您好,我正在使用 celery 来安排任务并运行以从 s3 文件中读取数据,但我收到类似 Unable to locate credentials 之类的错误,但相同的代码可以正常工作本地环境,当我们在 production(EC2) 中部署代码时,我遇到了错误,并且 不使用 celery 我能够连接s3并能够读取文件。
我用过的包
boto3 1.13.13
botocore 1.16.13
celery 4.4.4
两个凭据都放置在同一位置,例如 ~/.aws
谁能帮忙
【问题讨论】:
-
您的 EC2 是否附加了任何 IAM 角色?
-
是的,我可以访问 celery 之外的文件,就像我在不添加 @periodic_task 装饰器的情况下运行代码一样
标签: python-3.x amazon-web-services amazon-s3 celery celerybeat