Ghost - Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
Asked Answered
O

4

6

I have been trying for a long time to debug my ghost blog as you can see here.

I have made some progress the problem seems to be related to an error on the bootstrap socket of ghost.

My config.production.json in my Digital Ocean server is:

{
  "url": "https://www.mifitnessfacil.com",
  "server": {
    "port": 2369,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "password": "foobar",
      "database": "foobar"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  },
  "bootstrap-socket": {
    "port": 8000,
    "host": "localhost"
  }
}

When running ghost run I get:

[2019-10-03 14:24:00] INFO Ghost is running in production...
[2019-10-03 14:24:00] INFO Your site is now available on https://www.mifitnessfacil.com/
[2019-10-03 14:24:01] INFO Ctrl+C to shut down
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 0
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 1
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] WARN Tries: 2
[2019-10-03 14:24:01] WARN Retrying...
[2019-10-03 14:24:01] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2019-10-03 14:24:01] INFO Ghost boot 3.299s

Update

  • Its running on Ubuntu 18.04.3 LTS
  • Node version 10.16.3
  • Npm version 6.9.0

Answer

Here: https://mcmap.net/q/1735157/-ghost-can-39-t-connect-to-the-bootstrap-socket-localhost-8000-econnrefused

Odaodab answered 3/10, 2019 at 14:25 Comment(2)
@CommonSenceCode What version of Node are you using? If you are using an older version of Node, update, then ghost update --forceHessney
@Hessney thanks for trying I update from node 8 to latest stable node 10.16.3 and I still get the same bug Can't connect to the bootstrap socket (localhost 8000)Odaodab
O
4

Update

removing bootstrap-socket from the config.production.json solved that issue yet I still get 502 Bad Gateway nginx/1.14.0 (Ubuntu)when visiting my website.

Update 2 and solution:

https://github.com/TryGhost/Ghost-CLI/issues/1017

Odaodab answered 7/10, 2019 at 17:21 Comment(1)
Were there any issues removing bootstrap-socket?Inattentive
F
1

Remove bootstrap-socket from your config.production.json and restart, most probably port 8000 is already inuse or bootstap is unable to make a connection there. In essence reflect this in your config.production.json:

{
  "url": "https://www.mifitnessfacil.com",
  "server": {
    "port": 2369,
    "host": "127.0.0.1"
  },
  "database": {
    "client": "mysql",
    "connection": {
      "host": "localhost",
      "user": "root",
      "password": "foobar",
      "database": "foobar"
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/www/ghost/content"
  }
}

Hope this Helps!

Fao answered 8/10, 2019 at 11:47 Comment(1)
Worked for me! Do I need the bootstrap socket for anything though? A bit worried to have removed it...Inattentive
K
1

this is my first "Answer" here. I ran into this problem during a new install, and had nothing to loose. To fix the error I purged both the Mysql-server and Node.js (apt purge, as root) with wildcard * at the end of mysql. I also removed all associated folders for Mysql in /etc and /usr/share. As for associated folders for Nodejs, I just removed the ones from /etc.

I also uninstalled Ghost. Made a new site directory and re-installed Node.js, Mysql, & Ghost. I let Ghost take care of the SSL. I chose to just start Ghost at the conclusion of setup vs run (debug). And it was working!

I think I caused this problem by installing Certbot which configured SSL certs. Then when I installed Ghost, acme.sh was also installed. I think the double SSL solutions affected more then the obvious.

The solution I randomly got from Google worked. Search "uninstall or completely remove mysql ubuntu 16.04" (even though I'm running 20.04) Instructions from linuxscriptshub I think putting the wildcard symbol helped a lot.

As for removing all the directories, that was my idea because it seemed to make sense to remove all config and support files.

Katharinekatharsis answered 14/12, 2021 at 9:13 Comment(1)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewVampire
S
0

Please run

sudo netstat -lnp | grep 8000

and see if port 8000 is already in use. If it is then change the port on ghost config or disable the process that is using the port.

Sponge answered 6/10, 2019 at 5:41 Comment(1)
That command isn't printing anything. Anyways I tried I sudo ps aux | grep 8000and get ghost-m+ 32461 0.0 0.1 14856 1148 pts/0whenn I try killing it: sudo kill -9 32461 I get "No such process"Odaodab

© 2022 - 2024 — McMap. All rights reserved.