I placed a _post_put_hook into one of my NDB model types so that that whenever an entity of that type were put, it would invalidate a memcache key. This key is made up with the urlsafe version of the settings key. However, when this code runs, it says this:
Traceback (most recent call last):
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1536, in __call__
rv = self.handle_exception(request, response, e)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1530, in __call__
rv = self.router.dispatch(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1278, in default_dispatcher
return route.handler_adapter(request, response)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 1102, in __call__
return handler.dispatch()
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 572, in dispatch
return self.handle_exception(e, self.app.debug)
File "C:\Program Files (x86)\Google\google_appengine\lib\webapp2\webapp2.py", line 570, in dispatch
return method(*args, **kwargs)
File "U:\Hefner\Dropbox\Public\Projects\GHI\dev\rpc.py", line 68, in get
result = func(*args)
File "U:\Hefner\Dropbox\Public\Projects\GHI\dev\rpc.py", line 154, in pub_refreshSandbox
team_key = s.create.team("Cool Group")
File "U:\Hefner\Dropbox\Public\Projects\GHI\dev\GlobalUtilities.py", line 534, in team
new_team.put()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\model.py", line 2902, in _put
return self._put_async(**ctx_options).get_result()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 320, in get_result
self.check_success()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 315, in check_success
self.wait()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 299, in wait
if not ev.run1():
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\eventloop.py", line 219, in run1
delay = self.run0()
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\eventloop.py", line 181, in run0
callback(*args, **kwds)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 454, in _on_future_completion
self._help_tasklet_along(gen, val)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 368, in _help_tasklet_along
self.set_result(result)
File "C:\Program Files (x86)\Google\google_appengine\google\appengine\ext\ndb\tasklets.py", line 264, in set_result
callback(*args, **kwds)
File "U:\Hefner\Dropbox\Public\Projects\GHI\dev\DataModels.py", line 182, in _post_put_hook
tools.expireCache('allteams-' + self.settings.get().websafe)
AttributeError: 'KeyProperty' object has no attribute 'get'
Here is the relevant model class:
class Team(ndb.Expando):
name = ndb.StringProperty()
show_team = ndb.BooleanProperty()
settings = ndb.KeyProperty()
#classmethod
def _post_put_hook(self, future):
memcache.delete('allteams-' + self.settings.get().websafe)
Ideas?
in this case self.settings is not the actual key but the Models property because this is a classmethod and not an instance method. you need to work on the future object.
here the docs: https://developers.google.com/appengine/docs/python/ndb/futureclass
in this case:
#classmethod
def _post_put_hook(self, future):
entitykey = future.get_result()
entity = entitykey.get()
memcache.delete('allteams-' + entity.settings.get().websafe)
not sure what websafe does for you. maybe you mean entity.settings.urlsafe() ?
Related
I'm running into a 404 error (in the console) and 500 error (in the browser) when I'm simply trying to run this AppEngine tutorial
https://cloud.google.com/appengine/docs/standard/python/getting-started/python-standard-env
I followed the whole tutorial, copying the latest files from github, and am trying to run it in the local env.
dev_appserver.py --port=8080 --enable_console=yes app.yaml
When I try to browse to http://localhost:8080
In the console, I get
HTTPError()
HTTPError()
Traceback (most recent call last):
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\lib
\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\lib
\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\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:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\wsgi_server.py", line 292, in __call__
return app(environ, start_response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\request_rewriter.py", line 314, in _rewriter_m
iddleware
response_body = iter(application(environ, wrapped_start_response))
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\python\runtime\request_handler.py", line 165,
in __call__
self._flush_logs(response.get('logs', []))
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\python\runtime\request_handler.py", line 308,
in _flush_logs
apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_stub_map.py", line 97, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_stub_map.py", line 331, in MakeSyncCall
rpc.CheckSuccess()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_rpc.py", line 136, in CheckSuccess
self._traceback)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_rpc.py", line 161, in _WaitImpl
self.request, self.response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\ext\remote_api\remote_api_stub.py", line 223, in MakeSyncCall
self._MakeRealSyncCall(service, call, request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\ext\remote_api\remote_api_stub.py", line 248, in _MakeRealSyncCall
encoded_response = self._server.Send(self._path, encoded_request)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 485, in Send
self._Authenticate()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 631, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 369, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 308, in _GetAuthToken
response = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 435, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 473, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
INFO 2019-04-18 09:56:39,905 module.py:861] default: "GET /form HTTP/1.1" 50
0 -
Traceback (most recent call last):
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\lib
\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 1302, in communicate
req.respond()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\lib
\cherrypy\cherrypy\wsgiserver\wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\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:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\wsgi_server.py", line 292, in __call__
return app(environ, start_response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\request_rewriter.py", line 314, in _rewriter_m
iddleware
response_body = iter(application(environ, wrapped_start_response))
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\python\runtime\request_handler.py", line 165,
in __call__
self._flush_logs(response.get('logs', []))
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\devappserver2\python\runtime\request_handler.py", line 308,
in _flush_logs
apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_stub_map.py", line 97, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_stub_map.py", line 331, in MakeSyncCall
rpc.CheckSuccess()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_rpc.py", line 136, in CheckSuccess
self._traceback)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\api\apiproxy_rpc.py", line 161, in _WaitImpl
self.request, self.response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\ext\remote_api\remote_api_stub.py", line 223, in MakeSyncCall
self._MakeRealSyncCall(service, call, request, response)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\ext\remote_api\remote_api_stub.py", line 248, in _MakeRealSyncCall
encoded_response = self._server.Send(self._path, encoded_request)
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 485, in Send
self._Authenticate()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 631, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 369, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "C:\googlecloudsdk\install\google-cloud-sdk\platform\google_appengine\goo
gle\appengine\tools\appengine_rpc.py", line 308, in _GetAuthToken
response = self.opener.open(req)
File "C:\Python27\lib\urllib2.py", line 435, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 548, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 473, in error
return self._call_chain(*args)
File "C:\Python27\lib\urllib2.py", line 407, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
In the browser, I get
localhost is currently unable to handle this request.
HTTP ERROR 500
I've found some posts with similar symptoms, but not exact. And none of the solutions suggested fix the issue.
Tried:
- Specifying the port 8080 in the dev_appserver.
- Ensuring ASP.NET framework was installed.
- Turning on IIS.
- Ensuring SDK is latest version.
This is also just straight from Google's tutorial.
Anybody have any insight/ideas?
HTTPError: HTTP Error 404: Not Found INFO 2019-04-18 09:56:39,905
module.py:861] default: "GET /form HTTP/1.1" 500
this line jumps out. Are you sure you followed step 2 here and step 4 here?
If you are, can you run the command below in the project directory and provide the output? (Don't forget to remove PII/SPI)
dir . /s /b sortorder:N
**(geoenv) C:\Users\Nitish\Desktop\Mtech Project\Stage 8 database start\geosite>python manage.py createsuperuser
You have 13 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
Traceback (most recent call last):
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\sqlite3\base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such table: auth_user
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in
execute_from_command_line(sys.argv)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 63, in execute
return super(Command, self).execute(*args, **options)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management\commands\createsuperuser.py", line 96, in handle
default_username = get_default_username()
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\contrib\auth\management__init__.py", line 148, in get_default_username
auth_app.User._default_manager.get(username=default_username)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 374, in get
num = len(clone)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 232, in len
self._fetch_all()
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 1105, in _fetch_all
self._result_cache = list(self._iterable_class(self))
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\query.py", line 53, in iter
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\sql\compiler.py", line 886, in execute_sql
raise original_exception
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\models\sql\compiler.py", line 876, in execute_sql
cursor.execute(sql, params)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 80, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\utils.py", line 94, in exit
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\utils.py", line 65, in execute
return self.cursor.execute(sql, params)
File "C:\Users\Nitish\Desktop\MTECHP~1\STAGE8~1\geoenv\lib\site-packages\django\db\backends\sqlite3\base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: no such table: auth_user
createsuperuser
cmd can only be used after making models and makemigrations and migrate cmd.
I was trying to use it before that.
I am continuously getting connection Proxy error 502 (connection refused) on Google app engine while running the devserver locally. proxy is by passed for localserver but still its its refusing the connection.
here is what I am getting:
HTTPError()
HTTPError()
Traceback (most recent call last):
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
req.respond()
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 250, in __call__
return app(environ, start_response)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/request_rewriter.py", line 311, in _rewriter_middleware
response_body = iter(application(environ, wrapped_start_response))
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 89, in __call__
self._flush_logs(response.get('logs', []))
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 225, in _flush_logs
apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 328, in MakeSyncCall
rpc.CheckSuccess()
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_rpc.py", line 156, in _WaitImpl
self.request, self.response)
File "/home/arslan/GAE/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 200, in MakeSyncCall
self._MakeRealSyncCall(service, call, request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 226, in _MakeRealSyncCall
encoded_response = self._server.Send(self._path, encoded_request)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
f = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Proxy Error ( Connection refused )
Traceback (most recent call last):
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 1302, in communicate
req.respond()
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 831, in respond
self.server.gateway(self).respond()
File "/home/arslan/GAE/google_appengine/lib/cherrypy/cherrypy/wsgiserver/wsgiserver2.py", line 2115, in respond
response = self.req.server.wsgi_app(self.env, self.start_response)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/wsgi_server.py", line 250, in __call__
return app(environ, start_response)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/request_rewriter.py", line 311, in _rewriter_middleware
response_body = iter(application(environ, wrapped_start_response))
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 89, in __call__
self._flush_logs(response.get('logs', []))
File "/home/arslan/GAE/google_appengine/google/appengine/tools/devappserver2/python/request_handler.py", line 225, in _flush_logs
apiproxy_stub_map.MakeSyncCall('logservice', 'Flush', request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 94, in MakeSyncCall
return stubmap.MakeSyncCall(service, call, request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 328, in MakeSyncCall
rpc.CheckSuccess()
File "/home/arslan/GAE/google_appengine/google/appengine/api/apiproxy_rpc.py", line 156, in _WaitImpl
self.request, self.response)
File "/home/arslan/GAE/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 200, in MakeSyncCall
self._MakeRealSyncCall(service, call, request, response)
File "/home/arslan/GAE/google_appengine/google/appengine/ext/remote_api/remote_api_stub.py", line 226, in _MakeRealSyncCall
encoded_response = self._server.Send(self._path, encoded_request)
File "/home/arslan/GAE/google_appengine/google/appengine/tools/appengine_rpc.py", line 393, in Send
f = self.opener.open(req)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 502: Proxy Error ( Connection refused )
INFO 2013-07-17 20:55:24,534 module.py:595] default: "GET /favicon.ico HTTP/1.1" 500 -
I was getting very same error in MS windows, so switched to Ubuntu but still I am getting this. And getting this error after I updated my Google app engine SDK to 1.8.2, previous version was working fine.
Any guess why this is happening ?
Thanks in advance.
Well, I was using the proxy then and GAE/Python Snippet checks for update before running the server and was unable to locate the update server using proxy. Thats why I was getting that error.
I started using network without proxy and things started working normally :).
I obtain a error when try to write a file in cloud storage
my code:
my_file = files.gs.create('/gs/foo/myfile')
with files.open(my_file, 'a') as f:
f.write('Hello World!')
f.write('Hello World Again!')
Traceback (most recent call last):
File "C:\Datos\proyectos\dropbox\Proyectos\as3\semtable\remote_api\using_datastore.py", line 63, in <module>
f.write('Hello World Again!')
File "C:\Program Files\Google\google_appengine\google\appengine\api\files\file.py", line 281, in __exit__
self.close()
File "C:\Program Files\Google\google_appengine\google\appengine\api\files\file.py", line 275, in close
self._make_rpc_call_with_retry('Close', request, response)
File "C:\Program Files\Google\google_appengine\google\appengine\api\files\file.py", line 388, in _make_rpc_call_with_retry
_make_call(method, request, response)
File "C:\Program Files\Google\google_appengine\google\appengine\api\files\file.py", line 236, in _make_call
_raise_app_error(e)
File "C:\Program Files\Google\google_appengine\google\appengine\api\files\file.py", line 179, in _raise_app_error
raise FileNotOpenedError()
google.appengine.api.files.file.FileNotOpenedError
I am not able to deploy any project to Google App Engine and this is the error I get
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1250, in DoUpload
missing_files = self.Begin()
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appcfg.py", line 1045, in Begin
version=self.version, payload=self.config.ToYAML())
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 356, in Send
self._Authenticate()
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 391, in _Authenticate
super(HttpRpcServer, self)._Authenticate()
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 271, in _Authenticate
auth_token = self._GetAuthToken(credentials[0], credentials[1])
File "F:\Program Files\Google\google_appengine\google\appengine\tools\appengine_rpc.py", line 214, in _GetAuthToken
response = self.opener.open(req)
File "F:\Python25\lib\urllib2.py", line 381, in open
response = self._open(req, data)
File "F:\Python25\lib\urllib2.py", line 399, in _open
'_open', req)
File "F:\Python25\lib\urllib2.py", line 360, in _call_chain
result = func(*args)
File "F:\Python25\lib\urllib2.py", line 1115, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "F:\Python25\lib\urllib2.py", line 1082, in do_open
raise URLError(err)
URLError: < urlopen error (8, 'EOF occurred in violation of protocol') >
It looks like fiddler was interfering with upload, I did not know how to disable it so stopped it and then upload happened instantly. I got the clue from this blogpost.
Specially the part
proxies can result in this problem, which is likely caused by the HTTP header send being terminated prematurely.