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

Issue with MEO ISP in Portugal - 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')) #5374

Closed
andmart opened this issue May 6, 2018 · 75 comments

Comments

@andmart
Copy link

andmart commented May 6, 2018

  • Pip version: 10.0.0
  • Python version: 3.5.2
  • Operating system: Ubuntu 16.04

Description:

I cannot install packages using pip

What I've run:

pip install cython
pip install kivy
pip install --upgrade pip

all this leads to the same error as below.

pip install kivy -v

Outputs:

Created temporary directory: /tmp/pip-ephem-wheel-cache-rs27mmeh
Created temporary directory: /tmp/pip-install-dtnthpzj
Collecting kivy
  1 location(s) to search for versions of kivy:
  * https://pypi.python.org/simple/kivy/
  Getting page https://pypi.python.org/simple/kivy/
  Looking up "https://pypi.python.org/simple/kivy/" in the cache
  Returning cached "301 Moved Permanently" response (ignoring date and etag information)
  Looking up "https://pypi.org/simple/kivy/" in the cache
  No cache entry available
  Starting new HTTPS connection (1): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=4, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (2): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=3, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (3): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=2, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (4): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=1, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (5): pypi.org
  Incremented Retry for (url='/simple/kivy/'): Retry(total=0, connect=None, read=None, redirect=None, status=None)
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))': /simple/kivy/
  Starting new HTTPS connection (6): pypi.org
  Could not fetch URL https://pypi.python.org/simple/kivy/: connection error: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/kivy/ (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))) - skipping
  Could not find a version that satisfies the requirement kivy (from versions: )
Cleaning up...
No matching distribution found for kivy
Exception information:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/operations/prepare.py", line 243, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/req/req_install.py", line 307, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python3.5/dist-packages/pip-10.0.0-py3.5.egg/pip/_internal/index.py", line 533, in find_requirement
    'No matching distribution found for %s' % req
pip._internal.exceptions.DistributionNotFound: No matching distribution found for kivy
You are using pip version 10.0.0, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
@sigmavirus24
Copy link
Member

Are you using a proxy?

@pradyunsg
Copy link
Member

Hey @andmart!

This seems to be a network issue. Could you provide us with more details of how you're connecting, such as whether you're connecting through a proxy and whether your SSL version is new enough?

@pradyunsg pradyunsg added the S: awaiting response Waiting for a response/more information label May 6, 2018
@carlos-menezes
Copy link

carlos-menezes commented May 6, 2018

I am having the same issue. To reply to your question, @pradyunsg , I am not connecting through a proxy (not that I know of) and I don't know how to check if my SSL version is recent enough.

@carlos-menezes
Copy link

Update: Running the pip install <package> command via Powershell does not give this error.

@sigmavirus24
Copy link
Member

@crlsmnzs So it sounds like you were using ubuntu 16.04, pip 10.0.0, and python 3.5 as well in your initial test. Is that accurate?

@andmart
Copy link
Author

andmart commented May 7, 2018

@sigmavirus24 no. I am not using a proxy. Using my home network.
Openssl version : 1.02g

@pradyunsg
Copy link
Member

This error would usually happen when there's something like a proxy or a firewall blocking connections.

@andmart
Copy link
Author

andmart commented May 7, 2018

I think you are right. It worked when connected in another network. But when @sigmavirus24 asked if I am using a proxy, I tried a VPN and it also did not wok.

@pradyunsg pradyunsg added type: support User Support and removed S: awaiting response Waiting for a response/more information labels May 7, 2018
@carlos-menezes
Copy link

@sigmavirus24 I'm using Windows 10, pip 10.0.0 and Python 3.6.5.

@Tmpod
Copy link

Tmpod commented Aug 24, 2018

I'm getting the exact same issue. I'm using nextcloudpi on my RPi3 Model B. This issue started when I upgraded my internet plan and the ISP technitians switched my old router for a new one. That morning I had installed a package, but in the afternoon, after the router switch, I started getting this problem. I don't have a clue how to disable the router firewall or give it a whitelist. Guess I have some research to do.

@Ilhicas
Copy link

Ilhicas commented Aug 24, 2018

Same issue here, not connected through a proxy, same issues are present if connected via VPN to another network. Besides the issue is intermittent.

On ubuntu 18.04
'OpenSSL 1.1.0g 2 Nov 2017'

Also having the same issues under others servers provided by fastly

vagrantup.com and python.org all of which have changes to the TLS forcing to TLS v1.2

The proxy is referred everywhere as possible issues, I'm not behind any corporate firewall. I'm using a simple business connection by a Portuguese ISP

Haven't tested under windows to check for issues on network yet, will update.

Curl also has issues with those even forcing it to tls , chrome also. So not a pip isolated problem, but rather a problem with network, just not proxy related.

@Tmpod
Copy link

Tmpod commented Aug 24, 2018

eheheh. Is it MEO? Because I just upgraded my internet and got a new MEO router (they promised the FiberGateWay, but I got a crappy one. Still trying to solve that one out) and I started having this error on my RPi.

@andmart
Copy link
Author

andmart commented Aug 25, 2018

Yep. MEO here.

@Ilhicas
Copy link

Ilhicas commented Aug 25, 2018

Yes, can confirm it's MEO, we've tried a mobile hotspot from NOS and we have been able to reach vagrantup.com rubygems.org python.org pypa.io , all fastly served at tls 1.2

Failure on MEO ISP network in Coimbra Area with the following OS's:

Network 1 (Business MEO ISP connection) :
Ubuntu 18.04 - Machine1
Ubuntu 16.04 - Machine2
Windows 10 Professional - Machine1

Network 2 (Home MEO ISP connection) :
Ubuntu 18.04 - Machine1

Success on NOS mobile hotspot:
Ubuntu 18.04 - Machine1
Ubuntu 16.04 - Machine2
Windows 10 Professional - Machine1

Haven't been able to test other ISP's.
However and this is the strange part:

I've been able to successfully use pip without failure using Docker NAT on MEO ISP:
docker run -it --rm python:alpine sh / # pip install requests Collecting requests Downloading https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl (91kB) 100% |████████████████████████████████| 92kB 776kB/s Collecting certifi>=2017.4.17 (from requests) Downloading https://files.pythonhosted.org/packages/df/f7/04fee6ac349e915b82171f8e23cee63644d83663b34c539f7a09aed18f9e/certifi-2018.8.24-py2.py3-none-any.whl (147kB) 100% |████████████████████████████████| 153kB 2.5MB/s Collecting idna<2.8,>=2.5 (from requests) Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB) 100% |████████████████████████████████| 61kB 5.4MB/s Collecting urllib3<1.24,>=1.21.1 (from requests) Downloading https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl (133kB) 100% |████████████████████████████████| 143kB 7.0MB/s Collecting chardet<3.1.0,>=3.0.2 (from requests) Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB) 100% |████████████████████████████████| 143kB 6.0MB/s Installing collected packages: certifi, idna, urllib3, chardet, requests Successfully installed certifi-2018.8.24 chardet-3.0.4 idna-2.7 requests-2.19.1 urllib3-1.23 / #
However unable to install while connected via wifi or ethernet
All dns cache has been flushed, nslookup returns the same IP address on both NOS and MEO network.
ilhicas@ilhicas-HP-Notebook:~$ pip install virtualenv Collecting virtualenv Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/virtualenv/ Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/virtualenv/ Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/virtualenv/ Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', error(104, 'Connection reset by peer'))': /simple/virtualenv/

@Ilhicas
Copy link

Ilhicas commented Aug 25, 2018

Yet another strange report.

When connected to MEO-WIFI ( using the same router ) i'm able to reach all above mentioned domains correctly as well as pip install.

I've also edited nameservers to google without any luck, flushing cache dns etc..on the private network.

@lalvarezguillen
Copy link

lalvarezguillen commented Sep 2, 2018

I just moved to Coimbra. I can confirm I get the same error, only with MEO.

I ask that you please update this thread if you find a solution. Is there any point in contacting MEO? I wouldn't know what to say...

@Ilhicas
Copy link

Ilhicas commented Sep 3, 2018

I've had this error only in Coimbra, been to Évora this past weekend without issues reaching the sites mentioned before under a Windows OS, I hadn't tried via Ubuntu (given other issues)

Regarding the contacting MEO, I haven't done it also due to the same reasons, If you have a technical issue with their hardware it's already a pain to get it fixed, so I can only imagine the terrors you would go through explaining this.. :D

The only NOT a real solution for now is to switch to their MEO-WIFI infra when you need it. And besides that, you can always use docker, as from what it seems under a docker container I have no issues.. That alone tilts me.. Can't figure out why yet. So you could create a volume from the container to the host to the place you wish to do the pip install, maybe some virtual environment creation with all the packages you wish to install via pip. When I get the time I'll post here that solution

@lalvarezguillen
Copy link

@Ilhicas thanks for sharing your findings man.

I'm sticking to Vodafone for the time being, but I'll make sure to take a look at your Docker workaround and see if I can figure out the root of the issue.

@ferrolho
Copy link

ferrolho commented Sep 8, 2018

I can confirm I am having the same issue. I am also with MEO as the service provider in Viseu, Portugal.
I'm using my mobile hotspot as a workaround in the meanwhile...

@citylife4
Copy link

citylife4 commented Sep 8, 2018

Confirming the same issue with MEO service provider in Porto, Portugal.
I also have been trouble to connect to https://www.python.org/ , https://docs.python.org/ and https://docs.python.org/ websites, with a "This site can’t be reached" error.
I've tried to change DNS provider, but that did not solve the issue...
I've have been having those issues for a long time, however, mysteriously there are times that pip and docs works....

@citylife4
Copy link

Hello!!
I've found a solution! I've change not only the IPv4 DNS but also the IPv6 to another provider then the ISP one, and now it works!
Cheers!

@osl21
Copy link

osl21 commented Sep 20, 2018

@citylife4 and everyone else here.
I'm from MEO too and I'm having the same issue here.
I've changed the DNS on my MEO router to cloudflare's, google's, etc, but no luck on making pypi, pythonhosted or anything else work.
wget and curl give tls errors, and the browsers get stuck on error pages (tls errors too).
I'm assuming this is the same issue since I'm having the same errors.
Connecting to other networks, or strangely enough, using a VM ( Don't ask me how) seems to fix it.
What can I do for now besides using another network, since it's preferable to use my own home connection and it's a PIA to offload the .tar.gz python packages from my server to install them with python.

@citylife4
Copy link

citylife4 commented Sep 20, 2018

If you have disabled IPv6 (I didn't try to change the IPv6 DNS, but in theory, it should also work) and changed IPv4 DNS and it still doesn't work, I don't know what you can do...
For me has been working fine ever since!

UPDATE : Changing the IPv6 DNS provider does not resolve this, IPv6 needs to be disabled.

Tested on Windows 10 + Debian on Rasp Pi

@osl21
Copy link

osl21 commented Sep 20, 2018

Even removing MEO's DNS from their router via telnet and replacing them with my own (IPv4 and IPv6) doesn't work. Disabling IPv6 in the kernel would be even more unpratical for me than connecting to another network. Is this a problem on MEO's infrastructure(network) or router? I'm really puzzled since this doesn't work on my Linux distro or Windows 10, but works on Linux or BSD VMs...

@andmart
Copy link
Author

andmart commented Sep 21, 2018

I have faced the same problems after @citylife4 pointed out the DNS solution. What really worked for me was use nordvpn, but I will reinforce with MEO to fix this.

@osl21
Copy link

osl21 commented Sep 21, 2018

For now, my solution is temporarily disabling IPv6 on Linux with sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' , that way it isn't anything permanent. But I still want this fixed on MEO's side, so I'll try to figure this out, since every time the router reboots, it keeps my DNS server settings (either google's or cloudflare's), but it creeps their IPv4 and IPv6 DNS back in on set 100.
Pip strangely works with IPv6 disabled, which is nothing short of bizarre, but I'll look onto this further.

@pfmoore
Copy link
Member

pfmoore commented Sep 21, 2018

This issue seems to be about specific ISPs (I'm not sure, as I don't recognise the names, they are presumably local to one particular region?). If so, an someone suggest a more useful title for the issue to help anyone with a similar problem locate it?

Also, I don't see anything actionable for pip here, so I suggest that the issue can be closed (which won't prevent further comments, if anyone has extra experience to add).

@Ilhicas
Copy link

Ilhicas commented Oct 9, 2018

Different equipment here, yet its the same brand, just an higher version from the technical details, just tested and it seemed to work now, but as mentioned previously the error occurrence is non-deterministic.

Technicolor Gateway

Product Name: TG784n v3

Software Release: 10.2.1.O

Software Variant: DS

Boot Loader Version: 1.1.2

Product Code: 3690227E

Board Name: DANT-U

@lvale
Copy link

lvale commented Oct 9, 2018

With a little more searching found a tentative solution here https://www.reddit.com/r/portugal/comments/8cjj3s/developers_com_meo_em_casa_conexões_bloqueadas/

which is basically to disable ipv6 on the router/gateway

telnet to router/gateway

telnet _ipaddress_
dhcp serverv6 config state=disabled
ip ifconfig intf=LocalNetwork ipv6=disabled
saveall
exit

Not sure it will last the "periodic" updates by the ISP....

@jgrocha
Copy link

jgrocha commented Oct 21, 2018

One workaround is to disable IPv6.

  1. Disable IPv6
  2. Run pip
  3. Enable IPv6

@JoaoLages
Copy link

I report that sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6' worked for me as well! Thanks a lot!! I wasnt able to install anything with pip

@infomagichand
Copy link

sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'
worked great for me to!!!

@brpaz
Copy link

brpaz commented Nov 17, 2018

Have this problem also, not only with pip but with many HTTPS websites mostly behind Fastly CDN. Also with MEO as my ISP. Yes disable ipv6 did the trick.

Still would like to understand why this happens.

I know that before disabling ipv6, if I checked my Public IP it would give an ipv6 one. Dont really Know if its an ISP problem or if many websites cant still handle well ipv6 addresses.

@supine
Copy link

supine commented Nov 20, 2018

@brpaz see #5374 (comment)

@rpmcruz
Copy link

rpmcruz commented Dec 19, 2018

Thank you so much guys, I can confirm that only disabling IPv6 works. I have tried many things before.

@Julian
Copy link
Contributor

Julian commented Jan 3, 2019

It's likely somewhat obvious, but will just note that this issue also affects https://pypi.org via browsers, not just pip.

@bitkill
Copy link

bitkill commented Feb 6, 2019

Disabling ipv6 solved this issue for me. Still annoying though.

@aronreisx
Copy link

Same problem for me. I am using MEO from Aveiro.
Disabling IPv6 works fine for any package install. As a brazilian, I consider Portugal a weird network...
Thanks for support.

@ansssu
Copy link

ansssu commented Mar 17, 2019

Guys,

I had same problem, using MEO ISP/Router.

I solve using this command, to disable ipv6 network: sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'

Then, i run pip and it works!!!

@aaubry
Copy link

aaubry commented Mar 31, 2019

I have the same issue. Since this problem is clearly related to MEO, is there a more appropriate forum to discuss this issue ? I have opened a support ticket with MEO, but I'd like to know if anyone else has done the same, and what answer did they receive.

@brpaz
Copy link

brpaz commented Mar 31, 2019

@aaubry I posted on the Meo forum, some time ago but no answer.

I didn't opened a support ticket tough. May be I will do. Please keep me posted if you get an answer.

@Kotork
Copy link

Kotork commented May 25, 2019

Hello guys,

I'm from Coimbra, Portugal and had the same issue for so I tried the following and worked

I just changed my IPv4 DNS to 8.8.8.8 and 8.8.4.4 (Google)
And disabled IPv6 and it worked.

If you want to keep IPv6 on, you can only disable it when you're installing something with pip.

@rvzlima
Copy link

rvzlima commented Jul 11, 2019

Reporting from Almada (MEO):

Disabling IPv6 allowed me to use 'pip install package'.
So if u want to install something just disable IPv6 while you're doing it.
For reference I'm using, in the IPv4 DNS : 8.8.8.8 and 8.8.4.4

@filcon
Copy link

filcon commented Jul 23, 2019

Same problem using MEO in Évora (Ubunbu 18.04).
Also solved it with:
sudo sh -c 'echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6'

@mguimas
Copy link

mguimas commented Aug 30, 2019

I am also behind MEO. My workaround was to temporarily disable IPv6 as explained How to disable IPv6 address on Ubuntu 18.04 Bionic Beaver Linux . This link also explains how to permanently disable IPv6.

@Zizico2
Copy link

Zizico2 commented Jan 13, 2020

Has anyone tried this with 3rd party routers and modems? Are we sure the problem is meo's infrastructure? Or could it be the devices?

@rpmcruz
Copy link

rpmcruz commented Jan 13, 2020

@Zizico2 I think it was a problem with the devices because since the last firmware update, I never had any problems with IPv6. Or maybe they updated the infrastructure at the same time.

Is anyone still having a problem with MEO? What version of the device are you using? (You can access http://192.168.1.254/ to find out.)

My device: Technicolor TG784n v3
Firmware version: M19 10.5.8.U [FV]

@pradyunsg
Copy link
Member

Hi folks!

If you're still having issues connection to PyPI w/ MEO as your ISP, please open an issue in pypa/pypi-support using the 'Network Access Issue' template.

That is a much better place for further discussion on this issue + better visibility for PyPI admins, so that they may take a look if there's anything actionable on the PSF-infra side.

@pradyunsg
Copy link
Member

AFAICT, this is a case of an IPv6 issue with MEO; since disabling IPv6 seems to be working for some users.

@supine
Copy link

supine commented Feb 6, 2020

@pradyunsg the problem was identified in #5374 (comment)

I believe as a result of firmware upgrades and/or changes to routing topology this particular problem should be resolved.

Folks should be encouraged to retest IPv6 to see if it remains an issue for them.

@vpereira01
Copy link

I think Fastly has fixed the issue on their side.

I have the broken router and I see no issue doing curl -6 https://files.pythonhosted.org/packages/65/47/7e02164a2a3db50ed6d8a6ab1d6d60b69c4c3fdf57a284257925dfc12bda/requests-2.19.1-py2.py3-none-any.whl -o /dev/null

PS: Linux users, with the broken router can also disable IPv6 Flow Labels instead of disabling IPv6 by changing this sysctl -w net.ipv6.auto_flowlabels=0. This is temporary change, check your distro docs on how to do a permanent change.

@pradyunsg
Copy link
Member

Closing this since this looks like a problem that has been resolved. :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests