简体   繁体   English

尝试使用 twine 上传时出现 401 Unauthorized 的 AWS CodeArtifact 错误

[英]AWS CodeArtifact error with 401 Unauthorized when trying to upload with twine

I'm having issues pushing python package into CodeArtifact using twine.我在使用麻线将 python package 推送到 CodeArtifact 时遇到问题。 I would love your ideas on what this might be and how to debug this.我会喜欢你关于这可能是什么以及如何调试它的想法。

I've setup the repository following this doc .我已经按照此文档设置了存储库。

Running aws codeartifact login --tool twine is successful and I see the password updated in the ~/.pypirc file:运行aws codeartifact login --tool twine成功,我在~/.pypirc文件中看到密码已更新:

$ aws codeartifact login --tool twine --repository myrepo --domain mydomain --domain-owner 111122223333 --region us-east-1 --profile myprofile

Successfully configured twine to use AWS CodeArtifact repository https://mydomain-111122223333.d.codeartifact.us-east-1.amazonaws.com/pypi/myrepo/
Login expires in 12 hours at 2022-11-03 06:52:46-04:00

but then when I try to upload I get an unauthorized error:但是当我尝试上传时,出现未经授权的错误:

$ twine upload  --verbose --repository myrepo ./dist/mylib-0.0.2.tar.gz
INFO     Using configuration from ~/.pypirc
Uploading distributions to https://mydomain-111122223333.d.codeartifact.us-east-1.amazonaws.com/pypi/myrepo/
INFO     ./dist/mylib-0.0.2.tar.gz (7.8 KB)
INFO     username set by command options
INFO     password set by command options
INFO     username: aws
INFO     password: <hidden>
Uploading mylib-0.0.2.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.3/13.3 kB • 00:00 • 26.8 MB/s
INFO     Response from https://mydomain-111122223333.d.codeartifact.us-east-1.amazonaws.com/pypi/myrepo/:
         401 Unauthorized
INFO     Unauthenticated: request used expired credentials. Please renew your credentials.
ERROR    HTTPError: 401 Unauthorized from https://mydomain-111122223333.d.codeartifact.us-east-1.amazonaws.com/pypi/myrepo/
         Unauthorized

What do you think?你怎么认为?

As a workaround, I created a new repository and migrated to it.作为解决方法,我创建了一个新的存储库并迁移到它。 After a while deleted the problematic repository.一段时间后,删除了有问题的存储库。 Never got to the bottom of this.从来没有深究这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当 lambda 失败时,AWS API 网关 401 未授权 - AWS API Gateway 401 Unauthorized when lambda fails 从 Postman 或 cURL 访问时从 AWS Cognito + API 网关获取 401 Unauthorized - Getting 401 Unauthorized from AWS Cognito + API Gateway when accessing from Postman or cURL Dependabot 与 AWS CodeArtifact - Dependabot with AWS CodeArtifact 尝试从 Google Container Registry 拉取图像时出现 401 Unauthorized 错误 - 401 Unauthorized error while trying to pull image from Google Container Registry 我收到多个错误:尝试在 aws s3 存储桶中上传文件时出现意外字段 - I am getting multer error : unexpected field when i was trying to upload files in aws s3 bucket 使用 sbt 将工件发布到 AWS CodeArtifact - Publish artifact to AWS CodeArtifact with sbt 使用 AWS amplify 和 grahql 创建新用户时出现“未经授权”错误 - 'Unauthorized' error when using AWS amplify with grahql to create a new user AWS Codeartifact 未指向私有存储库 - AWS Codeartifact not pointing to private repository 通过 API URL 尝试调用 Firestore 数据库时报错 401 - Error 401 when trying to call Firestore database through API URL 尝试将图像上传到 Firebase 存储时出错 - Error when trying to upload images to Firebase storage
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM