Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip does not work with proxy setup correctly #11736

Closed
1 task done
stefaneacsu147 opened this issue Jan 20, 2023 · 1 comment
Closed
1 task done

Pip does not work with proxy setup correctly #11736

stefaneacsu147 opened this issue Jan 20, 2023 · 1 comment
Labels
type: bug A confirmed bug or unintended behavior

Comments

@stefaneacsu147
Copy link

stefaneacsu147 commented Jan 20, 2023

Description

We have the following base image for Python 3.11 and I would like to install six for some tests to run in a pipeline. I already set up these tests for Python 3.8, 3.6, and the alpine version and it works without fail.

But setting the test for Python 3.11 fails to say that it cannot/connect to the proxy.

Running pip config list:

global.index-url='http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/'
global.proxy='http://zproxy.uk2.xxx.net:10074'
global.trusted-host='infra-mavenproxy-stag.stag.svc.cluster.local.'

Running the command pip install six gets the following error:

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc9e34bef90>, 'Connection to zproxy.uk2.xxxx.net timed out. (connect timeout=15)')': http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/six/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc9e34bff50>, 'Connection to zproxy.uk2.xxxx.net timed out. (connect timeout=15)')': http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/six/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc9e34cce90>, 'Connection to zproxy.uk2.xxxx.net timed out. (connect timeout=15)')': http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/six/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc9e34cde50>, 'Connection to zproxy.uk2.xxxx.net timed out. (connect timeout=15)')': http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/six/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.HTTPConnection object at 0x7fc9e34cee50>, 'Connection to zproxy.uk2.xxxxx.net timed out. (connect timeout=15)')': http://infra-mavenproxy-stag.stag.svc.cluster.local.:8000/pypi.org/simple/six/
ERROR: Could not find a version that satisfies the requirement six (from versions: none)
ERROR: No matching distribution found for six

I tried with Python 3.10 and it's the same issue. It seems from 3.8 and above it does not work and I cannot understand why since the proxy and certificates are all set up and work in the previous versions.

Running env | grep HTTP:

KUBERNETES_SERVICE_PORT_HTTPS=443
PROJENV_HTTPS_PROXY=http://zproxy.uk2.xxx.net:10074
PROJENV_HTTP_PROXY=http://zproxy.uk2.xxx.net:10074

Expected behavior

To install the six packages using pip. I already tried with python3 -m, and pip3, and also tried to use the --proxy argument, and the --trusted-host to overwrite it but still the same error.

pip version

22.3.1

Python version

3.11

OS

4.19.145-flatcar

How to Reproduce

  1. pip install -v six
  2. pip install --proxy -v six

Output

No response

Code of Conduct

@stefaneacsu147 stefaneacsu147 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Jan 20, 2023
@notatallshaw
Copy link
Member

notatallshaw commented Jan 20, 2023

Pip is just using requests to do http calls. See if you can make http calls using your proxies with requests and what error you might get: https://requests.readthedocs.io/en/latest/user/advanced/#proxies

Inside a corporate environment I would recommend looking in to using px-proxy to automatically connect to and authenticate against your corporate proxies. You would then use your localhost px-proxy as the proxy for pip/requests: https://github.com/genotrance/px#what-is-px

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2023
@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants