Error: failed port of execution process [''] in App Engine

I am developing a website with GAE and webapp2. Sometimes when starting my development server, I get the following error from nowhere, without a stack trace:

http_runtime.py:404] bad runtime process port ['']

Sometimes this happens when I change part of my database schema (it is being developed too early), and the problem is fixed if I restart the server and empty the data store. However, sometimes this happens apparently for no reason.

The solution should always just restart the server, but I feel weird not knowing why I am getting this error. Is this something that happens when the server is too long? Is there anything I can do to prevent this? Does this happen in production? I want to know before I start thinking about deployment.

+4
source share
3 answers

For reference, the error comes from this line of code:

https://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/tools/devappserver2/http_runtime.py

This is in the start () function, so maybe something is causing your dev_app_server to restart itself and trying to reuse a port that is no longer available?

Can you try turning on debugging with devappserver and see if you can play it and paste it into context?

dev_appserver.py --dev_appserver_log_level=debug sets the log output for the debug level.

From dev_appserver.py --help

+1
source

It happened to me today. The error was consistent, i.e. Rebooting did not help.

In my case, the problem seemed to be related to virtualenv. The essence of what I did is:

 #In myproject/src/main which is the GAE project folder virtualenv venv source venv/bin/activate pip install lxml cd ../.. dev_appserver src/main 

Note that the GAE root was in src / main, but I worked from the "grandparent" directory, which is my root git repository.

If you instead install the same virtualenv in the grandparent directory, the problem goes away. I.e.

 #In myproject/ which is my git repository root virtualenv venv source venv/bin/activate pip install lxml dev_appserver src/main 

I do not know why this matters.

0
source

Although I'm not sure of the exact mechanism from the log trace and watch http_runtime.py, I believe that goapp and devappserver exchange data via stdin and stdout, possibly using a mechanism similar to a pipe. http_runtime :: start () parses args to get the port that will be used to start the server. If any of the lines in args contains {port}, it replaces this substring with the selected port. This allows the user-defined runtime to pass the port along with the subprocess as a command line argument.

Using fmt.PrintXXX () in init () seems to break this by modifying the contents of Stdout. This particular error occurs on line 391 and is due to http_runtime getting a ValueError exception when trying to convert a port argument to int.

Check if you are using fmt.PrintXXX () in init. Go to the stderr entry, or better yet, use the log interface. This is what worked for me.

You can check this link to google groups ( https://groups.google.com/forum/#!topic/google-appengine-go/v_6-qY0-dD8 ) for more details.

0
source

Source: https://habr.com/ru/post/1500410/


All Articles