s_mart s_mart - 4 months ago 31
Python Question

Python3 + vagrant ubuntu 16.04 + ssl request = [Errno 104] Connection reset by peer

I'm using on my Mac Vagrant with "bento/ubuntu-16.04" box. I'm trying to use Google Adwords Api via python library but got error

[Errno 104] Connection reset by peer

I make sample script to check possibility to send requests:

import urllib.request

url ="https://adwords.google.com/api/adwords/mcm/v201609/ManagedCustomerService?wsdl"
f = urllib.request.urlopen(url)

If I try this request via python3 - I've got
[Errno 104] Connection reset by peer
But if I send request via curl
curl https://adwords.google.com/api/adwords/mcm/v201609/ManagedCustomerService?wsdl
- I've got some response( even if it is 500 code) with body.

If I try this sample python script from my host Mac machine - I also receive some text response.
I tried this script from VDS server with ubuntu 16.04 - also worked.

So I assume, problem is possible between Vagrant/Mac.

Maybe you can help me?



I found solution. It looks like bug in Virtualbox 5.1.8 version. You can read about it here

So, you can fix it by downgrade Virtualbox to < 5.1.6