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


#1

Hi guys,

I’ve successfully updated ghost to

Ghost-CLI version: 1.9.1
Ghost Version (at /var/www/ghost): 2.0.3

when do ghost start is an endless waiting,
so I try ghost run

and get
Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
at this point I can access my web. But again when stop it and using ghost start, process can’t been finished and my blog isn’t started.

[2018-08-23 12:05:55] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-23 12:05:55] WARN Tries: 0
[2018-08-23 12:05:55] WARN Retrying…
[2018-08-23 12:05:55] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-23 12:05:55] WARN Tries: 1
[2018-08-23 12:05:55] WARN Retrying…
[2018-08-23 12:05:55] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-23 12:05:55] WARN Tries: 2
[2018-08-23 12:05:55] WARN Retrying…
[2018-08-23 12:05:55] WARN Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-23 12:05:55] INFO Ghost boot 2.306s
Can’t connect to the bootstrap socket (localhost 8000) ECONNREFUSEDINFO [2018-08-23 12:06:30] “GET /” 301 8ms
INFO [2018-08-23 12:06:33] “GET /favicon.ico” 200 5ms
INFO [2018-08-23 12:06:33] “GET /” 200 413ms
INFO [2018-08-23 12:06:34] “POST /subscribe/” 301 1ms
INFO [2018-08-23 12:06:37] “GET /subscribe/” 200 27ms
INFO [2018-08-23 12:06:46] “GET /robots.txt” 200 2ms
INFO [2018-08-23 12:06:49] “GET /favicon.ico” 200 2ms

is there anything what should I do to successfully use ghost start ?

appreciate for your help


#2

Hey @adepurana what process manager are you using? If you didn’t explicitly set one, it’s probably systemd.


#3

yup It’s systemd @vikaspotluri123


#4

That is currently expected. ghost run does not open a bootstrap socket. I agree it’s confusing. We should reconsider logging this when running ghost run - need to figure out how.

when do ghost start is an endless waiting,

Hm that is weird, might be a bug. You could run watch --interval 0.5 netstat -tulnp in a second shell window and look which ports show up when executing ghost start.


#5

I think we can improve the behavior after fixing #787 - After the bootstrap socket is destroyed, we remove the port from the config file


#6

@vikaspotluri123 Yeah that sounds like a good idea :slight_smile:


#7

I am having similar issues. When I run watch --interval 0.5 netstat -tulnp the only port that shows is 8000.


#8

Which OS are you using?


#9

Im using Ubuntu 16.04


#10

Can you pls define “endless” - how long did you wait?
Could you also please open two shell windows.

The first will run ghost restart. The second window will run ghost log -f. Please share the log here. THanks :slight_smile:


#12

I got nothing when doing the ghost restart,

then got this message after I try use
nohup ghost run &

[2018-08-27 14:35:40] ERROR

NAME: InternalServerError
MESSAGE: (EADDRINUSE) Cannot start Ghost.

level: normal

Port 2368 is already in use by another program.
Is another Ghost instance already running?
InternalServerError: (EADDRINUSE) Cannot start Ghost.
    at new GhostError (/var/www/ghost/versions/2.0.3/core/server/lib/common/errors.js:9:26)
    at Server.<anonymous> (/var/www/ghost/versions/2.0.3/core/server/ghost-server.js:79:30)
    at emitOne (events.js:116:13)
    at Server.emit (events.js:211:7)
    at emitErrorNT (net.js:1375:8)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)

[2018-08-27 14:35:40] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-27 14:35:40] WARN Tries: 0
[2018-08-27 14:35:40] WARN Retrying...
[2018-08-27 14:35:40] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-27 14:35:40] WARN Tries: 1
[2018-08-27 14:35:40] WARN Retrying...
[2018-08-27 14:35:40] ERROR "GET /" 503 46ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/2.0.3/node_modules/ghost-ignition/lib/errors/index.js:136:23)
    at maintenance (/var/www/ghost/versions/2.0.3/core/server/web/middleware/maintenance.js:13:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:275:10)
    at filterPrivateRoutes (/var/www/ghost/versions/2.0.3/core/server/apps/private-blogging/lib/middleware.js:44:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:275:10)
    at checkIsPrivate (/var/www/ghost/versions/2.0.3/core/server/apps/private-blogging/lib/middleware.js:31:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)

[2018-08-27 14:35:40] INFO "GET /assets/built/screen.css?v=a70d710117" 200 6ms
[2018-08-27 14:35:40] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-27 14:35:40] WARN Tries: 2
[2018-08-27 14:35:40] WARN Retrying...
[2018-08-27 14:35:40] ERROR "GET /" 503 4ms

NAME: MaintenanceError
MESSAGE: Site is starting up, please wait a moment then retry.

level: normal

MaintenanceError: Site is starting up, please wait a moment then retry.
    at new MaintenanceError (/var/www/ghost/versions/2.0.3/node_modules/ghost-ignition/lib/errors/index.js:136:23)
    at maintenance (/var/www/ghost/versions/2.0.3/core/server/web/middleware/maintenance.js:13:21)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:275:10)
    at filterPrivateRoutes (/var/www/ghost/versions/2.0.3/core/server/apps/private-blogging/lib/middleware.js:44:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)
    at /var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:335:12)
    at next (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:275:10)
    at checkIsPrivate (/var/www/ghost/versions/2.0.3/core/server/apps/private-blogging/lib/middleware.js:31:20)
    at Layer.handle [as handle_request] (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/var/www/ghost/versions/2.0.3/node_modules/express/lib/router/index.js:317:13)

[2018-08-27 14:35:40] WARN Can't connect to the bootstrap socket (localhost 8000) ECONNREFUSED
[2018-08-27 14:35:40] INFO Ghost boot 5.129s

Ghost update -> stdout maxBuffer exceeded
#13

Looks like Ghost is already running, that would explain it.

Can you run ps aux | grep node?


#14

But i wonder why the CLI does not get the error message back from Ghost. I’ll test that.


#15

@adepurana ping :slight_smile:


#16

Hm you probably got the “port is running” error, because ghost start did start the instance, but somehow the CLI wasn’t informed about it.

The screenshot you have shared does not show the bit when Ghost is stopped and started (triggered by ghost restart). Can you share again and show this bit? Thanks!


#17
ubuntu@ip-172-31-24-59:~$ ps aux | grep node
root     13865  0.0  0.3  55740  3196 ?        S    Aug27   0:00 sudo -E -u ghost /usr/local/bin/node current/index.js
ghost    13867  0.0 10.4 1280516 105932 ?      Sl   Aug27   1:40 /usr/local/bin/node current/index.js
ubuntu   21795  0.0  0.0  12944   988 pts/0    S+   08:24   0:00 grep --color=auto node
ubuntu@ip-172-31-24-59:~$

#18


I have restarted the ghost restart few times, but no additional log is adding


#19

Ubuntu 16.04.5


#20

It looks like you somehow have 2 Ghost instances running on your server. Can you pls double check? It’s hard to diagnose without having access to the server.


#21

ghost restart ran for 3.5 minutes without resolution.

bedawson-Ghost:/var/www/ghost$ ghost restart
Running sudo command: systemctl is-active ghost_localhost
? Sudo Password [hidden]
Ghost instance is not running! Starting…
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
Running sudo command: systemctl start ghost_localhost
☴ Starting Ghost

ghost log -f displayed the following:

bedawson-Ghost:/var/www/ghost$ ghost log -f
Running sudo command: systemctl is-active ghost_localhost
? Sudo Password [hidden]
[2018-08-31 22:15:06] INFO “GET /public/ghost-sdk.min.js?v=a52f56447b” 200 35ms
[2018-08-31 22:15:06] INFO “GET /assets/js/jquery.fitvids.js?v=a52f56447b” 200 40ms
[2018-08-31 22:15:06] INFO “GET /content/images/2018/06/D3FB4120-D301-454B-8035-C0E3B0722F85.png” 200 56ms
[2018-08-31 22:15:06] INFO “GET /content/images/2017/07/header.png” 200 32ms
[2018-08-31 22:15:06] INFO “GET /content/images/2015/05/IMG_2345.jpg” 200 14ms
[2018-08-31 22:15:17] INFO “GET /ghost/” 200 250ms
[2018-08-31 22:15:17] INFO “GET /ghost/assets/vendor.min-e71cb5c677f51d517625c8c87005a74a.css” 200 58ms
[2018-08-31 22:15:17] INFO “GET /ghost/assets/ghost.min-e78ed0a8c988f402a4326fbfb5014d10.css” 200 115ms
[2018-08-31 22:15:17] INFO “GET /ghost/assets/ghost.min-a3b388879732732b560639ae0770746f.js” 200 164ms
[2018-08-31 22:15:17] INFO “GET /ghost/api/v0.1/configuration/” 200 42ms
[2018-08-31 22:15:18] INFO “GET /ghost/api/v0.1/configuration/private/” 200 200ms
[2018-08-31 22:15:18] INFO “GET /ghost/api/v0.1/settings/?type=blog%2Ctheme%2Cprivate” 200 352ms
[2018-08-31 22:15:18] INFO “GET /ghost/api/v0.1/users/me/?include=roles” 200 404ms
[2018-08-31 22:15:18] INFO “POST /ghost/api/v0.1/authentication/token” 200 665ms
[2018-08-31 22:15:18] INFO “GET /ghost/api/v0.1/notifications/” 200 128ms
[2018-08-31 22:15:18] INFO “GET /ghost/assets/ghost-dark-78550990732cff9cfa02386a30478da8.css” 200 138ms
[2018-08-31 22:15:19] INFO “GET /ghost/api/v0.1/posts/?limit=30&page=1&filter=status%3A%5Bdraft%2Cscheduled%2Cpublished%5D%2Bpage%3A%5Btrue%2Cfalse%5D&formats=mobiledoc%2Cplaintext&include=authors%2Ctags%2Cauthors.roles” 200 439ms
[2018-08-31 22:15:19] INFO “GET /content/images/2018/04/Bowtie—ghost-1.png?t=1535768119176” 200 4ms
[2018-08-31 22:15:19] INFO “GET /ghost/api/v0.1/users/?limit=all&include=roles” 200 167ms
[2018-08-31 22:15:19] INFO “GET /ghost/api/v0.1/tags/?limit=all” 200 191ms