Hi,
from the contents of my Ghost log files it looks like Ghost is constantly starting and shutting down again. Here’s a screenshot of the normal log:
And here’s a screenshot of the error log:
Here’s what ghost ls
gives:
And here’s the output of ghost doctor
:
I’m running in a ProxMox LXC with Ubuntu 24.04 LTS.
Here’s what netstat -tulpen
says:
I see the port 2368 only once, associated with the node
process.
When I stop Ghost with ghost stop
both logs stop filling up and are silent.
What’s the problem here and how can I fix it?
Any help much appreciated!
One result of this is that I can’t login anymore …
Is it possible you have two ghost installs, competing for the same port? That’s what it looks like…
How would I know? ghost ls
is listing just one …
Try this:
sudo ps waux | grep node | grep current
This provides a list of processes that are running, and then just shows the ones that contain ‘node’ and ‘current’, which should get us a list of running Ghost installs.
I’m particularly interest in the user identified (first column), and the pid (second column). Run it a couple times. Is the pid changing? A stable Ghost install is one line here, with a pid that doesn’t change. (Until you restart it.)
and
sudo lsof -i | grep 2368
This shows the process and user associated with whatever is bound to 2368. You should get one entry, and it should match the pid and user from the first command, not not be changing when rerun.
What does
systemctl list-units --type=service
show? (add --state=active
) if too spammy)
I’m wondering if systemd is trying to start Ghost twice, or two installs of Ghost…
Most fascinating, Cathy, there’s indeed “some” other node process running with port 2368 open, the user is ghost
:
root@ghost:/var/www/ghost# netstat -tulpen
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 992 161470775 228/systemd-resolve
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 0 161470290 434/nginx: master p
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 0 161470291 434/nginx: master p
tcp 0 0 127.0.0.54:53 0.0.0.0:* LISTEN 992 161470777 228/systemd-resolve
tcp 0 0 127.0.0.1:33060 0.0.0.0:* LISTEN 107 161470134 269/mysqld
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 0 161470397 559/master
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 107 161471258 269/mysqld
tcp 0 0 127.0.0.1:2368 0.0.0.0:* LISTEN 999 161471573 383/node
tcp6 0 0 :::22 :::* LISTEN 0 161469889 1/init
tcp6 0 0 :::80 :::* LISTEN 0 161470292 434/nginx: master p
tcp6 0 0 ::1:25 :::* LISTEN 0 161470398 559/master
udp 0 0 127.0.0.54:53 0.0.0.0:* 992 161470776 228/systemd-resolve
udp 0 0 127.0.0.53:53 0.0.0.0:* 992 161470774 228/systemd-resolve
udp 0 0 192.168.0.101:68 0.0.0.0:* 998 161468125 102/systemd-network
root@ghost:/var/www/ghost# lsof -i | grep 2368
node 383 ghost 27u IPv4 161471573 0t0 TCP localhost:2368 (LISTEN)
root@ghost:/var/www/ghost# ps auxwww | grep -i node
ghost 383 0.0 8.9 11582996 186824 ? Sl Jan10 0:29 /usr/bin/node current/index.js
root 31119 0.0 0.0 3528 1664 pts/3 S+ 14:45 0:00 grep --color=auto -i node
root@ghost:/var/www/ghost# kill -9 383
root@ghost:/var/www/ghost# ps auxwww | grep -i node
ghost 31153 0.0 7.1 11468624 150744 ? Rl 14:46 0:01 /usr/bin/node current/index.js
root 31171 0.0 0.0 3528 1664 pts/3 S+ 14:46 0:00 grep --color=auto -i node
root@ghost:/var/www/ghost#
As you can see: after I killed it it stared again immediately.
However, ghost ls
lists no running Ghost instance:
root@ghost:/var/www/ghost# su stefan
stefan@ghost:/var/www/ghost$ ghost ls
Love open source? We’re hiring JavaScript Engineers to work on Ghost full-time.
https://careers.ghost.org
+ sudo systemctl is-active ghost_192-168-0-101
? Sudo Password [hidden]
┌───────────────┬────────────────┬─────────┬─────────┬─────┬──────┬─────────────────┐
│ Name │ Location │ Version │ Status │ URL │ Port │ Process Manager │
├───────────────┼────────────────┼─────────┼─────────┼─────┼──────┼─────────────────┤
│ 192-168-0-101 │ /var/www/ghost │ 5.105.0 │ stopped │ n/a │ n/a │ n/a │
└───────────────┴────────────────┴─────────┴─────────┴─────┴──────┴─────────────────┘
stefan@ghost:/var/www/ghost$
The systemctl
command lists a lot of active services, here’s the output filtered for “ghost”:
root@ghost:/var/www/ghost# systemctl list-units --type=service | grep -i ghost
ghost_localhost.service loaded active running Ghost systemd service for blog: localhost
root@ghost:/var/www/ghost#
So, despite having stopped Ghost via ghost stop
it’s still running?
When I reboot this LXContainer everything looks exactly like mentioned above, so after boot Ghost seems to start somehow.
Now I need a way to repair this … Any idea, @Cathy_Sarisky?