superset icon indicating copy to clipboard operation
superset copied to clipboard

Mysql Db connection error

Open sanjoshi opened this issue 10 years ago • 7 comments

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.

sanjoshi avatar Sep 09 '16 05:09 sanjoshi

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.

nickrox avatar Sep 09 '16 06:09 nickrox

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

sanjoshi avatar Sep 09 '16 18:09 sanjoshi

it's handled by the flask-sqlalchemy package

mistercrunch avatar Sep 12 '16 15:09 mistercrunch

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 avatar Sep 12 '16 17:09 sanjoshi

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 avatar Sep 12 '16 17:09 sanjoshi

@sanjoshi maybe that's the same mysql config issue as https://github.com/airbnb/caravel/issues/457

xrmx avatar Sep 17 '16 15:09 xrmx

@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

bkyryliuk avatar Sep 30 '16 18:09 bkyryliuk