【问题标题】:Artifactory 7.x - pypi proxy errrorArtifactory 7.x - pypi 代理错误
【发布时间】:2021-09-08 02:30:12
【问题描述】:

我有一个具有简单默认布局的本地 Pypi 存储库。它已授予匿名读取访问权限。我正在使用这个存储库来存储我的库。 从 Artifactory 6.x 升级到 7.x 后,无法使用 pip 安装任何库;它在 6.x 中工作。在pip install my-python-lib 上返回以下错误:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after 
connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='host', port=8081): 
Read timed out. (read timeout=30.0)")': /artifactory/api/pypi/my-python-repo/simple/my-python-lib/

Could not install packages due to an EnvironmentError: HTTPConnectionPool(host='host', port=8081): 
Max retries exceeded with url: /artifactory/api/pypi/my-python-repo/simple/my-python-lib/ (Caused by 
ReadTimeoutError("HTTPConnectionPool(host='host', port=8081): Read timed out. (read timeout=30.0)"))

设置更长的--default-timeout 也不起作用。

当我尝试在浏览器中打开 host/artifactory/api/pypi/my-python-repo/simple/my-python-lib/ 时,它返回以下错误(大约 2 分钟后):

502 代理错误 代理服务器从 上游服务器。代理服务器无法处理请求 GET /artifactory/api/pypi/my-python-repo/simple/my-python-lib/。 原因:从远程服务器读取错误

【问题讨论】:

  • 我找到了解决此问题的方法。 --default-timeout 选项已弃用,目前应使用 --timeout。这样我就可以开始安装了。该问题可能与人工机器上配置错误的 tomcat 有关。将继续挖掘并分享结果。

标签: python pip artifactory pypi


【解决方案1】:

似乎在 Artifactory 之上配置了反向代理(Nginx 或 HTTPD),与 Artifactory 6.x 相比,Artifactory 7.x 具有不同的配置。我建议您参考此KB article 以获得更多见解。

【讨论】:

  • 感谢您的回答。我也是这么想的,所以我配置了我的 pip.conf 以绕过使用直接地址到工件实例的反向代理服务器。也没有帮助。
  • 在浏览器上运行 Art_IP:8082/artifactory/api/pypi/my-python-repo/simple/ 会发生什么?并且由于您绕过了反向代理,错误是相同的还是显示不同的错误?
  • 使用浏览器我可以立即打开 Art_IP:8082/artifactory/api/pypi/my-python-repo/simple/。但是,如果我去 Art_IP:8082/artifactory/api/pypi/my-python-repo/simple/my-python-lib/ 我得到 502 错误。有时它会返回所有已部署的版本,但在大多数情况下,我会收到 502 代理错误。
  • 跟踪 artifactory-service.log 和 artifactory-request.log 并运行 Art_IP:8082/artifactory/api/pypi/my-python-repo/simple/my-python-lib/ 并检查如果那里打印了任何内容,通常应该有错误或警告。请在这里分享
猜你喜欢
  • 1970-01-01
  • 2010-12-02
  • 1970-01-01
  • 1970-01-01
  • 2018-10-05
  • 1970-01-01
  • 1970-01-01
  • 2020-04-21
  • 2012-09-11
相关资源
最近更新 更多