EOFError: EOF read where object expected

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

Recently there have been strange errors on GAE, like this one:

Traceback (most recent call last):   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle     handler = _config_handle.add_wsgi_middleware(self._LoadHandler())   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler     handler, path, err = LoadObject(self._handler)   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 96, in LoadObject     __import__(cumulative_path) EOFError: EOF read where object expected 

Not sure if the fault is in my app or on GAE. Anyone else seeing this?

回答1:

Most likely a race condition when 3 or more Python processes read/write the same pyc file. Fixed in Python 3.3: http://bugs.python.org/issue13146



回答2:

I am seeing exactly this error. Nothing to do with your app, I think, just some kind of transient problem with App Engine. I noticed a few instances of it around 4am GMT yesterday.

"/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 96, in LoadObject __import__(cumulative_path) EOFError: EOF read where object expected 


回答3:

If there is an instance currently running for your project, shut it down and startup a new instance. That seemed to fix it for me.


P.S. I had a weird error the other day that looked like this:

Traceback (most recent call last):   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 240, in Handle     handler = _config_handle.add_wsgi_middleware(self._LoadHandler())   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 299, in _LoadHandler     handler, path, err = LoadObject(self._handler)   File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/runtime/wsgi.py", line 85, in LoadObject     obj = __import__(path[0])   File "/base/data/home/apps/xxxxxx/xxxxxx/upload.py", line 11, in <module>     import traceback SystemExit: -1 

This error seems similar, in that it contains some of the same lines, but leads me to think that some instances were started incorrectly or something like that. Stopping the instance and starting up a new one fixed this error as well.



回答4:

I'm having the same exact issue. It must be something wrong with App Engine. They've been having issues.

Update: Following rgutierrez1014's tip to shutdown any instances currently running fixed the issue.



回答5:

I experienced the same error. Because the module that GAE was trying to load was in a bad state, this led to weird AttributeError, because the module partly loaded was in a bad state now. Restarting solved the problem.



回答6:

There is an Issue 11776 about this open on Google App Engine PIT, please feel free to Star in order to get notified of any updates about this issue.



回答7:

In my case it was meanwhile using Django... Some Python2.7 .pyc installation packages were corrupt. rm -r -- **/*.pyc to delete all .pyc in the file system or more accurate:

import sys print '\n'.join(sys.path)

to check where is the installation folders and recursively delete all .pyc files and done it, Python starts working again



易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!