Mysql Db connection error
Hi,
I am trying to connect to Mysql database from caravel. But I keep getting these errors intermittently.
- SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) !!!
- OperationalError: (_mysql_exceptions.OperationalError) (2006, 'MySQL server has gone away')
- ERROR:sqlalchemy.pool.QueuePool:Exception during reset or similar
Is there a way to handle these issues?
This is the configuration that I am using for SQLAlchemy SQLALCHEMY_POOL_SIZE = 10 SQLALCHEMY_POOL_TIMEOUT = 10 SQLALCHEMY_POOL_RECYCLE = 100 SQLALCHEMY_DATABASE_URI = 'mysql+mysqldb://user:pwd@host:port/db'
Please help. Thanks in advance.
I think this issue is on the mysql side. Possible causes are mentioned in the documentation http://dev.mysql.com/doc/refman/5.7/en/gone-away.html Please see if it helps.
How/Where does caravel try to make the mysql db connection? I am unable to find where it tries to make the connection. I can see the db.session but not 'connect'.
it's handled by the flask-sqlalchemy package
Hi @mistercrunch How can I handle it? I have tried different configurations but it is still not working. The mysql db timeout is 600s. So I have given my SQLALCHEMY_POOL_RECYCLE = 100.
Is there a better way to handle it?
Thanks
Hi.. Also please let me know what is this being used for? CARAVEL_WEBSERVER_TIMEOUT
Is this why we could be facing these issues?
@sanjoshi maybe that's the same mysql config issue as https://github.com/airbnb/caravel/issues/457
@sanjoshi - feel free to reopen if the issue is not resolved.
Tweaking the max_allowed_packet in mysql config helped in the https://github.com/airbnb/caravel/issues/457