5.44.0 Could Not Communicate with ghost

I tried to change my site’s domain, and now ghost won’t start with a “Could not communicate with ghost” error.

here is the full log

Debug Information:
    OS: Ubuntu, v20.04.4 LTS
    Node Version: v18.16.0
    Ghost Version: 5.44.0
    Ghost-CLI Version: 1.24.0
    Environment: production
    Command: 'ghost start'
Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_pearcemichal-com -n 50
Stack: Error: Could not communicate with Ghost
    at Server.<anonymous> (/usr/lib/node_modules/ghost-cli/lib/utils/port-polling.js:91:20)
    at Object.onceWrapper (node:events:627:28)
    at Server.emit (node:events:513:28)
    at emitCloseNT (node:net:2135:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

Also, when I try and do “ghost run”, there are a bunch of warning with the message

Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED.

ghost doctor reports no issues, and sudo nginx -t reports that the config is fine.

I tried messing around with different node version, but so far nothing has worked.

I also checked the other similar topics, and none of them were able to give me any useful info.

here is my config file

{
  "url": "https://pearcesjournal.com",
  "server": {
    "port": 2368,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "password": "GHOSTDBPASSWORD",
      "database": "ghost_prod"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/pearcemichal/html/content"
  },
  "imageOptimization": {
    "resize": false,
    "srcsets": false
  },
  "bootstrap-socket": {
    "port": 8000,
    "host": "localhost"
  }
}

And the NGINX config, which was generated using ghost config nginx

server {
    listen 80;
    listen [::]:80;

    server_name pearcesjournal.com;
    root /var/www/pearcemichal/html/system/nginx-root; # Used for acme.sh SSL verification (https://acme.sh)

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;
        proxy_pass http://127.0.0.1:2368;
        
    }

    location ~ /.well-known {
        allow all;
    }

    client_max_body_size 50m;
}

let me know if there is any other info I need to supply.

It seems that the problem is from

  "bootstrap-socket": {
    "port": 8000,
    "host": "localhost"
  }

Try removing it and see what happens
Here seems like a similar issue

removing the bootstrap socket does not solve the issue

EDIT: also, if I remove the section, save the config, and try and start ghost, after sitting for awhile and failing to start, the bootstrap section has reappeared in the config.

I have made some progress

I re-setup certbot so the site has SSL, and now when I try to run the site, I get a different error, and it fails immediately, instead of stalling for ages.

new message:

Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database error

log output

Debug Information:
    OS: Ubuntu, v20.04.4 LTS
    Node Version: v18.16.0
    Ghost Version: 5.44.0
    Ghost-CLI Version: 1.24.0
    Environment: production
    Command: 'ghost setup'
Message: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
Help: Unknown database error
Suggestion: journalctl -u ghost_pearcemichal-com -n 50
Stack: Error: Ghost was able to start, but errored during boot with: connect ECONNREFUSED ::1:3306
    at Server.<anonymous> (/usr/local/lib/node_modules/ghost-cli/lib/utils/port-polling.js:73:28)
    at Object.onceWrapper (node:events:627:28)
    at Server.emit (node:events:513:28)
    at emitCloseNT (node:net:2135:8)
    at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

also, when I try to run sudo mysql I get an error

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

though I don’t know if this is relevant.

EDIT:

I tried what was suggested here, but it did not resolve the issue

Dead thread, but would love to hear how you fixed this. Facing the same issue, but I didn’t change my domain, it’s a new install

Kaushik, I don’t think the error you posted on the other thread is the same as this one. This one looked like a database error.

1 Like

Ultimately I just reinstalled ghost + all dependencies from scratch.