Python – Google App Engine – ConnectionError : (‘Connection aborted.’ , Error (13, ‘Permission denied’ ))

Google App Engine – ConnectionError : (‘Connection aborted.’ , Error (13, ‘Permission denied’ ))… here is a solution to the problem.

Google App Engine – ConnectionError : (‘Connection aborted.’ , Error (13, ‘Permission denied’ ))

I’m dealing with a connection error and need help. I use Python 2.7 and Google App Engine for this project. I’m trying to use nba_py a third-party API for retrieving additional information to display on my site, but I’m getting ConnectionError.
The error looks like this:

First connection error:

requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', HTTPException('Deadline exceeded 
while waiting for HTTP response from URL: http://stats.nba.com/stats/scoreboard?LeagueID=00&GameDate=03%2F03%2F2018&DayOffset=0',))

I’m not sure if I’ve fixed the problem correctly, but I’ll >__init__.py file Change HTTP in BASE_URL to HTTPS

So after that, it gave me SSLError:

requests/adapters.py", line 506, in send
        raise SSLError(e, request=request)
    SSLError: HTTPSConnectionPool(host='stats.nba.com', port=443): Max retries exceeded with url: /stats/scoreboard? DayOffset=0&GameDate=03%2F03%2F2018&LeagueID=00 (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",))

Again, I’m

not sure if I’ve fixed it correctly, but I’m adding name:ssl and version:latest to the from app.yaml file using Python SSL

After that, it gave me another connection error that I’ve been holding out for a while.

requests/adapters.py", line 490, in send
    raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))

We would appreciate any help or link that would help me with this. Thanks!

Solution

With requests toolbelt, requests are now available in production and development:

from requests_toolbelt.adapters import appengine
appengine.monkeypatch()

For more information, < a href="https://cloud.google.com/appengine/docs/standard/python/issue-requests" rel="noreferrer noopener nofollow">see this article

Related Problems and Solutions