Basically the issue is that you’re passing a disk at /var/lib/ghost which will not be writable by the container. This then causes LXC to fail as the container asked it to create /var/lib/ghost/content and put a tmpfs on that.
If you put shift=true in your disk device, that should all start working fine.
The database starts fine. Assuming that the ghost container will talk to the ghost-db container via the incus.ghost-db DNS name we discussed.
Problem is that after working many different iterations of this over the last 12 hours, I am routinely getting the following error when I try to start the ghost container. I am feeling like something in the data structure isn’t working and the error has nothing to do with it.
incus start ghost --console
To detach from the console, press: <ctrl>+a q
[2024-07-27 05:56:40] INFO Ghost is running in production...
[2024-07-27 05:56:40] INFO Your site is now available on http://localhost:2368/
[2024-07-27 05:56:40] INFO Ctrl+C to shut down
[2024-07-27 05:56:40] INFO Ghost server started in 1.782s
[2024-07-27 05:56:40] ERROR The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received an instance of Object
"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. Received an instance of Object
at /var/lib/ghost/versions/5.75.3/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.75.3/node_modules/mysql2/lib/auth_41.js:31:8)
at Object.token [as calculateToken] (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/auth_41.js:57:18)
at new HandshakeResponse (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/packets/handshake_response.js:28:26)
at ClientHandshake.sendCredentials (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/commands/client_handshake.js:71:31)
at ClientHandshake.handshakeInit (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/commands/client_handshake.js:162:12)
at ClientHandshake.execute (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/commands/command.js:45:22)
at Connection.handlePacket (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/connection.js:478:34)
at PacketParser.onPacket (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/connection.js:97:12)
at PacketParser.executeStart (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/packet_parser.js:75:16)
at Socket.<anonymous> (/var/lib/ghost/versions/5.75.3/node_modules/mysql2/lib/connection.js:104:25)
at Socket.emit (node:events:517:28)
at addChunk (node:internal/streams/readable:368:12)
at readableAddChunk (node:internal/streams/readable:341:9)
at Readable.push (node:internal/streams/readable:278:10)
[2024-07-27 05:56:40] WARN Ghost is shutting down
[2024-07-27 05:56:40] WARN Ghost has shut down
[2024-07-27 05:56:40] WARN Your site is now offline
[2024-07-27 05:56:40] WARN Ghost was running for a few seconds
Error: stat /proc/-1: no such file or directory
It is worthwhile to point out that I tried six different database containers/versions feeling like the error had to do with the interface between the container and the database. The “data” argument must be type string makes no sense. I ended up making everything a string as you can see and it made no difference. This does work in a docker compose file. So, something is not quite right in the OCI incus world I fear.
Thanks for going deep into the issue. The error is quite specific (helpful), it’s about an argument that is of the wrong type and it mentions where it can be found. It requires a bit more digging to figure out what went wrong and how to fix.
Yes, notably the error is specific, but is also bogus by its description. Something upstream is causing issues. I’ve been testing a variety of different containers as type OCI and the errors are sometimes pretty obscure.