Update to 3.5.2 or 3.13.1 not working because of random yarn issues

Hi all,

at first a short disclaimer, it may be that there is some rant in this article.
Is the 2nd or 3rd time i try to update ghost cms by using “ghost update” and it’s the 3rd time i have to spend hours to get my instance back working again. That sucks!

Debug Information:
OS: Ubuntu, v18.04.4 LTS
Node Version: v10.20.0
Ghost-CLI Version: 1.13.1
Environment: production
Command: ‘ghost install’

ghostusr@xxxxxxxx:/var/www/ghost$ ghost install
:heavy_check_mark: Checking system Node.js version
:heavy_check_mark: Checking logged in user
:heavy_check_mark: Checking current folder permissions
:heavy_check_mark: Checking operating system compatibility
:heavy_check_mark: Checking for a MySQL installation
:heavy_check_mark: Checking memory availability
:heavy_check_mark: Checking for latest Ghost version
:heavy_check_mark: Setting up install directory
:heavy_multiplication_x: Downloading and installing Ghost v3.13.1
A ProcessError occurred.

Message: Command failed: yarn install --no-emoji --no-progress

yarn install v1.19.1

I tried to use “ghost update” to get the latest version. I don’t know why but there are issues and the CLI told me i should use “ghost update 3.5.2 --force” to get thos dependencies running (i don’t know why but okay. Because the 3.5.2 update broke already and i did a rollback with no errors…).

This upgrade to 3.5.2 --force didn’t worked because any node dependencie could not be resolved or installed.
After some tries to get this command working i thought there could be a new version of the ghost-cli which i can use. So i made an update “sudo npm install -g ghost-cli@latest” like the documentation say: https://ghost.org/docs/api/v3/ghost-cli/

After that i tried to update to “ghost update 3.5.2 --force” and do a normal update. Suddenly this has worked without any issues. After that i did ‘ghost update’ to get the lastest version but an error occurred (Message: Command failed: yarn install --no-emoji --no-progress, same for new install).

Okay… So i thought the old version (3.5.2) should work. As i started the installation with “ghost start” it tells me that the installation has issues and i should use “ghost doctor” to detect those issues. Ghost doctor tells me to run “ghost update 3.5.2 --force”…

WTF?! The update to 3.5.2 had worked (at least i got no error message) and then “ghost start” is unable to start the instance? I thought it has (successfully?) updated to 3.5.2?

Long story short. I read in some github issues that a reinstall of ghost could work. So i made backups, called “ghost uninstall”, cleared the folders etc.
Then i wanted to call “ghost install” and it tells me i can’t install ghost because [any random yarn error] and [some issues with ghost 3.5.2 dependencies] have ocurred.

How can this be? I even uninstalled my ghost instance to make a clean setup and even there i get issues because of some random not-working yarn dependencies in ghost 3.5.2 (which i have deleted)?!
Don’t get me wrong: I am satisfied with ghost and it fullfills my needs and it’s lightweight. But it sucks that i have to spend hours just to do a simple update to a newer version. I don’t want to invest days just to do an update or get the website back running.

Currently i am rolling back a server update to get my website working. What is the correct way to get a clean (and working!) ghost instance again? Is there some config-file i have to edit so it forgets about the 3.5.2 update? Can i call “ghost update” of an (maybe) already altered database (i am using MySQL)? Is a clean install of the server and ghost the only solution?

I just want to get my instance up and running again (including future updates) without any bad 4-hour-eating update experiences anymore. Maybe it’s because i used a too old version of ghost cli? Could there be a warning like “a new update is available”?

In the current state the project feels unstable to me even if the first install, configuration and usage of the website/webUI is very nice.

Thank you very much and best regards

I just found out that a failing update updates the “.ghost-cli” file. This leads to issues that a not installed version is marked as installed or updated, even if it doesn’t had happened (because of errors). I didn’t saw that file as i used ls to identify my files which i would like to remove. I guess this caused the issue that i was unable to clean install ghost.

I deleted the version-folder, the soft link “current” and resetted the version in the .ghost-cli file and finally i was able to update to 3.13.1. The yarn error occurred anyway but at least i was able to upgrade to the latest version and use “ghost start” to start the service again. Maybe this helps other people who have update issues.