Ghost CMS Docker Error Code -97

Hi together,

I try to start my Ghost CMS in a docker. This is my docker-compose.yml

services:

ghost-cms:

image: ghost:5-alpine
restart: always
depends_on:
  - ghost-db
healthcheck:
  test: [ "CMD-SHELL", "nc -z localhost 2368 || exit 1" ]
  interval: 10s
  timeout: 5s
  retries: 10
ports:
  - 2368:2368
environment:
  database__client: mysql
  database__connection__host: ghost-db
  database__connection__user: ghost
  database__connection__password: ghostdbpass
  database__connection__database: ghostdb
volumes:
  - ./dockers/cms/content:/var/lib/ghost/content

ghost-db:

image: mysql:8.0
restart: always
healthcheck:
  test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
  interval: 10s
  timeout: 5s
  retries: 5
environment:
  MYSQL_ROOT_PASSWORD: test
  MYSQL_USER: ghost
  MYSQL_PASSWORD: ghostdbpass
  MYSQL_DATABASE: ghostdb
volumes:
  - ./dockers/cms/mysql:/var/lib/mysql

The database is up, but the ghost-cms shows the following logs and I don’t find any infos about that Code.

[2025-01-10 14:43:32] WARN Ghost is shutting down
[2025-01-10 14:43:32] WARN Ghost has shut down
[2025-01-10 14:43:32] WARN Your site is now offline
[2025-01-10 14:43:32] WARN Ghost was running for a few seconds
[2025-01-10 14:44:32] ERROR (Code: -97)

(Code: -97)

“There was an error starting your server.”
“Please use the error code above to search for a solution.”

Error ID:
6793c6d0-cf61-11ef-b518-1b7f5ba98042


InternalServerError: (Code: -97)
at Server. (/var/lib/ghost/versions/5.105.0/core/server/GhostServer.js:96:34)
at Server.emit (node:events:517:28)
at emitErrorNT (node:net:1844:8)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

I just found out, when I try to run the command from the hub.docker.com page:

docker run -d --name some-ghost -e NODE_ENV=development ghost:latest

I receive the same error, so it should be a local problem (on a remote server it works). But I don’t know what it can be…
Any Ideas?

I think the log you posted is maybe the end of a set of errors - can you grab the earlier errors, from when Ghost tried to start? There may be something there.

I have now spent the whole day looking for a solution to the problem. I had problems with my ipv6 the last days, so in my /etc/default/grub I had the entry

GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1 quiet splash”

After I changed this back to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash”

and performed an update-grub, the Ghost CMS Docker runs again as usual. Absolutely crazy.

If anyone has the same problem, maybe this will help :)

Thank you very much!

1 Like

Ahha! Glad you fixed it. ‘localhost’ uses ipv6 by default in some setups… I’d guess you had something listening on ipv6 and something not able to use it…