CommonSenseCode
CommonSenseCode

Reputation: 25359

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

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

Answer

Here: https://stackoverflow.com/a/58274370/4031815

Upvotes: 6

Views: 2844

Answers (4)

Ken
Ken

Reputation: 11

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.

Upvotes: 1

Abdeen
Abdeen

Reputation: 932

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!

Upvotes: 1

CommonSenseCode
CommonSenseCode

Reputation: 25359

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

Upvotes: 4

Rohith Balaji
Rohith Balaji

Reputation: 860

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.

Upvotes: 0

Related Questions