Google App Engine Ubuntu 14.04 urlfetch 500/200 (Python 2.7)

Hope this saves someone a little. Posting because I found very little regarding the URLFetch error.

I was getting unexpectedly "WARNING 2017-06-28 23: 09: 40,971 urlfetch_stub.py:550] Stripped forbidden headers from URLFetch: ['Host']" request in Google Places production app.

The update for Google Cloud SDK 161.0.0 was kind enough to let me know that my version of Python is out of date. Ubuntu 14.04 is frozen on Python v. 2.7.6

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
sudo apt-get update

      

The App engine is currently on Python 2.7.12, I tried to compile from the source but it didn't install, had success with this package and it seems to be at the end of support.

sudo add-apt-repository ppa:fkrull/deadsnakes-python2.7
sudo apt-get update 
sudo apt-get install python2.7

      

I needed to repeat the update and install a few steps to get the package installed. (Apparently the dependencies have other dependencies.)

python -V

      

should return: Python 2.7.12

+1


source to share


1 answer


Continuing after installing python 2.7.12. I started getting informational warnings from the App Engine interpreter (.local) by looking for a file named "mime.types" in various places.

INFO     2017-07-02 15:57:25,701 stubs.py:50] Sandbox prevented access to file "/etc/httpd/mime.types"
INFO     2017-07-02 15:57:25,701 stubs.py:51] If it is a static file, check that `application_readable: true` is set in your app.yaml

      

In stubs.py, App Engine goes through "mimetypes.knownfiles" looking for suggested file locations (different by OS). On Ubuntu 14.04, the file is at primary position [0], / etc / mime.types.



The data for the list (suggested search locations) is in known files = [] in / usr / lib / python 2.7 / mimetypes.py

https://docs.python.org/2/library/mimetypes.html

0


source







All Articles