Forums

http requests for whitelisted url stopped coming through

Today the http requests stopped working, and I cannot figure out the reason. The same request works fine from localhost, so the issue seem to be somewhere in pythonanywhere.

Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 70, in get
        return request('get', url, params=params, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/requests/api.py", line 56, in request
        return session.request(method=method, url=url, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 488, in request
        resp = self.send(prep, **send_kwargs)
      File "/usr/local/lib/python3.6/dist-packages/requests/sessions.py", line 609, in send
        r = adapter.send(request, **kwargs)
      File "/usr/local/lib/python3.6/dist-packages/requests/adapters.py", line 485, in send
        raise ProxyError(e, request=request)
    requests.exceptions.ProxyError: HTTPSConnectionPool(host='api-xbox-console.worldoftanks.com', port=443): Max retries exceeded with url: /wotx/tanks/stats/?app
    lication_id=demo&account_id=248207 (Caused by ProxyError('Cannot connect to proxy.', timeout('timed out',)))

With the following code:

server = 'xbox'
account_id = 248207
url = 'https://api-{}-console.worldoftanks.com/wotx/tanks/stats/?application_id={}&account_id={}'\
       .format(server, 'demo', account_id)
resp = requests.get(url, timeout=10).json()

Unfortunately this renders my web app useless. Is there any reason for such behavior?

Same problem with maker.ifttt.com

Same problem

Same problem. Something happened with proxy server..

Same problem, Actually no outgoing connection works, be it from python (using http/urllib libraries) or wget or lynx. The webapp I am trying to deploy needs to do some screen scraping and connect to the google API, From Python the error is "OSError: [Errno 101] Network is unreachable"

Hi there,

Sorry about that- we had some problems with the proxy server for our free users (which made it hard to connect to whitelisted external websites). We have fixed that now- please let us know if you are still experiencing any problems!

We will also definitely look into implementing better monitoring/alerting to help us detect such problems earlier.

Still not working for me

2017-07-09 09:49:37,203: OSError: [Errno 101] Network is unreachable
2017-07-09 16:57:31,448: [2017-07-09 16:57:31,437] ERROR in app: Exception on /oauth2callback [GET]
2017-07-09 16:57:31,448: Traceback (most recent call last):
2017-07-09 16:57:31,448:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1982, in wsgi_app
2017-07-09 16:57:31,449:     response = self.full_dispatch_request()
2017-07-09 16:57:31,449:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1614, in full_dispatch_request
2017-07-09 16:57:31,449:     rv = self.handle_user_exception(e)
2017-07-09 16:57:31,449:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1517, in handle_user_exception
2017-07-09 16:57:31,449:     reraise(exc_type, exc_value, tb)
2017-07-09 16:57:31,449:   File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
2017-07-09 16:57:31,449:     raise value
2017-07-09 16:57:31,449:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1612, in full_dispatch_request
2017-07-09 16:57:31,450:     rv = self.dispatch_request()
2017-07-09 16:57:31,450:   File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1598, in dispatch_request
2017-07-09 16:57:31,450:     return self.view_functions[rule.endpoint](**req.view_args)
2017-07-09 16:57:31,450:   File "/home/diegoami/mysite/flask_formusic.py", line 69, in oauth2callback
2017-07-09 16:57:31,450:     credentials = flow.step2_exchange(auth_code)
2017-07-09 16:57:31,450:   File "/usr/local/lib/python3.6/dist-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
2017-07-09 16:57:31,450:     return wrapped(*args, **kwargs)
2017-07-09 16:57:31,450:   File "/usr/local/lib/python3.6/dist-packages/oauth2client/client.py", line 2047, in step2_exchange
2017-07-09 16:57:31,451:     http, self.token_uri, method='POST', body=body, headers=headers)
2017-07-09 16:57:31,451:   File "/usr/local/lib/python3.6/dist-packages/oauth2client/transport.py", line 282, in request
2017-07-09 16:57:31,451:     connection_type=connection_type)
2017-07-09 16:57:31,451:   File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1322, in request
2017-07-09 16:57:31,451:     (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
2017-07-09 16:57:31,451:   File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 1072, in _request
2017-07-09 16:57:31,451:     (response, content) = self._conn_request(conn, request_uri, method, body, headers)
2017-07-09 16:57:31,451:   File "/usr/local/lib/python3.6/dist-packages/httplib2/__init__.py", line 995, in _conn_request
2017-07-09 16:57:31,452:     conn.connect()
2017-07-09 16:57:31,452:   File "/usr/lib/python3.6/http/client.py", line 1392, in connect
2017-07-09 16:57:31,452:     super().connect()
2017-07-09 16:57:31,452:   File "/usr/lib/python3.6/http/client.py", line 936, in connect
2017-07-09 16:57:31,452:     (self.host,self.port), self.timeout, self.source_address)
2017-07-09 16:57:31,452:   File "/usr/lib/python3.6/socket.py", line 722, in create_connection
2017-07-09 16:57:31,452:     raise err
2017-07-09 16:57:31,452:   File "/usr/lib/python3.6/socket.py", line 713, in create_connection
2017-07-09 16:57:31,453:     sock.connect(sa)
2017-07-09 16:57:31,453: OSError: [Errno 101] Network is unreachable

In your code:

File "/home/diegoami/mysite/flask_formusic.py", line 69, in oauth2callback
2017-07-09 16:57:31,450:     credentials = flow.step2_exchange(auth_code)

Do you know what endpoint this is trying to hit?

If you are a free user and it is trying to hit an endpoint not on the whitelist, you will be blocked.