GHOST_DATABASE_CONNECTION_PASSWORD cannot be only Numeric
Issue Summary
Docker .env File GHOST_DATABASE_CONNECTION_PASSWORD cannot be only Numeric. Mysql accept it and Login is possible, but Ghost don't.
Steps to Reproduce
set the ghost database connection password to 123456
Ghost Version
5.72.2
Node.js Version
18.18.2
How did you install Ghost?
Docker Image
Database type
MySQL 8
Browser & OS version
No response
Relevant log / error output
[2023-11-13 16:57:30] WARN Ghost is shutting down
[2023-11-13 16:57:30] WARN Ghost has shut down
[2023-11-13 16:57:30] WARN Your site is now offline
[2023-11-13 16:57:30] WARN Ghost was running for a few seconds
[2023-11-13 16:57:34] INFO Ghost is running in production...
[2023-11-13 16:57:34] INFO Your site is now available on https://example.com/
[2023-11-13 16:57:34] INFO Ctrl+C to shut down
[2023-11-13 16:57:34] INFO Ghost server started in 2.405s
[2023-11-13 16:57:35] ERROR The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received ty
pe number (123456)
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type number (123456)
"Unknown database error"
Error ID:
500
Error Code:
ERR_INVALID_ARG_TYPE
----------------------------------------
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Recei
ved type number (8066)
at /var/lib/ghost/versions/5.72.2/node_modules/knex-migrator/lib/database.js:57:19
at new NodeError (node:internal/errors:405:5)
at Hash.update (node:internal/crypto/hash:107:11)
at sha1 (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/auth_41.js:31:8)
at Object.token [as calculateToken] (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/auth_41.js:57:18)
at new HandshakeResponse (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/packets/handshake_response.js:28:26)
at ClientHandshake.sendCredentials (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/commands/client_handshake.js:71:31)
at ClientHandshake.handshakeInit (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/commands/client_handshake.js:162:12)
at ClientHandshake.execute (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/commands/command.js:45:22)
at Connection.handlePacket (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/connection.js:478:34)
at PacketParser.onPacket (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/var/lib/ghost/versions/5.72.2/node_modules/mysql2/lib/connection.js:104:25)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:335:12)
at readableAddChunk (node:internal/streams/readable:308:9)
at Readable.push (node:internal/streams/readable:245:10)
Code of Conduct
- [X] I agree to be friendly and polite to people in this repository
This is the same as https://github.com/TryGhost/Ghost/issues/16918, but unfortunately the issue went stale without a PR. A PR would still be welcome 🙂
I tried reproduce the error in ghost local installation. But can't reproduce the error. The mysql connects fine. here is my database section of the config.development.json file:
"database": {
"client": "mysql",
"connection": {
"host": "127.0.0.1",
"port": 3306,
"user": "root",
"password": "123456",
"database": "ghost"
}
Another related question, how do I config db connection if I build ghost from source? @daniellockyer any tips on reproducing the error?
@alst-ovh Stupid question: Why would you choose a numeric password instead of an alphanumeric one?
Our bot has automatically marked this issue as stale because there has not been any activity here in some time.
The issue will be closed soon if there are no further updates, however we ask that you do not post comments to keep the issue open if you are not actively working on a PR.
We keep the issue list minimal so we can keep focus on the most pressing issues. Closed issues can always be reopened if a new contributor is found. Thank you for understanding 🙂