google-code-export / appengine-devappserver2-experiment

Automatically exported from code.google.com/p/appengine-devappserver2-experiment
0 stars 0 forks source link

Inconsistent time with extracted _yaml.py causing server init failure #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
> What steps will reproduce the problem?
> What is the expected output? What do you see instead?

Unfortunately, I don't know if there is some environmental trigger to this.  
Basically the dev server simply doesn't run on this computer.  When the server 
starts, it will fail immediately with the error shown below.  Note that for 
clarity purposes I have deliberately commented out one of the try-catch 
statements in pkg_resources.py to pin-point the original source of the error.

Some further digging shows that the statement in pkg_resources.py

    if stat.st_size==size and stat.st_mtime==timestamp:

is supposed to evaluate to True since there is already a _yaml.py created.  
However, it is not because stat.st_mtime is actually exactly 5 hours ahead of 
timestamp (which coincides with my current time zone).  So my guess is that the 
_yaml.py has been extracted earlier and the process still holds the handle to 
it, and thus unlink will fail since the file is still in use.  The problem is 
that the above 'if' statement should have caught the issue but it did not 
because of this 5-hr difference.

INFO     2013-03-23 17:25:41,065 admin_server.py:117] Starting admin server at: 
http://localhost:8001
Traceback (most recent call last):
  File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 194, in <module>
    _run_file(__file__, globals())
  File "C:\Program Files (x86)\Google\google_appengine\_python_runtime.py", line 190, in _run_file
    execfile(script_path, globals_)
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\python\runtime.py", line 28, in <module>
    from google.appengine.ext.remote_api import remote_api_stub
  File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\remote_api\remote_api_stub.py", line 75, in <module>
    import yaml
  File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\__init__.py", line 14, in <module>
    from cyaml import *
  File "C:\Program Files (x86)\Google\google_appengine\lib\yaml-3.10\yaml\cyaml.py", line 5, in <module>
    from _yaml import CParser, CEmitter
  File "C:\Program Files (x86)\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", line 7, in <module>
  File "C:\Program Files (x86)\Python27\lib\site-packages\pyyaml-3.10-py2.7-win32.egg\_yaml.py", line 4, in __bootstrap__
  File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 882, in resource_filename
    self, resource_name
  File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 1351, in get_resource_filename
    self._extract_resource(manager, self._eager_to_zip(name))
  File "C:\Program Files (x86)\Python27\lib\site-packages\setuptools-0.6c11-py2.7.egg\pkg_resources.py", line 1402, in _extract_resource
    unlink(real_path)
WindowsError: [Error 5] Access is denied: '<<temporary 
directory>>\\pyyaml-3.10-py2.7-win32.egg-tmp\\_yaml.pyd'
ERROR    2013-03-23 17:25:41,973 http_runtime.py:221] unexpected port response 
from runtime ['']; exiting the development server

> What version of the product are you using? On what operating system?

Windows Server 2008 R2 (x64).
Time zone: Eastern.
Python 2.7.3.
Dev-server 1.7.6 (timestamp: 1360882848)

Original issue reported on code.google.com by fei.yua...@gmail.com on 23 Mar 2013 at 9:57

GoogleCodeExporter commented 9 years ago
More info:

It looks like the yaml module is being imported twice when the dev server 
loads.  However, the first time it was imported under my local (Eastern) time 
zone, while the 2nd time it was imported under UTC, which causes the time 
conflict demonstrated above.

Original comment by fei.yua...@gmail.com on 23 Mar 2013 at 10:34