0
votes

I am getting the following error when trying to run the nosetest from my GAE project:

nosetests --nologcapture --with-gae --without-sandbox --gae-lib-root=/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine

but I get the following error:

Traceback (most recent call last):
  File "/usr/local/bin/nosetests", line 8, in <module>
    load_entry_point('nose==1.3.4', 'console_scripts', 'nosetests')()
  File "/Library/Python/2.7/site-packages/nose/core.py", line 121, in __init__
    **extra_args)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/main.py", line 94, in __init__
    self.parseArgs(argv)
  File "/Library/Python/2.7/site-packages/nose/core.py", line 145, in parseArgs
    self.config.configure(argv, doc=self.usage())
  File "/Library/Python/2.7/site-packages/nose/config.py", line 346, in configure
    self.plugins.configure(options, self)
  File "/Library/Python/2.7/site-packages/nose/plugins/manager.py", line 284, in configure
    cfg(options, config)
  File "/Library/Python/2.7/site-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/Library/Python/2.7/site-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/Library/Python/2.7/site-packages/nosegae.py", line 87, in configure
    from google.appengine.tools import old_dev_appserver as dev_appserver
ImportError: cannot import name old_dev_appserver

The sys.path reads:

'/Users/dsinha/Downloads/eclipse/plugins/org.python.pydev_3.9.0.201411111611/pysrc', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/antlr3', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/fancy_urllib', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/ipaddr', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/yaml-3.10', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/rsa', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/pyasn1', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/pyasn1_modules', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/simplejson', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/lib/django-1.4', '/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/goo...

so the app engine libraries should be getting pulled in. Actually its first failing to pull in dev_appserver, and then trying and failing to pull old_dev_appserver

The dir inside the appengine/lib file is:

bash-3.2$ ls
__init__.py                     appcfg.py                       backends_xml_parser.py          dispatch_xml_parser.py          handler_generator.py            php_cli.py                      value_mixin.pyc
__init__.pyc                    appcfg_java.py                  boolean_action.py               docker                          handler_generator.pyc           queue_xml_parser.py             web_xml_parser.py
adaptive_thread_pool.py         appengine_rpc.py                boolean_action.pyc              dos_xml_parser.py               jarfile.py                      queue_xml_parser.pyc            web_xml_parser.pyc
api_server.py                   appengine_rpc.pyc               bulkload_client.py              download_appstats.py            java_quickstart.py              remote_api_shell.py             xml_parser_utils.py
app_engine_config_exception.py  appengine_rpc_httplib2.py       bulkloader.py                   endpointscfg.py                 java_quickstart.pyc             requeue.py                      xml_parser_utils.pyc
app_engine_config_exception.pyc augment_mimetypes.py            cron_xml_parser.py              gen_protorpc.py                 java_utils.py                   sdk_update_checker.py           yaml_translator.py
app_engine_web_xml_parser.py    augment_mimetypes.pyc           dev-channel-js.js               handler.py                      java_utils.pyc                  sdk_update_checker.pyc          yaml_translator.pyc
app_engine_web_xml_parser.pyc   backends_conversion.py          devappserver2                   handler.pyc                     os_compat.py                    value_mixin.py
bash-3.2$ pwd
/Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine/google/appengine/tools

I also tried to find the modules available inside the google.appengine.tools package:

>>> import pkgutil
>>> [name for _, name, _ in pkgutil.iter_modules(['testpkg'])]
[]

This problem started occuring after I upgraded to App Engine 1.9.10 (to use the async search features). In a problem that I think is related, when I try to run the debug server from PyDev, it just silently terminated on any page request (localhost:8080).

Running dev_appserver . from the command line works fine though.

1
Look for old_dev_appserver.py in /Users/dsinha/Dropbox/code/google-cloud-sdk/platform/google_appengine to be sure that you're using right GAE version.Dmytro Sadovnychyi
Good catch! So the release notes for 1.9.17 say that they have removed old_dev_appserver, but the real question is why it can't import dev_appserver in the first place...google-cloud-sdk/platform/google_appengine contains dev_appserver.py, but google_appengine/google/appengine/tools only contains a file called devappserver2.py. But nosegae has the line from google.appengine.tools import dev_appserver Can it be that nosegae has broken with the latest GAE?Debnath Sinha
Ok, apparently it has! github.com/Trii/NoseGAE/issues/6Debnath Sinha
I will take a look into a way to fix this.Dmytro Sadovnychyi
Can I downgrade to 1.9.10 in the meantime? I can only seem to upgrade using gcloud components update, is there any way I can downgrade it as well? Thanks for taking a look at this!Debnath Sinha

1 Answers

0
votes

Nose-GAE broke with App Engine 1.9.17: https://github.com/Trii/NoseGAE/issues/6 Downgrading to 1.9.15 made the problem go away temporarily while waiting for the issue to be resolved by nose-gae