Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql Db connection error #1085

Closed
sanjoshi opened this issue Sep 9, 2016 · 7 comments
Closed

Mysql Db connection error #1085

sanjoshi opened this issue Sep 9, 2016 · 7 comments

Comments

@sanjoshi
Copy link

sanjoshi commented Sep 9, 2016

Hi,

I am trying to connect to Mysql database from caravel. But I keep getting these errors intermittently.

  1. SIGPIPE: writing to a closed pipe/socket/fd (probably the client disconnected) !!!
  2. OperationalError: (_mysql_exceptions.OperationalError) (2006, 'MySQL server has gone away')
  3. 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.

@nickrox
Copy link

nickrox commented Sep 9, 2016

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.

@xrmx xrmx added the question label Sep 9, 2016
@sanjoshi
Copy link
Author

sanjoshi commented Sep 9, 2016

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'.

@mistercrunch
Copy link
Member

mistercrunch commented Sep 12, 2016

it's handled by the flask-sqlalchemy package

@sanjoshi
Copy link
Author

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

@sanjoshi
Copy link
Author

Hi..
Also please let me know what is this being used for?
CARAVEL_WEBSERVER_TIMEOUT

Is this why we could be facing these issues?

@xrmx
Copy link
Contributor

xrmx commented Sep 17, 2016

@sanjoshi maybe that's the same mysql config issue as #457

@bkyryliuk
Copy link
Member

@sanjoshi - feel free to reopen if the issue is not resolved.
Tweaking the max_allowed_packet in mysql config helped in the #457

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants