【问题标题】:Unable to locate credentials celery无法找到凭据芹菜
【发布时间】: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


【解决方案1】:

在开发环境中,我们有多个用户,例如我们的代码在 user1 上运行,并且我在 supervisorcelery.conf 文件中给出了用户名/strong> 是 user2 所以这就是为什么它没有找到

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-04-25
    • 1970-01-01
    • 1970-01-01
    • 2022-08-11
    相关资源
    最近更新 更多