website
website copied to clipboard
custom_dc: Lost connection to MySQL server during query
Created MySQL in GCP as described in https://github.com/datacommonsorg/website/tree/master/custom_dc#setup-google-cloud-sql Also, specified the flags
net_read_timeout 300 net_write_timeout 300 wait_timeout 120 connect_timeout 300 interactive_timeout 300 max_connections 1000
Datacommons is able to connect but I am getting the error when I try to load the sample data - 'Lost connection to MySQL server during query'
I0313 12:24:40.040244 140711787871104 filehandler.py:118] Using GCS project: myproject
Using GCS project: myproject
I0313 12:24:40.870187 140711787871104 runner.py:108] Using Cloud SQL settings from env.
Using Cloud SQL settings from env.
I0313 12:24:40.873133 140711787871104 db.py:317] Connecting to Cloud MySQL: myproject:us-central1:dc-graph (datacommons)
Connecting to Cloud MySQL: myproject:us-central1:dc-graph (datacommons)
Traceback (most recent call last):
File "
Hi @bkosuru - can you tell us a bit more about your import and how long after you initiate the load process do you see this error?
Note that when loading data, we open a single connection to insert data into the database. With that in mind, a couple of things to try:
- try loading a smaller dataset first
- assuming that succeeds, bump up the
wait_timeoutand try with a larger dataset.
Hi @keyurva, I am only trying to load the sample data provided for custom_dc. It is a very small dataset. The error happens right away within a second. Do I need to set any other flags or change current settings? Thanks!
Actually, looking at the logs closely, it seems like it was never able to connect to the database. Can you ensure your connection parameters are correct?
Sometimes it connects and it created 2 tables - triples and observations.
I0311 16:47:51.725041 139931865762688 db.py:317] Connecting to Cloud MySQL: myproject:us-central1:dc-graph (datacommons) Connecting to Cloud MySQL: myproject:us-central1:dc-graph (datacommons) I0311 16:47:52.873222 139931865762688 db.py:321] Connected to Cloud MySQL: myproject:us-central1:dc-graph (datacommons) Connected to Cloud MySQL: myproject:us-central1:dc-graph (datacommons)
It seems to be a DB connectivity issue. Based on a quick search for the error ("Lost connection to MySQL server during query"), you may need to tweak certain timeouts.