LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-21-2024, 12:49 PM   #1
steelwing
LQ Newbie
 
Registered: May 2017
Posts: 18

Rep: Reputation: Disabled
Question Python 3 pip cannot reach PyPI through squid proxy


Background: I work in a "disconnected" environment. We have our internal network running a few Windows machines and a whole horde of RHEL7/8 servers. There's a firewall at the edge of that network, and on the other side of it is a larger organizational network with Internet access. In the past we've had holes in that firewall for internal servers to go through if there's something on the Internet they absolutely need.
The situation: My coworkers wanted to have a proxy server to have all our internal systems that need to touch the internet go through. So we set up Squid on a RHEL8 server, gave it a list of source IPs it was allowed to receive from, and a whitelist of destinations those IPs were allowed to go to on the Internet. The proxy sits outside the firewall, and only those machines that need Internet access have holes to go through to the proxy. And it works wonderfully, except for a single case...
The problem: We have a server that we want to use to host an internal repository of Python packages (using python-pypi-mirror. It is set up to reach through the proxy (via the firewall) to PyPI. I can run wget https://python.org and it connects successfully and downloads the index page. But when I run pip...
Code:
$ pip3 install --user python-pypi-mirror
Collecting python-pypi-mirror
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff41f142f98>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/python-pypi-mirror/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff41f142ac8>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/python-pypi-mirror/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff41f142710>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/python-pypi-mirror/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff41f142dd8>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/python-pypi-mirror/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff41f142400>: Failed to establish a new connection: [Errno 101] Network is unreachable',)': /simple/python-pypi-mirror/
  Could not find a version that satisfies the requirement python-pypi-mirror (from versions: )
No matching distribution found for python-pypi-mirror
On the Squid proxy, the logs show the client connects and reaches through to PyPI (TCP_TUNNEL/200), but then we get TCP_TUNNEL_ABORTED. Googling suggests there may have once been a problem where libraries that pip depends on forced all HTTP connections to use HTTPS, does anyone know if that still happens? If not, does anyone have any other ideas?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
'sudo pip install' is not recognized. 'pip install' is recognized. MrBright2019 Linux - Newbie 1 07-28-2020 10:09 PM
LXer: How to install pip to manage PyPI packages easily LXer Syndicated Linux News 0 03-13-2020 01:01 PM
LXer: pip Uninstall | Uninstall a Package Installed with pip LXer Syndicated Linux News 0 03-01-2018 10:30 AM
Hello, Bon Jour, Pip Pip SocaSpice LinuxQuestions.org Member Intro 3 11-14-2010 08:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration