-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
ECONNRESET when connecting to Azure MySQL for Database #14990
Comments
I'm running into the exact same issue and was about to open a ticket when I found this one. The bit that crashes is under async function initDatabase({config}) {
const DatabaseStateManager = require('./server/data/db/state-manager');
const dbStateManager = new DatabaseStateManager({knexMigratorFilePath: config.get('paths:appRoot')});
await dbStateManager.makeReady();
const databaseInfo = require('./server/data/db/info');
await databaseInfo.init();
} In my case it is crashing at |
This issue is related to the new library (mysql2) used into Ghost since the version 4.38 to communicate with mysql. #14258. The latest version (2.3.3) of the library mysql2 still have an issue with Azure Database Single Server. As workaround you can modify the file sed -i "s/err.errno === 'ECONNRESET'/err.code === 'ECONNRESET'/g" /var/lib/ghost/current/node_modules/mysql2/lib/connection.js |
@devnied Thanks for the reference - I've pinged on that PR to see if we can get it released 🙂 |
I just upgraded to 5.2.4 and still getting connection errors. It's interesting because the knex-migrator actually connects and upgrades, but also sends an error at the end of the process. As you can see in the image, Ghost launches, but several ECONNRESET show up when the site is trying to load. I'm not using AKS however, but an (Windows-based) App Service and MysQL 8. |
I've pinged upstream again to see if we can get this resolved. |
Thanks, @ErisDS. Happy to test out whatever we can. I tried debugging Knex and even mysql2 but it's becoming very complex. That said, I'm happy to guinea pig theories. |
Running into same issue, in our case ghost is hosted in a VM and db is Azure MySQL for Database. |
I'm going to temporarily lock this thread. The issue is a bug in the mysql2 package which is fixed but hasn't been released. There's nothing we can do until mysql2 do a release - so adding comments here achieves nothing other than filling our inboxes with things we can't action. If you want more information, it's the mysql2 team you need to speak to. Ghost's renovate configuration means that as soon as the release happens, we'll know about it. At that point we will update, and then unlock and close this issue as completed. |
Hi all! 👋🏻 With thanks to upstream, the issue in |
Issue Summary
Hello there,
we have been using ghost version 4.37-alpine deployed in an AKS (Azure Kubernetes Service) in our Azure's Environment for a while now. Ghost itself connects to an Azure MySQL Database version 8 and everything is fine and has been running for a while now (more than an year).
We would like to migrate to Ghost version 5 but we are facing a major issue, which seems to be related to knex-migrator (so, hierarchically speaking to knex and mysql2, but we don't know who's at fault here :D). Basically, it seems like knex is actually able to connect to the database, but when releasing the connection it throws an exception, hence everything fails.
We tried all the solutions provided in different topics (setting the pool_min to 0, increasing all the timeouts in the MySQL settings, ..) but nothing seems to work.
Here is an excerpt of what we're doing:
Steps to Reproduce
utf8mb4
and collationutf8mb4_0900_ai_ci
Ghost Version
5.2.3
Node.js Version
16.15.1
How did you install Ghost?
Kubernetes, Docker
Database type
MySQL 8
Browser & OS version
No response
Relevant log / error output
Code of Conduct
The text was updated successfully, but these errors were encountered: