(This message has been automatically imported from the retired mailing list)
Hello, Im Chinese and my English is poor. So I try my best to make it clear to all my problem about the connection to mysql.
We changed the odb to Mysql from sqlite3 recently. But some problems have occurred every day from then on.
Every day in the morning I login in the zato the following exception occurs which is shown on page(part of the error infomation):
Traceback:
File “/opt/zato/2.0.7/eggs/Django-1.3.7-py2.7.egg/django/core/handlers/base.py” in get_response
89. response = middleware_method(request)
File “/opt/zato/2.0.7/zato-web-admin/src/zato/admin/middleware.py” in process_request
97. req.zato.cluster = req.zato.odb.query(Cluster).filter_by(id=req.zato.cluster_id).one()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py” in one
2398. ret = list(self)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py” in iter
2441. return self._execute_and_instances(context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py” in _execute_and_instances
2456. result = conn.execute(querycontext.statement, self._params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py” in execute
841. return meth(self, multiparams, params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/sql/elements.py” in _execute_on_connection
322. return connection._execute_clauseelement(self, multiparams, params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py” in _execute_clauseelement
938. compiled_sql, distilled_params
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py” in _execute_context
1070. context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py” in _handle_dbapi_exception
1271. exc_info
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/util/compat.py” in raise_from_cause
199. reraise(type(exception), exception, tb=exc_tb)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py” in _execute_context
1063. context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/default.py” in do_execute
442. cursor.execute(statement, parameters)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/cursors.py” in execute
132. result = self._query(query)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/cursors.py” in _query
271. conn.query(q)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py” in query
725. self._execute_command(COM_QUERY, sql)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py” in _execute_command
888. self._write_bytes(prelude + sql[:chunk_size-1])
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py” in _write_bytes
848. raise OperationalError(2006, “MySQL server has gone away (%r)” % (e,))
Exception Type: OperationalError at /zato/scheduler/execute/482/cluster/1/
Exception Value: (OperationalError) (2006, "MySQL server has gone away (error(32, 'Broken pipe'))") 'SELECT cluster.id AS cluster_id, cluster.name AS cluster_name, cluster.description AS cluster_description, cluster.odb_type AS cluster_odb_type, cluster.odb_host AS cluster_odb_host, cluster.odb_port AS cluster_odb_port, cluster.odb_user AS cluster_odb_user, cluster.odb_db_name AS cluster_odb_db_name, cluster.odb_schema AS cluster_odb_schema, cluster.broker_host AS cluster_broker_host, cluster.broker_port AS cluster_broker_port, cluster.lb_host AS cluster_lb_host, cluster.lb_port AS cluster_lb_port, cluster.lb_agent_port AS cluster_lb_agent_port, cluster.cw_srv_id AS cluster_cw_srv_id, cluster.cw_srv_keep_alive_dt AS cluster_cw_srv_keep_alive_dt \nFROM cluster \nWHERE cluster.id = %s' ('1',)
And when I hot-deploy the service code, the following exception occur in server.log:
2015-11-25 10:43:38,427 - [1;31mERROR[0m - 25683:Dummy-6416 - zato.server.odb:22 - Could not add service, name:[syncdata.http-service], e:[Traceback (most recent call last):
File “/opt/zato/2.0.7/zato-server/src/zato/server/odb.py”, line 233, in add_service
self._session.commit()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 788, in commit
self.transaction.commit()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 384, in commit
self._prepare_impl()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 364, in _prepare_impl
self.session.flush()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 1985, in flush
self._flush(objects)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 2103, in _flush
transaction.rollback(_capture_exception=True)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/util/langhelpers.py”, line 60, in exit
compat.reraise(exc_type, exc_value, exc_tb)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/session.py”, line 2067, in _flush
flush_context.execute()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/unitofwork.py”, line 372, in execute
rec.execute(self)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/unitofwork.py”, line 526, in execute
uow
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/persistence.py”, line 55, in save_obj
table, states_to_update)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/persistence.py”, line 385, in collect_update_commands
state, state_dict)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/attributes.py”, line 589, in get
value = callable(state, passive)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/state.py”, line 433, in call
self.manager.deferred_scalar_loader(self, toload)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/loading.py”, line 613, in load_scalar_attributes
only_load_props=attribute_names)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/loading.py”, line 235, in load_on_ident
return q.one()
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py”, line 2398, in one
ret = list(self)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py”, line 2441, in iter
return self._execute_and_instances(context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/orm/query.py”, line 2456, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py”, line 841, in execute
return meth(self, multiparams, params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/sql/elements.py”, line 322, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py”, line 938, in _execute_clauseelement
compiled_sql, distilled_params
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py”, line 1070, in _execute_context
context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py”, line 1271, in _handle_dbapi_exception
exc_info
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/util/compat.py”, line 199, in raise_from_cause
reraise(type(exception), exception, tb=exc_tb)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/base.py”, line 1063, in _execute_context
context)
File “/opt/zato/2.0.7/eggs/SQLAlchemy-0.9.9-py2.7-linux-x86_64.egg/sqlalchemy/engine/default.py”, line 442, in do_execute
cursor.execute(statement, parameters)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/cursors.py”, line 132, in execute
result = self._query(query)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/cursors.py”, line 271, in _query
conn.query(q)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py”, line 725, in query
self._execute_command(COM_QUERY, sql)
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py”, line 888, in _execute_command
self._write_bytes(prelude + sql[:chunk_size-1])
File “/opt/zato/2.0.7/eggs/PyMySQL-0.6.2-py2.7.egg/pymysql/connections.py”, line 848, in _write_bytes
raise OperationalError(2006, “MySQL server has gone away (%r)” % (e,))
OperationalError: (OperationalError) (2006, “MySQL server has gone away (error(32, ‘Broken pipe’))”) ‘SELECT cluster.id AS cluster_id, cluster.name AS cluster_name, cluster.description AS cluster_description, cluster.odb_type AS cluster_odb_type, cluster.odb_host AS cluster_odb_host, cluster.odb_port AS cluster_odb_port, cluster.odb_user AS cluster_odb_user, cluster.odb_db_name AS cluster_odb_db_name, cluster.odb_schema AS cluster_odb_schema, cluster.broker_host AS cluster_broker_host, cluster.broker_port AS cluster_broker_port, cluster.lb_host AS cluster_lb_host, cluster.lb_port AS cluster_lb_port, cluster.lb_agent_port AS cluster_lb_agent_port, cluster.cw_srv_id AS cluster_cw_srv_id, cluster.cw_srv_keep_alive_dt AS cluster_cw_srv_keep_alive_dt \nFROM cluster \nWHERE cluster.id = %s’ (1,)
]
2015-11-25 10:43:38,433 - [1;31mERROR[0m - 25683:Dummy-6416 - zato.server.service.store:22 - Exception while visit mod:[<module ‘syncdata’ from ‘/opt/zato/genscript_esb/server2/work/hot-deploy/current/syncdata.py’>], is_internal:[False], fs_location:[/opt/zato/genscript_esb/server2/work/hot-deploy/current/syncdata.py], e:[Traceback (most recent call last):
File “/opt/zato/2.0.7/zato-server/src/zato/server/service/store.py”, line 261, in _visit_module
name, impl_name, is_internal, timestamp, dumps(str(depl_info)), si)
TypeError: ‘NoneType’ object is not iterable
]
I read the http://docs.sqlalchemy.org/en/latest/core/engines.html?highlight=pool_timeout and googled and found that the parameter pool_recycle matters, so I set the parameter in server.conf upon odb:
[odb]
extra=pool_recycle=600
but the problems still exists, Im very puzzled. How should I do to solve the problem?
Thank you all very much.
wangxi
=====================================================================
GenScript -