Trying to upgrade from 1.8.6


#1

It’s been a while since I maintained this site, but I noticed it’s throwing an error about the current casper theme being unavailable, so I figured I’d try to run ghost update and see if that fixes it. However, I’m getting this error:

An error occurred.
Message: 'Command failed: /bin/sh -c sudo -S -p '#node-sudo-passwd#' -E -u ghost mkdir     /var/www/musingmommy.com/content/settings
mkdir: cannot create directory ‘/var/www/musingmommy.com/content/settings’: File exists

'


Debug Information:
OS: Ubuntu, v18.04
Node Version: v8.10.0
Ghost-CLI Version: 1.8.1
Environment: production
Command: 'ghost update'

#2

So the Ghost-CLI has added a migration to add a new folder in the content folder. This code doesn’t protect against the folder being created already. Have you manually created content/settings? If not, can you remember the steps you did?

I would suggest to remove the content/settings folder if you haven’t used this folder yet.


#3

Thanks for the quick reply @Kate.

I honestly can’t remember when I set this up, or what the steps were to do so back then. If I remove content/settings, would that bork up the site?


#4

Should not, because Ghost will re-create the folder and files which are in there.

But to double check: Is the folder empty?


#5

Yep it’s empty, I’ll give it a go, thank you very much!


#6

Ok I think this may be a permissions issue, I thought I set my current user’s permissions correctly, but now I get this:

mkdir: cannot create directory ‘/var/www/musingmommy.com/content/settings’: Permission denied

#7

Which CLI version are you on?


#8

1.8.1


#9

And what is the output of ghost doctor?


#10

: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
System checks failed with message: ‘Linux version is not Ubuntu 16’
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes
:information_source: Checking operating system compatibility [skipped]
:heavy_check_mark: Checking for a MySQL installation
Running sudo command: systemctl is-active ghost_musingmommy-com
:information_source: Validating config [skipped]
: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


#11

I made sure the user is part of sudoers but I don’t know what else to check.


#12

We currently only support Ubuntu 16, see.

Hm could you share the whole error stack?
Which version is your blog on? ghost ls.


#13

That returns the version of a another blog I’m running on that machine, but not the version of the blog whose directory I’m in. Sounds like I have a weird setup and should expect troubles, I will troubleshoot more later, thanks for helping!


#14

Ok I stumbled across something that worked. I ran

ghost setup linux-user

And it’s letting me upgrade now o.O


#15

Hmm then i guess the ghost user wasn’t setup correctly when you have installed Ghost.


#16

Two things which should be investigated:

  1. Why did ghost doctor not complain?
  2. We should protect creating the settings folder if it already exist.

#17

I have raised an issue https://github.com/TryGhost/Ghost-CLI/issues/776 and left a comment on https://github.com/TryGhost/Ghost-CLI/issues/47.


#18

Thanks for the help Kate.

If it helps at all, I had tried installing a custom theme (to get around the theme issue I was having) and when I tried running

ghost restart

It complained with this:

Message: Systemd process manager has not been set up or is corrupted.
Help: Run ghost setup linux-user systemd and try again.

And after that I had the idea to retry updating.