error FileNotOpenedError - google-app-engine

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

Related

kiwi-tcms: kiwi_db restarting loop

I am trying to install kiwi-tcms and when I get to step:
docker exec -it kiwi_web /Kiwi/manage.py initial_setup
D:\path\to\kiwi-tcms>docker exec -it kiwi_web /Kiwi/manage.py initial_setup
Applying migrations:
Traceback (most recent call last):
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection
connection = Database.connect(**conn_params)
File "/venv/lib64/python3.8/site-packages/MySQLdb/init.py", line 130, in Connect
return Connection(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/MySQLdb/connections.py", line 185, in init
super().init(*args, **kwargs2)
MySQLdb._exceptions.OperationalError: (2005, "Unknown MySQL server host 'db' (-2)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Kiwi/manage.py", line 12, in
execute_from_command_line(sys.argv)
File "/venv/lib64/python3.8/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/venv/lib64/python3.8/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/venv/lib64/python3.8/site-packages/tcms/core/management/commands/initial_setup.py", line 11, in handle
call_command("migrate", "--verbosity=%i" % kwargs["verbosity"])
File "/venv/lib64/python3.8/site-packages/django/core/management/init.py", line 181, in call_command
return command.execute(*args, **defaults)
File "/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/venv/lib64/python3.8/site-packages/django/core/management/base.py", line 89, in wrapped
res = handle_func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/core/management/commands/migrate.py", line 92, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/venv/lib64/python3.8/site-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
File "/venv/lib64/python3.8/site-packages/django/db/migrations/loader.py", line 53, in init
self.build_graph()
File "/venv/lib64/python3.8/site-packages/django/db/migrations/loader.py", line 220, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/venv/lib64/python3.8/site-packages/django/db/migrations/recorder.py", line 77, in applied_migrations
if self.has_table():
File "/venv/lib64/python3.8/site-packages/django/db/migrations/recorder.py", line 55, in has_table
with self.connection.cursor() as cursor:
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 259, in cursor
return self._cursor()
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 235, in _cursor
self.ensure_connection()
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/venv/lib64/python3.8/site-packages/django/db/utils.py", line 90, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 219, in ensure_connection
self.connect()
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/base/base.py", line 200, in connect
self.connection = self.get_new_connection(conn_params)
File "/venv/lib64/python3.8/site-packages/django/utils/asyncio.py", line 26, in inner
return func(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/django/db/backends/mysql/base.py", line 234, in get_new_connection
connection = Database.connect(**conn_params)
File "/venv/lib64/python3.8/site-packages/MySQLdb/init.py", line 130, in Connect
return Connection(*args, **kwargs)
File "/venv/lib64/python3.8/site-packages/MySQLdb/connections.py", line 185, in init
super().init(*args, **kwargs2)
django.db.utils.OperationalError: (2005, "Unknown MySQL server host 'db' (-2)")
I'm working windows 10. I also have the kiwi_db that is constantly restarted in docker
Unknown MySQL server host 'db' (-2)"
The error message itself is clear enough. Your DB server doesn't seem to be up and running.
I'm working windows 10. I also have the kiwi_db that is constantly restarted in docker
Kiwi TCMS and MySQL/MariaDB are Linux based containers so maybe your Windows host is not capable of running Linux containers in the first place. Refer to Docker's documentation/support on that matter.
This may be of help but fair warning that it's been written by a 3rd party not affiliated with the Kiwi TCMS team:
https://medium.com/#siriwardhane.yuwin/running-kiwi-tcms-as-a-docker-container-in-windows-10-home-82d74b107202

How can I fix Flask in local appengine env giving 404/500 error

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

Django 1.11 - python 3.4 // not able to createsuperuser

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

HTTPError: HTTP Error 502: Proxy Error ( Connection refused )

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

KeyProperty object has no attribute get

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() ?

Resources