The GAE SDK Console doesn't load the styles anymore - python

A few months ago I was working on a test GAE app. I was able to start the launcher and open the browser both on the app port and on the SDK Console port, and they both were working well.
Then I installed CherryPy, I created a CherryPy app, and I was able to browse to the app.
Today I restarted the GAE launcher. When I browse to my app page everything works well, while browsing to the SDK Console it shows the correct content, but doesn't show the static files.
The log mentions CherryPy.
Is the CherryPy I installed conflicting with GAE?
Does GAE use CherryPy (and my installation has nothing to do with it)?
How do I fix it?
For example when I browse to http://localhost:8002/assets/common.css (which is the css used by the SDK Console) I get the following log:
ERROR 2014-08-19 20:23:08,052 webapp2.py:1553] WSGI response header value u'text/css' is not of type str.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1547, in __call__
return response(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webob-1.2.3\webob\response.py", line 1021, in __call__
start_response(self.status, headerlist)
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2155, in start_response
raise TypeError("WSGI response header value %r is not of type str." % v)
TypeError: WSGI response header value u'text/css' is not of type str.
AssertionError('WSGI start_response called a second time with no exc_info.',)
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 266, in __call__
return app(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2-2.5.1\webapp2.py", line 1549, in __call__
return self._internal_error(e)(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webob-1.2.3\webob\response.py", line 1021, in __call__
start_response(self.status, headerlist)
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2137, in start_response
raise AssertionError("WSGI start_response called a second "
AssertionError: WSGI start_response called a second time with no exc_info.

There is a bug in the GAE Windows static file handling. It has been documented here:
Google App Engine: Won't serve static assets with below error:
Reported to be fixed by updating from Python 2.7.7 to 2.7.8. Otherwise, you will want to explicitly specify the MIME types for your static files in app.yaml, as shown on that linked page.

Related

Thonny IDE throws AssertionError on startup

I have faced error while opening the Thonny Ide.
ERROR: Internal error
Traceback (most recent call last):
File "C:\Program Files (x86)\Thonny\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 356, in cmd_stop_restart
self.restart_backend(True)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 458, in restart_backend
self._proxy = backend_class(clean)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 1036, in __init__
CPythonProxy.__init__(self, executable)
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 624, in __init__
self._start_new_process()
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\running.py", line 764, in _start_new_process
debug("Starting the backend: %s %s", cmd_line, get_workbench().get_cwd())
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\workbench.py", line 1252, in get_cwd
return normpath_with_actual_case(os.path.expanduser("~"))
File "C:\Program Files (x86)\Thonny\lib\site-packages\thonny\common.py", line 212, in normpath_with_actual_case
assert os.path.isabs(name)
AssertionError
OS: Windows 7 64-bit
Python: Python 3.7(94bit)
Thonny:3.1.2
Open %APPDATA%\Thonny\configuration.ini (or wherever your IDE config is)
Scroll down to [run] section and check parameter working_directory.
Make sure something meaningful is set there, e.g. C:\ should do the trick (no double backslahes, quotes, etc..).
I had the same issue. For some reason only word lib was there. Modifying this parameter to a proper filesystem path fixed it in my case.
Something has corrupted the current instance of your Thonny installation at the backend.
You will first need to completely uninstall Thonny and then remove any imprints of Thonny from your computer's registry.
Then reinstall Thonny and open Thonny IDE.
Hope this helps.
I also faced this issue, for me it was due to Antivirus, just disabling Auto Containment fixed the issue, Hope this helps.

"No module named memcache" error in openstack newton keystone when accessing murano dashboard

This image will help you to find the issue I have configured Openstack newton on ubunu 16.04 LTS. It works fine
Now i have planned to integrate Murano in to this.
All progressed fine..When i am running dashboard using "tox -e venv -- python manage.py runserver <IP:PORT>" command. I am able to run the murano dashboard.
When i am accessing environment tab it displaying error
Error: There was an error communicating with server.
And log message displays an error
No module named memcache
For your reference error message below:
Traceback (most recent call last):
File "/root/murano/murano/murano/api/middleware/fault.py", line 130, in
process_request
return req.get_response(self.application)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1299, in send
application, catch_exc_info=False)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/request.py",
line 1263, in call_application
app_iter = application(self.environ,
start_response)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 130, in __call__
resp = self.call_func(req, *args,
**self.kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/webob/dec.py",
line 195, in call_func
return self.func(req, *args, **kwargs)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 320, in __call__
response = self.process_request(req)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 552, in process_request
resp = super(AuthProtocol,
self).process_request(request)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 348, in process_request
data, user_auth_ref =
self._do_fetch_token(request.user_token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 388, in _do_fetch_token
data = self.fetch_token(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 661, in fetch_token
cached =
self._cache_get_hashes(token_hashes)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/__init__.py",
line 644, in _cache_get_hashes
cached =
self._token_cache.get(token)
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 214, in get
with self._cache_pool.reserve() as cache:
File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
return self.gen.next()
File "/root/murano/murano/.tox/venv/local/lib/python2.7/site-packages/keystonemiddleware/auth_token/_cache.py",
line 78, in reserve
import memcache
ImportError: No module named memcache
Can someone help on this?
Thanks in Advance.
Just installing memcached is not enough. You will also need to install python memcache module which is provided separately by python-memcache and python-pymemcache. I am not sure which one is used here.
You can try installing them with apt-get and see which one works for you.
Now working.. I have installed murano api and murano dashboard in different venv.
I have missed to install memcache in munano api venv. When i'm tried after install memcache in murano api venv..Now working fine..
#tutuDajuju Thanks for the Help...

Python Google AppEngine guestbook app only partially displayed except on localhost:8080

I followed the tutorial on https://developers.google.com/appengine/docs/python/gettingstartedpython27/introduction (up to and including step 8). All runs well except that the app is displayed only partially (login feature doesn't show, no layout) when I view the uploaded version (guestbookruud.appspot.com) or the local version using the Browse button of the Google App Engine Launcher (showing port 13080). Only if I view the app locally through port 8080 all shows as intended.
What is wrong and how to solve?
Question update:
Browse button from the Launcher now gives a HTTP500 error. Here's the log (local):
2014-06-05 22:55:33 Running command: "['C:\\Python27\\python.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=13080', '--admin_port=8005', 'C:\\Users\\ruudn_000\\Documents\\guestbook']"
INFO 2014-06-05 22:55:36,329 devappserver2.py:706] Skipping SDK update check.
WARNING 2014-06-05 22:55:36,351 api_server.py:378] Could not initialize images API; you are likely missing the Python "PIL" module.
INFO 2014-06-05 22:55:36,375 api_server.py:171] Starting API server at: http://localhost:49346
INFO 2014-06-05 22:55:36,384 dispatcher.py:182] Starting module "default" running at: http://localhost:13080
INFO 2014-06-05 22:55:36,390 admin_server.py:117] Starting admin server at: http://localhost:8005
OperationalError('database is locked',)
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 266, in __call__
return app(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\module.py", line 1407, in __call__
return self._handle_request(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\module.py", line 621, in _handle_request
module=self._module_configuration.module_name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub.py", line 165, in WrappedMethod
return method(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\logservice\logservice_stub.py", line 172, in start_request
host, start_time, method, resource, http_version, module))
OperationalError: database is locked
OperationalError('database is locked',)
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\Program Files (x86)\Google\google_appengine\lib\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\wsgi_server.py", line 266, in __call__
return app(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\module.py", line 1407, in __call__
return self._handle_request(environ, start_response)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\module.py", line 621, in _handle_request
module=self._module_configuration.module_name)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\apiproxy_stub.py", line 165, in WrappedMethod
return method(self, *args, **kwargs)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\logservice\logservice_stub.py", line 172, in start_request
host, start_time, method, resource, http_version, module))
OperationalError: database is locked
Found it, I was working in a different project directory than the one I was uploading from; though rather stupid this explains what was going on...

Errno 10054 An existing connection was forcibly closed by the remote host. - How to debug?

I'm using Google App Engine for the first time and I'm sort of confused about this error, I can't understand how to debug this any further.
I created an application under my account, then I'm trying to upload a python file into it via Google App Engine Launcher. But I keeping getting this error.
08:39 PM Host: appengine.google.com
08:39 PM Application: gappproxytestapp; version: 1
08:39 PM
Starting update of app: gappproxytestapp, version: 1
08:39 PM Getting current resource limits.
2012-11-13 20:40:32,505 ERROR appcfg.py:2202 An error occurred processing file '': <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>. Aborting.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 171, in <module>
run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\appcfg.py", line 167, in run_file
execfile(script_path, globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4322, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4313, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2599, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 4048, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3065, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 3047, in UpdateVersion
lambda path: self.opener(os.path.join(basepath, path), 'rb'))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 2172, in DoUpload
self.resource_limits = GetResourceLimits(self.rpcserver, self.config)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 357, in GetResourceLimits
resource_limits.update(GetRemoteResourceLimits(rpcserver, config))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appcfg.py", line 328, in GetRemoteResourceLimits
version=config.version)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 389, in Send
f = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1215, in https_open
**return self.do_open(httplib.HTTPSConnection, req)
File "C:\Program Files (x86)\Google\google_appengine\lib\fancy_urllib\fancy_urllib\__init__.py", line 383, in do_open
raise url_error
urllib2.URLError: <urlopen error [Errno 10054] An existing connection was forcibly closed by the remote host>
2012-11-13 20:40:32 (Process exited with code 1)**
You can close this window now.
How do I debug this further? Seems like urllib2 is having problems with HTTPS. But that's strange because I'm not behind any local proxy and I've never had any other HTTPS problems.
I faced the same issue. I closed the Google App Engine Launcher and started it again, and attempted uploading the app, it worked.
I encountered the same problem. It does not work even I try different different PCs, operating systems, updating the latest SDK, or other solutions. I doubt that it is the problem of the Google App Engine Server side. After waiting for one day, everything is fine. So if you have the same problem, it may be a good choice to wait for one day.

Django can't find can't find packages in virtualenv

I'm trying to set up a virtualenv for local development using Google App Engine and django-nonrel. I'm only trying to run the test app provided by django-nonrel for now.
The first time I tried, I got python manage.py runserver to work, but as soon as I tried to fetch a page from localhost:8080, it errored out on me, saying it couldn't find the pdb module:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2755, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2643, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 682, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1717, in Dispatch
self._module_dict)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1619, in ExecuteCGI
reset_modules = exec_py27_handler(config, handler_path, cgi_path, hook)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1425, in ExecutePy27Handler
import pdb
ImportError: No module named pdb
I tried copying modules from my main Python installation, and I also tried creating a new virtualenv which had access to site-packages. Both approaches worked up to a point - python manage.py runserver ended up not being able to find urllib.
On the other hand, python manage.py shell and then e.g. import pdb or import urrlib (or any other standard library, for that matter) work fine. What am I supposed to do?
The solution: don't use virtualenv at all, and put the libraries you're going to need (such as django) in your project directory. You're going to need that to deploy your app to GAE, anyway.

Categories

Resources