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

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...

Related

Django ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

I am using django with postgresql, whenever I try to save or delete anything, this error occurs -
Traceback (most recent call last):
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
Not Found: /favicon.ico
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
[02/Aug/2016 18:30:14] "GET /favicon.ico HTTP/1.1" 404 2044
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "c:\program files (x86)\python35-32\Lib\socket.py", line 593, in write
return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
[02/Aug/2016 18:30:14] "GET /api/delete/ HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 1712)
Traceback (most recent call last):
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 138, in run
self.finish_response()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 332, in send_headers
self.send_preamble()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 255, in send_preamble
('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 453, in _write
self.stdout.write(data)
File "c:\program files (x86)\python35-32\Lib\socket.py", line 593, in write
return self._sock.send(b)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 141, in run
self.handle_error()
File "C:\Users\sushant\Desktop\projects\drfapi\venv\lib\site-packages\django\core\servers\basehttp.py", line 92, in handle_error
super(ServerHandler, self).handle_error()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 368, in handle_error
self.finish_response()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 180, in finish_response
self.write(data)
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 274, in write
self.send_headers()
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 331, in send_headers
if not self.origin_server or self.client_is_modern():
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 344, in client_is_modern
return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files (x86)\python35-32\Lib\socketserver.py", line 628, in process_request_thread
self.finish_request(request, client_address)
File "c:\program files (x86)\python35-32\Lib\socketserver.py", line 357, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "C:\Users\sushant\Desktop\projects\drfapi\venv\lib\site-packages\django\core\servers\basehttp.py", line 99, in __init__
super(WSGIRequestHandler, self).__init__(*args, **kwargs)
File "c:\program files (x86)\python35-32\Lib\socketserver.py", line 684, in __init__
self.handle()
File "C:\Users\sushant\Desktop\projects\drfapi\venv\lib\site-packages\django\core\servers\basehttp.py", line 179, in handle
handler.run(self.server.get_app())
File "c:\program files (x86)\python35-32\Lib\wsgiref\handlers.py", line 144, in run
self.close()
File "c:\program files (x86)\python35-32\Lib\wsgiref\simple_server.py", line 35, in close
self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'
----------------------------------------
What happens is whenever a database save\delete command is there, it gets executed twice, first time without errors, second time, throwing this error and hence, save is done twice.
What I understand is some program is blocking it(as the error says) so I removed the anti-virus that I had but with no conclusions.
Does anyone have any idea what this is all about?
Edit: It's a Python bug, reported here
I have checked in a fix for this in Python: https://github.com/python/cpython/pull/9713
It will be available in the next version of Python 3.7 and later.
I was making a web application and was facing the same issue in windows 10, python 3.7.6, django 3.0.8. I tried a lot of stuff and i finally found a fix.
I was using a form which called a js function onsubmit which in turn sent a REST call which was getting canceled with the '[WinError 10053] An established connection was aborted by the software in your host machine' error in command prompt.
I added the parameter method='post' and used jQuery.ajax in the js function and i added the event.preventDefault() as well in the function as well as some success and fail callbacks. I don't understand why but now i am not getting the error.
Hope this help anyone using js along with HTML forms until a the issue is root-caused and fixed.
This Github bug is tracking the issue
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine
If you are working with the videos this happens when you make another request while the video is uploading to the database.
I would suggest you to use preload='none' in video tag or block the new requests while video is uploading.
I was running into this error even with Python 3.6.5 and django 2.0
I noticed 301 redirects in the network tab of the browser debugger. When I fixed them by appending trailing backslashes to all url/api calls in my html/js, this problem went away. The urlconf must have trailing backslashes as well.
this happened to me in the past:
In my case:
I opened it in firefox first and faced this error.
then I opened it in Microsoft edge and the error was gone.
try this:
open the server URL in a different browser, and see the result must be normal.
I had the same error: ConnectionAbortedError: [WinError 10053].
Python version: 3.8.1
I restarted my computer and the error disappeared

Development Server Load Error

I wasn't able to load my app engine development server due to an error without a log file. After re-installing it and deleting the .ini files, I got the launcher to launch.
However, one out of my three projects will now not launch, with a trace that doesn't make much sense (it refers to pickle when I don't use it anywhere in my project). If you can give me any help it would be appreciated.
Trace:
2016-05-15 22:45:02 Running command: "['C:\\Python27\\pythonw.exe', 'C:\\Program Files (x86)\\Google\\google_appengine\\dev_appserver.py', '--skip_sdk_update_check=yes', '--port=4712', '--admin_port=8000', 'C:\\Users\\Paul\\Desktop\\Tram Live\\App Engine\\Sheffield']"
INFO 2016-05-15 22:45:05,448 devappserver2.py:769] Skipping SDK update check.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 84, in <module>
_run_file(__file__, globals())
File "C:\Program Files (x86)\Google\google_appengine\dev_appserver.py", line 80, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 1040, in <module>
main()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 1033, in main
dev_server.start(options)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 820, in start
request_data, storage_path, options, configuration)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\devappserver2.py", line 925, in _create_api_server
appidentity_oauth_url=options.appidentity_oauth_url)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\devappserver2\api_server.py", line 477, in setup_stubs
simple_search_stub.SearchServiceStub(index_file=search_index_path))
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\search\simple_search_stub.py", line 683, in __init__
self.Read()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\search\simple_search_stub.py", line 1164, in Read
read_indexes = self._ReadFromFile()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\api\search\simple_search_stub.py", line 1138, in _ReadFromFile
version, indexes = pickle.load(open(self.__index_file, 'rb'))
EOFError
2016-05-15 22:45:05 (Process exited with code 1)

The GAE SDK Console doesn't load the styles anymore

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.

Python App Engine will not deploy - timeout

My app refuses to deploy, just writes
Checking if deployment succeeded.
Will check again in 60 seconds.
Over and over, then times out.
This is my .bat file:
python "C:\Program Files (x86)\Google\google_appengine\appcfg.py"
--email=my email --passin update "app directory"
My internet connection works ok otherwise. Any ideas?
Full error:
2013-02-02 21:01:22,963 WARNING appcfg.py:2053 Version still not ready to serve,
aborting.
2013-02-02 21:01:22,966 ERROR appcfg.py:2267 An unexpected error occurred. Abort
ing.
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 2253, in DoUpload
app_summary = self.Commit()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 2054, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
09:01 PM Rolling back the update.
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\ap
pcfg.py", line 4377, in <module>
main(sys.argv)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 4368, in main
result = AppCfgApp(argv).Run()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 2605, in Run
self.action(self)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 4103, in __call__
return method()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 3115, in Update
self.UpdateVersion(rpcserver, self.basepath, appyaml)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 3097, in UpdateVersion
return appversion.DoUpload(paths, openfunc)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 2253, in DoUpload
app_summary = self.Commit()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\tools\ap
pcfg.py", line 2054, in Commit
raise Exception('Version not ready.')
Exception: Version not ready.
I don't think that you're doing anything wrong. Sometimes Google App Engine is not responding the way you want, because they might have some issues on their side.
Try to change a version and redeploy (or use the --version=version-name in the command line). If that is not going to fix it, you'll have to wait a while and then try again

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.

Categories

Resources