Using Dockers for Ghost and the log for the Ghost docker shows this error on startup:
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
I also use Ghost with Docker and I have the same warning multiple times in my logs.
[2022-05-11 20:32:38] INFO "GET /assets/images/manifest/manifest-icon-144.png" 200 9ms
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
[2022-05-11 20:33:21] INFO "GET /" 200 179ms
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
[2022-05-11 20:34:21] INFO "GET /" 200 246ms
I’ currently using Ghost v4.44.0. Here is an excerpt of my docker-compose.yml file:
What’s in your config.production.json file? It sounds like you have some config in there that isn’t being overridden with your environment variables so the mysql2 client lib is seeing unexpected config options.
I know the config file in my situation didn’t match up with the settings I was installing on the backend of my docker. I use a visual docker installation interface via unraid. Whenever I made changes on Unraid, it seemed to pass those changes through to the docker, so I figured it was fine.
Just to prove you and myself wrong (I thought), I decided to manually enter in the correct database information for the config file using nano. Knowing full and well it wasn’t supposed to work.
I don’t know when the warning is sent to the console, but Ghost currently has code to ensure that the connection file name is not set when using MySQL. Here is an excerpt of the sanitizeDatabaseProperties function, from the core/shared/config/utils.js file:
Ignoring invalid configuration option passed to Connection: filename. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
I am using environment variables for the configuration of the MySQL database, and this still clearly works (the site is up).
Also, it looks like ghost-cli cannot unset a parameter in config.production.json, only set a value. So short of using jq to remove the offending key, I think I am stuck with the warning.