无法将Python Wheel发布至私有DevOps Artifacts的问题排查求助
问题:Azure DevOps流水线Twine上传Python库返回400错误(无效邮箱)
背景
正在搭建CD流水线,目标是更新DevOps Artifacts Feed中的Python库。为加速测试,将待上传的wheel文件存储为流水线制品。TwineAuthenticate@1步骤执行正常,但twine upload步骤返回400错误。
流水线配置
trigger: - main pool: vmImage: ubuntu-latest - task: DownloadPipelineArtifact@2 inputs: buildType: 'specific' project: '12ba6212-0768-4c3d-b0d3-836b0423d9a4' definition: '3055' buildVersionToDownload: 'specific' pipelineId: '141443' artifactName: 'dev_package' itemPattern: '*.whl' targetPath: '$(Pipeline.Workspace)/build' - script: | echo '$(Pipeline.Workspace)' ls '$(Pipeline.Workspace)/build' - script: pip install twine displayName: 'Install twine' - task: TwineAuthenticate@1 inputs: artifactFeed: 'ABC/FOTA_Utilities' - script: | python -m twine upload -r FOTA_Utilities --config-file $(PYPIRC_PATH) $(Pipeline.Workspace)/build/*.whl --verbose displayName: 'Upload to feed'
错误日志
python -m twine upload -r FOTA_Utilities --config-file /home/vsts/work/_temp/twineAuthenticate/DM3CO8/.pypirc /home/vsts/work/1/build/*.whl --verbose ========================== Starting Command Output =========================== /usr/bin/bash --noprofile --norc /home/vsts/work/_temp/192f1878-a08d-43c1-ba3d-dd3fd66aee68.sh INFO Using configuration from /home/vsts/work/_temp/twineAuthenticate/DM3CO8/.pypirc Uploading distributions to https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/upload INFO /home/vsts/work/1/build/flash-0.1.0-py3-none-any.whl (37.5 KB) INFO username set from config file INFO password set from config file INFO username: build INFO password: <hidden> Uploading dataset_reflash-0.1.0-py3-none-any.whl 25l 0% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/43.9 kB • --:-- • ? 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 kB • 00:00 • 108.0 MB/s 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.9/43.9 kB • 00:00 • 108.0 MB/s 25hINFO Response from https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/ upload: 400 Bad Request - The email 'Salvatore Musumeci [xxxx]' is invalid. (DevOps Activity ID: 6BCEB4BD-CEED-4399-9280-AC4B876B604C) INFO {"$id":"1","innerException":null,"message":"The email 'Salvatore Musumeci [xxx]' is invalid.","typeName":"Microsoft.VisualStudio.Services.Packaging.Shared. WebApi.Exceptions.InvalidPackageException, Microsoft.VisualStudio.Services.Packaging.Shared.WebApi","typeKey":"Inv alidPackageException","errorCode":0,"eventId":3000} ERROR HTTPError: 400 Bad Request from https://pkgs.dev.azure.com/ORG_NAME/PRJ_NAME/_packaging/FOTA_Utilities/pypi/ upload Bad Request - The email 'Salvatore Musumeci [xxx]' is invalid. (DevOps Activity ID: 6BCEB4BD-CEED-4399-9280-AC4B876B604C) ##[error]Bash exited with code '1'. Finishing: Upload to feed
排查方向
- wheel包元数据错误:错误提示的
Salvatore Musumeci [xxxx]不是合法邮箱格式,说明wheel包的setup.py或pyproject.toml中作者邮箱配置不符合标准(应为xxx@domain.com格式),需检查并修正包的构建配置文件。 - 服务账号权限验证:确认流水线使用的服务账号具备Feed的推送权限(结合已提供的权限截图核实),不过当前错误核心是元数据非法,优先排查包本身配置。
- Twine版本兼容性:尝试指定安装稳定版本的twine(如
pip install twine==4.0.2),避免版本不兼容导致的元数据解析异常。
内容的提问来源于stack exchange,提问作者nos_86
相关产品推荐
相关产品推荐

