Upgrading to 2.0 Error - Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED


#22

Yeah the blog log shows that your instance wasn’t even restarted.


#23

Anything I can do to get it running? ghost run works, but obviously not a solution.


#24

If you run ghost stop on your folder, can you serve your blog still?


#25

Here are the steps I took:

  1. Execute ghost run
  2. Execute ghost stop (in another command line)
  3. Verify the blog is running.

Yes, the blog is still running. The ghost stop command returned

Ghost is already stopped! Nothing to do here.


#26

Do you have a second installation on your server?


#27

I am not aware of a second ghost installation.

I started with a Digital Ocean Ghost droplet. I have updated the OS, the node version, and the ghost-cli/ghost blog. All overwrote the previous installs.


#28

ps aux | grep node has shown two processes in your screenshot. Did you kill both?


#29

This is what ps aux | grep node returns:

bedawson-Ghost:/var/www/ghost$ ps aux | grep node
twosents 6332 0.0 0.1 14216 1032 pts/0 S+ 19:11 0:00 grep --color=auto node


#30

Okay that shows no instance is running. ghost start still does not finish?

Do you remember the steps you have taken when you have setup your container?


#31

Correct. ghost start still does not complete.

Initially this was a “one-click install” of Ghost (on Ubuntu 14.04.) Over the last few years, I have upgraded Ubuntu to 16.04 and made minor updates to Ghost.

During my attempted upgrade(s) to Ghost 2.0, which necessitated “Fix root user”, I made changes to the permissions on the Ghost directories and created a .ghost directory for my non-root user.


#32

Hello,

I am having the same issue after upgrading from Ghost 1.x.
Found anything that can be done about this bootstrap socket error?

Ghost start takes around 5 mins then ends with an error that suggests to run ghost doctor.

Thanks


#33

@cedric How did you setup your server? Similar to what @billedawson did?
This topic is really hard to debug without having access to the server.


#34

@Kate

My server runs Ubuntu 16.04 and everything was working perfectly until I decided to upgrade to Ghost 2.x.

Maybe if you could give some explicit commands, I can show the results here.


#35

I’ve been chasing this for several weeks, and have made the tough decision to re-create my droplet from scratch.

With a new droplet – set-up as an Ubuntu 18.04 image – following the install directions, I was able to get Ghost 2.0 running. I am currently porting my database and content to this new droplet.

It’s not an ideal solution, and did require some permission changes, which I found in the forum – but, it works!


#36

@billedawson Thanks for coming back :slight_smile: And happy it works for you.

That means it must be caused by a strange setup :thinking:

@cedric If you run ghost start, can you run ghost log -f in a different shell window and copy the result here? Also what is the output of ghost doctor and ls -la /var/www/ghost?


#37

@Kate

The output of ghost start:

cedric@Cedric-SRV2:/var/www/ghost$ ghost start
Running sudo command: systemctl is-active ghost_localhost
:heavy_check_mark: Ensuring user is not logged in as ghost user
:heavy_check_mark: Checking if logged in user is directory owner
:heavy_check_mark: Checking current folder permissions
Running sudo command: systemctl is-active ghost_localhost
:heavy_check_mark: Validating config
:heavy_check_mark: Checking folder permissions
:heavy_check_mark: Checking file permissions
:heavy_check_mark: Checking content folder ownership
:heavy_check_mark: Checking memory availability
Running sudo command: systemctl start ghost_localhost
Running sudo command: systemctl stop ghost_localhost
:heavy_multiplication_x: Starting Ghost
A GhostError occurred.

Message: Could not communicate with Ghost
Suggestion: journalctl -u ghost_localhost -n 50

Debug Information:
OS: Ubuntu, v16.04
Node Version: v6.14.4
Ghost-CLI Version: 1.9.3
Environment: production
Command: ‘ghost start’

Additional log info available in: /home/cedric/.ghost/logs/ghost-cli-debug-2018-09-11T04_44_42_477Z.log

Try running ghost doctor to check your system for known issues.

ghost log -f outputs nothing from the ghost start command. The output below is from a previous ghost run:

[2018-09-11 08:33:28] WARN Theme’s file locales/en.json not found.
[2018-09-11 08:33:31] INFO Ghost is running in production…
[2018-09-11 08:33:31] INFO Your blog is now available on http://…
[2018-09-11 08:33:31] INFO Ctrl+C to shut down
[2018-09-11 08:33:31] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-09-11 08:33:31] WARN Tries: 0
[2018-09-11 08:33:31] WARN Retrying…
[2018-09-11 08:33:31] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-09-11 08:33:31] WARN Tries: 1
[2018-09-11 08:33:31] WARN Retrying…
[2018-09-11 08:33:31] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-09-11 08:33:31] WARN Tries: 2
[2018-09-11 08:33:31] WARN Retrying…
[2018-09-11 08:33:31] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-09-11 08:33:31] INFO Ghost boot 14.577s
[2018-09-11 08:35:02] WARN Ghost has shut down

The output of ls -la within the ghost install directory:

total 28
drwxrwxr-x 5 cedric cedric 4096 Sep 8 12:56 .
drwxr-xr-x 5 root root 4096 Mar 31 13:51 …
-rw-rw-r-- 1 cedric cedric 583 Sep 11 08:39 config.production.json
drwxrwxr-x 8 ghost ghost 4096 Sep 6 18:22 content
lrwxrwxrwx 1 cedric cedric 29 Sep 6 18:52 current -> /var/www/ghost/versions/2.1.1
-rw-rw-r-- 1 cedric cedric 113 Sep 6 18:52 .ghost-cli
drwxrwxr-x 3 cedric cedric 4096 Mar 31 13:56 system
drwxrwxr-x 5 cedric cedric 4096 Sep 6 18:49 versions

The output of ghost doctor:

:heavy_check_mark: Checking system Node.js version
:heavy_check_mark: Checking logged in user
:heavy_check_mark: Ensuring user is not logged in as ghost user
:heavy_check_mark: Checking if logged in user is directory owner
:heavy_check_mark: Checking current folder permissions
:heavy_check_mark: Checking operating system compatibility
Running sudo command: systemctl is-active ghost_localhost
:heavy_check_mark: Validating config
:heavy_check_mark: Checking folder permissions
:heavy_check_mark: Checking file permissions
:heavy_check_mark: Checking content folder ownership
:heavy_check_mark: Checking memory availability

I hope this helps.

~Thanks


#38

Thanks. Can you share cat config.production.json?


#39

{
“url”: “http://…”,
“server”: {
“port”: 2369,
“host”: “127.0.0.1”
},
“database”: {
“client”: “mysql”,
“connection”: {
“host”: “10.1.80.161”,
“user”: “user”,
“password”: “***********”,
“database”: “ghost_production”
}
},
“mail”: {
“transport”: “Direct”
},
“logging”: {
“transports”: [
“file”,
“stdout”
]
},
“process”: “systemd”,
“paths”: {
“contentPath”: “/var/www/ghost/content”
},
“bootstrap-socket”: {
“port”: 8000,
“host”: “localhost”
}
}


#40

I would like to test the socket connection manually. I am not sure we are getting any helpful results, but we can just try :innocent:You will download two test scripts, which doesn’t do anything bad to your container. It just tries to simulate the socket connection.

Login to your container with 2 shell windows. Ensure you are logged in as your ubuntu user.

Run the following commands in the first shell window:

cd /tmp
mkdir test-socket
cd test-socket
curl https://gist.githubusercontent.com/kirrg001/3d56703628ea2dfb59a1d36f4dfe5317/raw/35aabd013be3d7a40dca87cc8e8409b168885c3f/server.js > server.js
curl https://gist.githubusercontent.com/kirrg001/f6ca630337b64f587c8c291f6f4e5ff4/raw/cf4e40a2aef7169e32a4da5b17ff9a503e079945/client.js > client.js

Run in the first shell window

node server.js

Run in the second shell window:

cd /tmp/test-socket
node client.js

Share the output.

If the client can’t connect to the server, then run in the first shell window:

node server.js --host 127.0.0.1 --port 8787

And in the second shell window:

node client.js --host 127.0.0.1 --port 8787

Share the result.

You can now remove the two test scripts now.


#41

node client.js returns:

Bootstrap client was closed.

node server.js returns:

Start server localhost 8989
Received message from Client
Closed server