Can't reconnect to wordpress database
Had some issues with an older instance of a wordpress database reaching capacity while on the hobby plan. Not realizing that it reached capacity, I moved some things around, restarted, redeployed and finally upgraded to the pro plan.
But now, I can't get my wordpress instance to reconnect to the database. I've set things up similar to a fresh install of wordpress/mysql but still getting connection errors.
I've double checked the variables and they're all matching. At first, it was trying to connect to an older TCP value but I did see in the logs that it re-wrote itself to the new values.
How do I ensure things are written correctly? I feel like there's just one thing off that's preventing the connection
9d60a091-d9f3-4e10-9601-04a78f34a7a7
39 Replies
Project ID:
9d60a091-d9f3-4e10-9601-04a78f34a7a7
Project ID:
9d60a091-d9f3-4e10-9601-04a78f34a7a7
the best way to make sure you have all the variables set correctly is to use reference variables https://docs.railway.app/guides/variables#referencing-another-services-variable
Thanks @Brody I’ve double checked those but still no luck.
I’ll try copy and paste directly in the AM
you dont want to copy/paste, thats where the errors come from (yes really)
lol it's setup for those variables and I've double checked those values so I'm at a bit of a loss here
whats the exact error you get?
can you connect to the database from your computer?
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at roundhouse.proxy.rlwy.net:52618 could not be established. This could mean your host’s database server is down.
Are you sure you have the correct username and password?
Are you sure you have typed the correct hostname?
Are you sure the database server is running?
If you are unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress support forums.
I've tried from computer using dbgate and test connection fails
can you try to remove and re-add the proxy on the database?
yep, doing that now and redeploying the wp instance
the port will change, so make sure to grab the updated url for the local test with dbgate
Connect failed: Connection lost: The server closed the connection. Show detail
Error: Connection lost: The server closed the connection.
at Socket.<anonymous> (C:\Users\masha\AppData\Local\Programs\dbgate\resources\app.asar\packages\plugins\dbgate-plugin-mysql\dist\backend.js:11:91460)
at Socket.emit (node:events:390:28)
at TCP.<anonymous> (node:net:687:12)
Error JSON: {
"fatal": true,
"code": "PROTOCOL_CONNECTION_LOST"
}
Connection: {
"server": "",
"engine": "mysql@dbgate-plugin-mysql",
"sshMode": "userPassword",
"sshKeyfile": "",
"port": "55851",
"user": "",
"password": ""
}
Platform: win32
you are using the new port after you refreshed the proxy?
yessir
anything bad in the database logs?
roundhouse.proxy.rlwy.net:55851
:15213
tried both numbers
both numbers?
screenshot of the proxy config please
from db logs: 2024-01-12 08:20:17+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 8.2.0-1.el8 started.
'/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
2024-01-12T08:20:17.665179Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-01-12T08:20:17.897118Z 0 [Warning] [MY-011068] [Server] The syntax '--skip-host-cache' is deprecated and will be removed in a future release. Please use SET GLOBAL host_cache_size=0 instead.
2024-01-12T08:20:17.899234Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.2.0) starting as process 7
2024-01-12T08:20:17.908853Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-01-12T08:20:18.062031Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2024-01-12T08:20:18.276324Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-01-12T08:20:18.276360Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-01-12T08:20:18.279662Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2024-01-12T08:20:18.304929Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-01-12T08:20:18.305044Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.2.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
mysql doesnt listen on
15213
, it listens on 3306
Error: connect ETIMEDOUT
at A._handleTimeoutError (C:\Users\masha\AppData\Local\Programs\dbgate\resources\app.asar\packages\plugins\dbgate-plugin-mysql\dist\backend.js:11:92918)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
Error JSON: {
"errorno": "ETIMEDOUT",
"code": "ETIMEDOUT",
"syscall": "connect",
"fatal": true
}
Connection: {
"server": "",
"engine": "mysql@dbgate-plugin-mysql",
"sshMode": "userPassword",
"sshKeyfile": "",
"port": "3306",
"user": "",
"password": "",
"unsaved": true,
"_id": "***"
}
Platform: win32
have you fixed your proxy config?
and you've since tested again with dbgate?
yep, same issue
anything bad in the databases logs?
I'm not seeing anything in the logs after deployment
4-01-12T08:20:18.276324Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-01-12T08:20:18.276360Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-01-12T08:20:18.279662Z 0 [Warning] [MY-011810] [Server] Insecure configuration for --pid-file: Location '/var/run/mysqld' in the path is accessible to all OS users. Consider choosing a different directory.
2024-01-12T08:20:18.304929Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2024-01-12T08:20:18.305044Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.2.0' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server - GPL.
wait why do those logs say that mysql is listening on
33060
?? that's super odd, set your proxy to that and try dbgate again
or that's just the plugin thing, nevermindnewb question: if I redeploy the db from a month ago, do I lose all data in the db between then and now or does it only affect the settings
well the data is stored in the volume, and a redeploy doesn't touch the volume, so no you wouldn't lose the data
thanks for explaining, worth a shot then?
I think just a simple redeploy of the most recent deployment would have the same effect, if any
gotcha, based on the redeploy I just did, no affect.
Thanks for the quick responses, I'll have to revisit another time, I gotta log off. I'm more or less just trying to get it back up and running so I can do a wordpress export for my client. If any alternatives including somehow migrating the db, I'm all ears in the AM
will tag the team because this doesn't seem like an issue with anything you did
thank you
Thread has been flagged to Railway team by @Brody.
This is likely related to the #🚨|incidents we called. The most recent updates will always be on our status page.
After a fix we are back. Can you confrim @DailyAutomations ?
@thomas I was able to connect to the database to pull the information I needed (workflows from a table in this case) but still can't get it to reconnect to wordpress. Not a huge issue right now as would be less work to redploy a new instance and import what I pulled previously.
I will say it's the first time I'm seeing data tables in the "data" tab and that's pretty sweet!