[英]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.