RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'> - python

Im running Nginx + Gunicorn + FastAPI application. I have rather simple ML application in my file main.py.
I used this manual to set (Russian translate):
[Развертывайте приложение Fastapi на Ubuntu с Nginx, Gunicorn и UVicorn][1]
When I'm trying to check
gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app
I see this error
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 211, in run
self.manage_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 551, in manage_workers
self.spawn_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 623, in spawn_workers
time.sleep(0.1 * random.random())
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
self.reap_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
self.log.warning(
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/glogging.py", line 261, in warning
self.error_log.warning(msg, *args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
self.emit(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1093, in emit
self.handleError(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1007, in handleError
traceback.print_exception(t, v, tb, None, sys.stderr)
File "/usr/lib/python3.8/traceback.py", line 105, in print_exception
print(line, file=file, end="")
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
self.reap_workers()
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/arbiter.py", line 530, in reap_workers
self.log.warning(
File "/var/www/ste/venv/lib/python3.8/site-packages/gunicorn/glogging.py", line 261, in warning
self.error_log.warning(msg, *args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1458, in warning
self._log(WARNING, msg, args, **kwargs)
File "/usr/lib/python3.8/logging/__init__.py", line 1589, in _log
self.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1599, in handle
self.callHandlers(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1661, in callHandlers
hdlr.handle(record)
File "/usr/lib/python3.8/logging/__init__.py", line 954, in handle
self.emit(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1093, in emit
self.handleError(record)
File "/usr/lib/python3.8/logging/__init__.py", line 1006, in handleError
sys.stderr.write('--- Logging error ---\n')
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stderr>'>
[2022-02-21 21:02:44 +0300] [650] [WARNING] Worker with pid 656 was terminated due to signal 4 ```
I have file main.py and app in it. Any ideas how to handle this error?
[1]: https://pythobyte.com/deploy-fastapi-application-on-ubuntu-with-nginx-gunicorn-and-uvicorn-3mbl-f789b2df/

Related

Error while upgrading superset to 2.0.0 psycopg2.errors.UndefinedColumn

After updating superset to 2.0.0 I cannot access sqllab nor view databases (Oracle DB).
I'm running superset on openshift with custom image built from apache/superset:2.0.0
Installed dependencies:
cx_Oracle certifi flask-oidc==1.4.0 flask_openid gevent psycopg2 psycopg2-binary==2.9.1 redis==3.5.3 itsdangerous==2.0.1
I tried running superset db upgrade with following result:
$ superset db upgrade
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
logging was configured successfully
2022-11-21 14:21:41,835:INFO:superset.utils.logging_configurator:logging was configured successfully
2022-11-21 14:21:41,841:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
and superset init throws error:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UndefinedColumn: column dbs.allow_multi_schema_metadata_fetch does not exist
LINE 1: ..., dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/superset", line 33, in \<module\>
sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1128, in __call__
return self.main(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 601, in main
return super().main(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return \_process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, \*\*ctx.params)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return \__callback(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 445, in decorator
return \__ctx.invoke(f, \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return \__callback(\*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/flask/cli.py", line 445, in decorator
return \__ctx.invoke(f, \*args, \*\*kwargs)
File "/usr/local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return _callback(\*args, \*\*kwargs)
File "/app/superset/cli/main.py", line 62, in init
security_manager.sync_role_definitions()
File "/app/superset/security/manager.py", line 731, in sync_role_definitions
self.create_missing_perms()
File "/app/superset/security/manager.py", line 679, in create_missing_perms
merge_pv("datasource_access", datasource.get_perm())
File "/app/superset/connectors/sqla/models.py", line 826, in get_perm
if self.database is None:
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 294, in __get__
return self.impl.get(instance_state(instance), dict_)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/attributes.py", line 730, in get
value = self.callable(state, passive)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 759, in \_load_for_state
return self.\_emit_lazyload(
File "\<string\>", line 1, in \<lambda\>
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/strategies.py", line 847, in \_emit_lazyload
q(session)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 615, in \_load_on_pk_identity
result = list(bq.for_session(self.session).params(\*\*params))
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/ext/baked.py", line 444, in __iter__
return q.\_execute_and_instances(context)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/orm/query.py", line 3560, in \_execute_and_instances
result = conn.execute(querycontext.statement, self.\_params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/elements.py", line 298, in \_execute_on_connection
return connection.\_execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1124, in \_execute_clauseelement
ret = self.\_execute_context(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1316, in \_execute_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1510, in handle_dbapi_exception
util.raise_(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise
raise exception
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1276, in _execute_context
self.dialect.do_execute(
File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedColumn) column dbs.allow_multi_schema_metadata_fetch does not exist
LINE 1: ..., dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_...
^
\[SQL: SELECT dbs.uuid AS dbs_uuid, dbs.created_on AS dbs_created_on, dbs.changed_on AS dbs_changed_on, dbs.id AS dbs_id, dbs.verbose_name AS dbs_verbose_name, dbs.database_name AS dbs_database_name, dbs.sqlalchemy_uri AS dbs_sqlalchemy_uri, dbs.password AS dbs_password, dbs.cache_timeout AS dbs_cache_timeout, dbs.select_as_create_table_as AS dbs_select_as_create_table_as, dbs.expose_in_sqllab AS dbs_expose_in_sqllab, dbs.configuration_method AS dbs_configuration_method, dbs.allow_run_async AS dbs_allow_run_async, dbs.allow_file_upload AS dbs_allow_file_upload, dbs.allow_ctas AS dbs_allow_ctas, dbs.allow_cvas AS dbs_allow_cvas, dbs.allow_dml AS dbs_allow_dml, dbs.force_ctas_schema AS dbs_force_ctas_schema, dbs.allow_multi_schema_metadata_fetch AS dbs_allow_multi_schema_metadata_fetch, dbs.extra AS dbs_extra, dbs.encrypted_extra AS dbs_encrypted_extra, dbs.impersonate_user AS dbs_impersonate_user, dbs.server_cert AS dbs_server_cert, dbs.is_managed_externally AS dbs_is_managed_externally, dbs.external_url AS dbs_external_url, dbs.created_by_fk AS dbs_created_by_fk, dbs.changed_by_fk AS dbs_changed_by_fk
FROM dbs
WHERE dbs.id = %(param_1)s\]
\[parameters: {'param_1': 1}\]
(Background on this error at: http://sqlalche.me/e/13/f405)
Anyone found solution for this error?
Tried:
superset db upgrade
superset init
updating dependencies
restarting superset
Expect:
successfully migrate to 2.0.0 version

boto3 ConnectionClosedError python

I am trying to deploy Rest Api with Chalice.
When I do chalice deploy.
The code worked with chalice local. But it fails in Deployment.
I get the following error:
Creating deployment package.
Updating policy for IAM role: learnChalice-dev
Updating lambda function: learnChalice-dev
Traceback (most recent call last):
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 92, in _send_request
method, url, body, headers, *args, **kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 119, in _send_output
self.send(msg)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 203, in send
return super(AWSConnection, self).send(str)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 987, in send
self.sock.sendall(data)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/ssl.py", line 1034, in sendall
v = self.send(byte_view[count:])
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/ssl.py", line 1003, in send
return self._sslobj.write(data)
socket.timeout: The write operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/httpsession.py", line 263, in send
chunked=self._chunked(request.headers),
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/util/retry.py", line 344, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/packages/six.py", line 685, in reraise
raise value.with_traceback(tb)
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 354, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 92, in _send_request
method, url, body, headers, *args, **kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 119, in _send_output
self.send(msg)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/awsrequest.py", line 203, in send
return super(AWSConnection, self).send(str)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/http/client.py", line 987, in send
self.sock.sendall(data)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/ssl.py", line 1034, in sendall
v = self.send(byte_view[count:])
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/ssl.py", line 1003, in send
return self._sslobj.write(data)
urllib3.exceptions.ProtocolError: ('Connection aborted.', timeout('The write operation timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/cli/__init__.py", line 599, in main
return cli(obj={})
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/cli/init.py", line 206, in deploy
deployed_values = d.deploy(config, chalice_stage_name=stage)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/deploy/deployer.py", line 353, in deploy
return self._deploy(config, chalice_stage_name)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/deploy/deployer.py", line 366, in _deploy
self._executor.execute(plan)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/deploy/executor.py", line 44, in execute
self._default_handler)(instruction)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/deploy/executor.py", line 56, in _do_apicall
result = method(**final_kwargs)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/awsclient.py", line 273, in update_function
zip_contents=zip_contents)
File "/home/dragon/anaconda3/envs/my_env/lib/python3.7/site-packages/chalice/awsclient.py", line 294, in _update_function_code
FunctionName=function_name, ZipFile=zip_contents)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/client.py", line 316, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/client.py", line 613, in _make_api_call
operation_model, request_dict, request_context)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/client.py", line 632, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
return self._send_request(request_dict, operation_model)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 137, in _send_request
success_response, exception):
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 231, in _needs_retry
caught_exception=caught_exception, request_dict=request_dict)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/hooks.py", line 356, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/hooks.py", line 228, in emit
return self._emit(event_name, kwargs)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/hooks.py", line 211, in _emit
response = handler(**kwargs)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 183, in __call__
if self._checker(attempts, response, caught_exception):
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 251, in __call__
caught_exception)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 277, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 317, in __call__
caught_exception)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 223, in __call__
attempt_number, caught_exception)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/retryhandler.py", line 359, in _check_caught_exception
raise caught_exception
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 200, in _do_get_response
http_response = self._send(request)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/endpoint.py", line 244, in _send
return self.http_session.send(request)
File "/home/dragon/.local/lib/python3.7/site-packages/botocore/httpsession.py", line 294, in send
endpoint_url=request.url
botocore.exceptions.ConnectionClosedError: Connection was closed before we received a valid response from endpoint URL: "https://lambda.ap-south-1.amazonaws.com/2015-03-31/functions/learnChalice-dev/code".
Thanks a lot for help.
Based on the comments, the solution was to increase default timeout:
chalice deploy --connection-timeout 300

Connecting Flask To AWS RDS using Flask-SQLAlchemy

I have been trying to connect my aws RDS database instance to a flask application I have downloaded. I have been following https://medium.com/#rodkey/deploying-a-flask-application-on-aws-a72daba6bb80 and using the flask app on this github to connect to the database https://github.com/inkjet/flask-aws-tutorial. I have set the permissions on my RDS server correctly and have been using the following code to connect to the DB.
# edit the URI below to add your RDS password and your AWS URL
# The other elements are the same as used in the tutorial
# format: (user):(password)#(db_identifier).amazonaws.com:3306/(db_name)
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://{userName}:{password}#{endpoint}:3306/{dbName}'
# Uncomment the line below if you want to work with a local DB
#SQLALCHEMY_DATABASE_URI = 'sqlite:///test.db'
SQLALCHEMY_POOL_RECYCLE = 3600
WTF_CSRF_ENABLED = True
I am still receiving a timeout error:
{path_to_virt_env}/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py:834: FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future. Set it to True or False to suppress this warning.
'SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and '
Traceback (most recent call last):
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/connections.py", line 583, in connect
**kwargs)
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 728, in create_connection
raise err
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socket.py", line 716, in create_connection
sock.connect(sa)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
return fn()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self._dec_overflow()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
self.__connect(first_connect_check=True)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/connections.py", line 325, in __init__
self.connect()
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/connections.py", line 630, in connect
raise exc
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on '{endpoint}' (timed out)")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "db_create.py", line 4, in <module>
db.create_all()
File "{path_to_virt_env}/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 1039, in create_all
self._execute_for_all_tables(app, bind, 'create_all')
File "{path_to_virt_env}/lib/python3.7/site-packages/flask_sqlalchemy/__init__.py", line 1031, in _execute_for_all_tables
op(bind=self.get_engine(app, bind), **extra)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/sql/schema.py", line 4465, in create_all
ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2103, in _run_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2095, in _optional_conn_ctx_manager
with self._contextual_connect() as conn:
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2311, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2349, in _wrap_pool_connect
e, dialect, self
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1591, in _handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 2345, in _wrap_pool_connect
return fn()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 364, in connect
return _ConnectionFairy._checkout(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 778, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 495, in checkout
rec = pool._do_get()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 140, in _do_get
self._dec_overflow()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/impl.py", line 137, in _do_get
return self._create_connection()
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 309, in _create_connection
return _ConnectionRecord(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 440, in __init__
self.__connect(first_connect_check=True)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 661, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 178, in raise_
raise exception
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/pool/base.py", line 656, in __connect
connection = pool._invoke_creator(self)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "{path_to_virt_env}/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 490, in connect
return self.dbapi.connect(*cargs, **cparams)
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/__init__.py", line 94, in Connect
return Connection(*args, **kwargs)
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/connections.py", line 325, in __init__
self.connect()
File "{path_to_virt_env}/lib/python3.7/site-packages/pymysql/connections.py", line 630, in connect
raise exc
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2003, "Can't connect to MySQL server on '{endpoint}' (timed out)")
(Background on this error at: http://sqlalche.me/e/e3q8
If any more information is needed, please let me know!
Based on the comments, the issue was that RDS's public accessibility setting was not enabled.
The solution was to enable it.

Pylons Google App Engine installation raise an error

I used latest version of GAE.
I try install Pylons v1.0 with this help article:
http://countergram.com/pylons-google-app-engine
paster serve --reload development.ini
work fine
Apache2+wsgi work fine
But: dev_appserver.py pylons
I have got error message:
INFO:root:Starting admin server at: [Link to localhost:8000 ERROR]
2013-07-11 11:55:07,816 cgi.py:121] Traceback (most recent call last):
File "/home/evgeny/PycharmProjects/pylons/app.py", line 41, in
run_wsgi_app(loadapp('config:development.ini',
relative_to=appdir)) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 247, in
loadapp ret*emphasized text*urn loadobj(APP, uri, name=name, **kw) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 271, in
loadobj global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in
loadcontext global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 320, in
_loadconfig return loader.get_context(object_type, name, global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 454,
in get_context section) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 476, in
_context_from_use object_type, name=use, global_conf=global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 406,
in get_context global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 296, in
loadcontext global_conf=global_conf) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 328, in
_loadegg return loader.get_context(object_type, name, global_conf) File "lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 620,
in get_context object_type, name=name) File
"lib/python2.7/site-packages/paste/deploy/loadwsgi.py", line 646, in
find_egg_entry_point possible.append((entry.load(), protocol,
entry.name)) File
"lib/python2.7/site-packages/distribute-0.6.19-py2.7.egg/pkg_resources.py",
line 1991, in load entry = import(self.module_name,
globals(),globals(), ['name']) File
"project/project/config/middleware.py", line 9, in from
routes.middleware import RoutesMiddleware File
"lib/python2.7/site-packages/routes/init.py", line 140, in
from routes.mapper import Mapper File
"lib/python2.7/site-packages/routes/mapper.py", line 7, in
from repoze.lru import LRUCache ImportError: No module named
repoze.lru
It's really simple decision.
At virtualenv path:
touch lib/python2.7/site-packages/repoze/__init__.py

infinite recursion in google app engine logging system

On my local instance of the app engine application I am developing I am experiencing an infinite recursion of the logging system. Unfortunately, since the problem lies in the logging system, I cannot see the error message. The python 'print' command is also not working on a google app engine application, therefore I cannot display any useful information.
The problem is visible even just accessing the website root.
It seems to be an import problem, but beside that, the logging system should work, and it doesn't.
The deployed version of the site is working, which leads me to think about a possible local configuration/system problem.
I am using python 2.7.2 and CURRENT_VERSION_ID=1.1
Here is the very long stacktrace of the bug:
--> --> -->
Traceback (most recent call last):
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2781, in _HandleRequest
self._Dispatch(dispatcher, self.rfile, outfile, env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 2669, in _Dispatch
base_env_dict=env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 692, in Dispatch
base_env_dict=base_env_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1731, in Dispatch
self._module_dict)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1631, in ExecuteCGI
reset_modules = exec_script(config, handler_path, cgi_path, hook)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1319, in ExecuteOrImportScript
exec module_code in script_module.__dict__
File "C:\Program Files\Google\google_appengine\google\appengine\ext\admin\__init__.py", line 79, in <module>
from google.appengine.ext.webapp import _template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\_template.py", line 37, in <module>
from google.appengine.ext.webapp import template
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1858, in load_module
return self.FindAndLoadModule(submodule, fullname, search_path)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1722, in FindAndLoadModule
description)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 676, in Decorate
return func(self, *args, **kwargs)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver_import_hook.py", line 1665, in LoadModuleRestricted
description)
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\template.py", line 61, in <module>
webapp._config_handle.django_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 153, in _django_setup
__django_version_setup()
File "C:\Program Files\Google\google_appengine\google\appengine\ext\webapp\__init__.py", line 99, in __django_version_setup
'http://code.google.com/appengine/docs/python/tools/'
File "C:\Python27\lib\logging\__init__.py", line 1582, in warning
root.warning(msg, *args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1144, in warning
self._log(WARNING, msg, args, **kwargs)
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1250, in _log
self.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 1260, in handle
self.callHandlers(record)
File "C:\Python27\lib\logging\__init__.py", line 1300, in callHandlers
hdlr.handle(record)
File "C:\Python27\lib\logging\__init__.py", line 744, in handle
self.emit(record)
File "C:\Python27\lib\logging\__init__.py", line 870, in emit
self.handleError(record)
File "C:\Python27\lib\logging\__init__.py", line 797, in handleError
None, sys.stderr)
File "C:\Python27\lib\traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
File "C:\Program Files\Google\google_appengine\google\appengine\tools\dev_appserver.py", line 1492, in write
logging.getLogger()._log(logging.ERROR, message, ())
File "C:\Python27\lib\logging\__init__.py", line 1249, in _log
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
File "C:\Python27\lib\logging\__init__.py", line 1223, in makeRecord
rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
File "C:\Python27\lib\logging\__init__.py", line 266, in __init__
self.levelname = getLevelName(level)
File "C:\Python27\lib\logging\__init__.py", line 167, in getLevelName
return _levelNames.get(level, ("Level %s" % level))
RuntimeError: maximum recursion depth exceeded while getting the str of an object
Here is the list of imports of main.py:
from google.appengine.ext import webapp
import fix_path
import sys
import os
import urllib
import urllib2
import pprint
import logging
import cgi
import random
import Cookie
import datetime
import time
import urlparse
import urllib2
import urllib, cStringIO
import hashlib
import copy
from urllib import urlretrieve
from google.appengine.ext import blobstore
from google.appengine.ext.webapp import blobstore_handlers
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.dist import use_library
from google.appengine.api import memcache
from django.utils import simplejson
from gaesessions import get_current_session
from myapp.models import *
from myapp.models import sequence_selection as models_sequence_selection
from myapp.sequence_selection import utils as sequence_selection_utils
from myapp.models import video
from myapp.models.video import *
from myapp.models.song import *
from myapp.models.flashified import *
from myapp.music_recommendation import get_song_recommendations,get_song_recommendations_learning_data,learn_song,learn_song_from_video
from myapp.core import is_number
from myapp import mailing
from myapp import search
from myapp import motif
from myapp import retrieve_instagram
from myapp import coords_distance
from myapp import performancetest
from google.appengine.api import mail
from google.appengine.api import images
Actually, renaming the directory of the application and re-importing trough google app engine launcher with a different port solved my problem, but probably not the bug.
You need to upload the relevant source to get a real answer as #skreft stated.
Although as far as logging, use import logging and then logging.info() to help locate the problem.
I suggest commenting the logging code for now and see what your stack trace reveals. Then if you are not getting an error start adding the logging code back in piece by piece until you find your error.

Categories

Resources