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
ERROR: failed to prepare the MySQL query: MySQL server has gone away #112
Comments
Can you please share your test case? |
Need a test case to investigate this issue further... |
I think I have the same issue. Using PostgreSQL and MariaDB via docker. This is my Postgres-Dockerfile
I run both containers, and link the MariaDB container to postgres. create Database, connect to that, create extension, server, user mapping, foreign table, everything according to guide.
As described by hvisage, issueing the query a second time 'solves' it, as the connection seems established then. |
This may be due to networking equipments killing connections idling for too long. Implementing a TCP keepalive every N seconds may solve the problem. |
having trouble with this. BTW, is this repo still under maintenance? |
@chanmix51 Can users do this? Or only developers of this repo can implement? |
I appeared this was the consequence of pooling Postgres connections on different servers. As soon as we stopped distributing the connections, it was stable. |
Are you still having trouble with this? Yes this repository is mainted by EnterpriseDB. We provided a release in August 2017 that provided PG 10 support and fixed a number of issues. |
@ahsanhadi I did have this error and it disappeared like other people have said after sending a second query. But I worried that this will happen again. Here are versions of database and fdw for your infomation: System: Ubuntu 16.03 LTS |
@ahsanhadi Just a wish: it will help us if the README of this repo will be updated. At least we know how is the package updated, and what features we can expect. |
Sorry, the initial request for information slipped through my email filters ;( From my perspective close, but it is still something that I think the mysql_fdw doesn't handle correctly, or have to be provided with sometime out settings to check the conenction states etc. |
HI There,
I have this issue that the first connection in a session, appears to be having this problem error thrown.
If I repeat the exact same procedure call, with the same values, the connection goes through and then just "works"(TM).
Any information how to debug this issue?
How should I (inside a stored procedure/function) do a check to see if I needed to retry the select query?
or perhaps: How should I check that the server hasn't really "gone away" and have just closed the connection?
Both the MySQL 5.7 & PostgreSQL 9.5 are on the same Debian 8.x VM instance. The stored procedure that fails, are called from a Python Flask microservice framework application, that was actually called from the MySQL I'm connecting back to (using the http UDF on MySQL), so the server is actually always "up" when receiving this stored procedure call, just the connection might be "down", so perhaps needed a method to check/test whether the connection is up or needed reconnecting is needed to be called by my stored procedure?
The text was updated successfully, but these errors were encountered: