Mark Nottage's picture

Downloaded the ISO, created a new VirtualBox VM, ran the installer, no apparent problems.

Attempt to connect to the wiki: 502 - bad gateway.

Attempt to connect to the wiki admin site: 502 - bad gateway.

Find a bug from 2016 referring to PM2 not starting correctly, try to follow "workaround" steps and find PM2 does not seem to be present!


Do any versions of this appliance work?

Jeremy Davis's picture

As you're possibly already aware, a 502 error usually means that the backend service has crashed, and/or is not responding (to the front end reverse proxy). So it sounds like the Ghost service isn't running.

We removed PM2 from the Ghost appliance (and all other appliances that provide NodeJS web apps; although IIRC it's still included in the vanilla NodeJS appliance) because it was unstable and we were having issues with it starting Node apps reliably. We replaced it with a standard "init script", so Ghost runs as a service.

So to check whether Ghost is running:

service ghost status

To start it (if it's stopped; to restart use 'restart' instead):

service ghost start

As to why it's not running, I'll have to have a look. Although in my experience, lack of resources is a common cause (e.g. running out of RAM).

Please let me know how you go. I'll also post back when I've had a chance to test it. If it's also failing for me, I'll try to provide a workaround plus also a full fix and I'll rebuild and re-release an updated version ASAP (may be a few weeks away).

Jeremy Davis's picture

I just launched the (LXC) container build (on Proxmox) of Ghost v15.2 and it appears to be working fine for me. Under some circumstance, there is a chance that it might work in one build format, but not in another. However all builds start from the ISO, so it seems hard to imagine how the ISO could be broken, but not the LXC build!? (E.g. perhaps a working OVA but broken LXC, or working ISO but broken OVA).

Perhaps you've given it insufficient resources (i.e. not enough RAM or vHDD)? Although for that to be the case, you'd have to have given it only a tiny amount. My instance is using 258MB RAM (of 2GB) and 1.8GB of vHDD (of 8GB). So unless you only gave it 256MB RAM or less (and no swap) and/or only just enough vHDD space to install (and not much more) then it should be ok. I doubt it would be related to CPU as I only gave mine 1 virtual CPU (and my server CPU is a super low power Intel Atom chip) and the usage graph shows that it peeked at about 70%, but only for a minute or 2.

The only other thing that occurs to me is that in my experience, NodeJS apps can sometimes take a little while to start up when the server first boots (the less resources, the slower the start up). So perhaps you just tried to access it before it had completed starting up?

If you have any further info to share that might help me reproduce this issue, please do so. If I can reproduce it, I can almost certainly fix it. :)

Mark Nottage's picture

Not sure why it didn't start, though.

The VM built from ISO was given 2GB of RAM (out of 8GB) and 8GB VHD.

The OVA imports with 512MB RAM and a 20GB VMDK.

Jeremy Davis's picture

As per my previous post, 2GB RAM and 8GB vHDD should be tons! So it seems unlikely that's the issue. Although one thing that is worth noting is that LXC leverages the kernel of the host, so tends to be very light on resources (vs a "full" VM). That is one factor that didn't occur to me yesterday. So, I'll test an ISO install to a "proper" VM, see how that goes and report back.

Also, I assume you are, but just to make sure that we're on the same page, you are using the latest v15.2 build right? You can check that, either via the filename, which should look like this (for the ISO; somewhat similar for the OVA):


Alternatively, you can run 'turnkey-version' from the commandline and you will get a somewhat similar response.

Regardless, I wonder if the logs might give us some insight into what is going on? Can you please post the output of the following:

journalctl -u ghost -b --no-pager
Mark Nottage's picture

`turnkey-version` outputs: turnkey-ghost-15.2-stretch-amd64


`journalctl -u ghost -b --no-pager` outputs: -- No entries --



Jeremy Davis's picture

Ok great thanks... At least I know we're on the same page re version.

Re the log, that's a bit weird!? But TBH, what is even weirder (and explains why there is no log) is that I've just downloaded the ISO and installed it and can 100% confirm the issue! :(

I'm super curious how the hell this has happened as from a brief glance, the ghost service file (it's an older style Sysvinit script) doesn't exist in the ISO?! It's within the buildcode overlay (so should exist in the ISO). As I noted before, the LXC build (actually all builds) start life from the ISO(s). And yet it's there in the LXC build?! Blows my mind... I wonder if one of the security updates broke it in some way? Although I also ran the security updates on the LXC so, perhaps not?!

Anyway, I'm going to need to work out how the hell that has happened and provide a proper fix and re-release Ghost so it works OOTB.

In the meantime, I have a pretty easy workaround for you (there is also a SystemD service file, which looks like it ships with Ghost, so we can ditch the Sysvinit script anyway):

systemctl enable ghost_localhost.service 
systemctl start ghost_localhost.service 

You should now be all systems go!

Thanks so much for reporting this, as well as your patience and persistence. Deep apologies on the run around with this one.

FWIW, I've opened a bug report regarding this issue and included the above workaround.

Mark Nottage's picture

After a reboot of the VM, found that ghost isn't starting at boot time.

For what it's worth, it seems to start fine when manually run:

root@ghost /opt/ghost# ghost restart

+ sudo systemctl is-active ghost_localhost

Ghost instance is not running! Starting...

+ sudo systemctl is-active ghost_localhost

Ensuring user is not logged in as ghost user

Checking if logged in user is directory owner

Checking current folder permissions

+ sudo systemctl is-active ghost_localhost

Validating config

Checking folder permissions

Checking file permissions

Checking content folder ownership

+ sudo systemctl start ghost_localhost

Starting Ghost




Your admin interface is located at:


root@ghost /opt/ghost# 

Jeremy Davis's picture


sudo systemctl enable ghost_localhost

That should make it auto start on boot.

Mark Nottage's picture

Yes, now I have enabled it:


sudo systemctl enable ghost_localhost
Jeremy Davis's picture

Thanks for your patience and persistence on this one. Also thanks a ton for reporting the issue in the first place.

I still don't understand why the issue occurred, but now we have a solid workaround, we'll aim to apply a proper fix and rebuild the appliance ASAP (it'll probably take a week or 2 to publish it).

Good luck with it from here on in and please don't hesitate to post back if you have any further concerns, issues or questions.

Add new comment