Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing custom theme and files after update from 5.26.4 to 5.44 #230

Open
borisnoyet opened this issue May 2, 2023 · 18 comments · Fixed by #231
Open

Missing custom theme and files after update from 5.26.4 to 5.44 #230

borisnoyet opened this issue May 2, 2023 · 18 comments · Fixed by #231

Comments

@borisnoyet
Copy link

Bug description

*I upgraded my two Ghost instances from 5.26.4 to 5.44 with ghost_ynh. The update seemed to run smoothly but the website displayed and error indicating my custom theme was missing. Had to upload my the .zip theme from my backup. The image folder was missing too in www/var/ghost/content/content and custom routes.yaml missing. I managed to restore all missing asset with ghost admin and SSH directory upload. *

Context

  • Hardware: x86 board mini PC
  • YunoHost version: 11.1.18 (stable)
  • I have access to my server: Through SSH + through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no

Steps to reproduce

  • Simple update from Yunohost webadmin.

Expected behavior

The expected behaviour was to find all the files and theme after update ☺️

Logs

Two logs because two Ghost instances

https://paste.yunohost.org/raw/mihihivulo

https://paste.yunohost.org/raw/isorewozuh

@nicofrand
Copy link

Yup, same thing here (Also it seems the content is now in /var/www/ghost/ghost/content and not in /var/www/ghost/content anymore…

@borisnoyet
Copy link
Author

Thanks for your comment. I just looked again at my instance's folders and it seems that the old files are actually still there, but in an other place (from the previous version ?)
img_ 2023-05-02 at 15 45 06
: they stayed in /core folder (see screenshot).

@nicofrand
Copy link

Wow, thanks a lot, I deleted my backup and though I'd loose many hours getting back my images!

@tituspijean
Copy link
Member

Ooops my bad, in the upgrade script I made sure a backup of the old contents directory is done, but did not deploy it back to the new location...

@borisnoyet
Copy link
Author

Finally, once everything was restored and tested, I removed the old ghost/core folder in my two instances (/var/www/ghost and /var/www/ghost__2). Everything seems ok now :)

tituspijean added a commit that referenced this issue May 2, 2023
@tituspijean
Copy link
Member

I'll let you move the directory manually, sorry for the inconvenience. :/

@tituspijean tituspijean pinned this issue May 2, 2023
@tomaytotomato
Copy link

tomaytotomato commented May 4, 2023

I upgraded as well, I cannot find any of my images, even in the ghost-pre-upgrade1.tar, my blog of almost 10 years has been nuked... 😞

@borisnoyet
Copy link
Author

In my case, the update didn't removed any folder. Have you tried (via SSH) to look into the core folder (where images were placed in the previous version) ?

@tituspijean
Copy link
Member

tituspijean commented May 4, 2023

@tomaytotomato the backup should contain everything.

Anyways, I have borked the fix sorry... your content directory should currently be in /var/www/ghost/ghost, while it should have been copied in /var/www/ghost/ghost/current/. You should be able to fix it with rsync -av /var/www/ghost/ghost/content/ /var/www/ghost/ghost/current/content/ (mind the trailing slashes)

I will try to properly fix that in the script tomorrow.


Edit: could not wait trying... /var/www/ghost/ghost/content should actually be a valid path, since I have the following bit in the config.production.json

"contentPath": "/var/www/ghost/ghost/content"

I concede I am lost.

@tituspijean tituspijean reopened this May 4, 2023
@borisnoyet
Copy link
Author

I confirm that this path ("/var/www/ghost/ghost/content") is actually working fine. Here are two screenshots of my two ghost instances running.
img_ 2023-05-05 at 08 49 48
img_ 2023-05-05 at 08 52 33

@eauchat
Copy link

eauchat commented Jul 25, 2023

Hey, sorry to dig this issue up, but I've just updated a ghost app today, and had the same issue.
I have a /var/www/ghost__3/ghost/content/ directory, containing all the appropriate subdirectories, but most seem empty, for example the images subdirectory which should contain stuff is empty, and the site doesn't manage to show images. Also I manage to have the site working only by manually reuploading my custom theme.

So it seems to me that the problem isn't solved, unless I misunderstood something.

@tituspijean
Copy link
Member

What's the value of contentPath in your config.production.json ?

@eauchat
Copy link

eauchat commented Jul 25, 2023

paths.contentPath key has the following value: "/var/www/ghost__3/ghost/content"
I guess that's the one you were asking for.

@tituspijean
Copy link
Member

As per the conversation above, make a backup then try mv /var/www/ghost__3/content/* /var/www/ghost__3/ghost/content/.

@eauchat
Copy link

eauchat commented Jul 25, 2023

Not sure I'm getting it. The app is already updated and I made a mistake and erased the pre-upgrade backup while I was trying to look into it (don't ask me how, I'm too ashamed ;)). So making a backup now will somehow extract the files to the backup? I don't really understand from where it would extract them, sounds a bit like magic to me ;)

If I should get them from a pre-upgrade backup because files have been lost during upgrade, then I can re-import a previous distant backup, and do what you say.
But will I have to do that manually for every site I update? (I have other sites I didn't update yet because I didn't want to have the same issue.)

In any case, thanks @tituspijean for your answers and the time you put at making apps work :)

@tituspijean
Copy link
Member

Making a backup now, from YunoHost, will preserve the current state of the app. In case we fuck it up more.

But will I have to do that manually for every site I update? (I have other sites I didn't update yet because I didn't want to have the same issue.)

No, it's the migration for this specific upgrade that I badly coded. Moving the files is only needed once.

@eauchat
Copy link

eauchat commented Jul 26, 2023

Hey sorry, I realize I hadn't understood well what you meant because it seems I have a different situation than you.
So you meant to do a backup just for safety and to move files in the app directory from ./content/ to ./ghost/content/.
The thing is that I don't have a /var/www/ghost__3/content/ directory.
Here are a few ls from the app directory to give you an idea:


> ls /var/www/ghost__3/
ghost  node_modules  package.json  package-lock.json

> ls /var/www/ghost__3/ghost/
config.production.json	content  current  versions

> ls /var/www/ghost__3/ghost/content/
apps  content  data  files  images  logs  media  public  settings  themes
> ls /var/www/ghost__3/ghost/content/images/

> ls /var/www/ghost__3/ghost/current/
components  content  core  ghost.js  index.js  LICENSE	loggingrc.js  MigratorConfig.js  node_modules  package.json  PRIVACY.md  README.md  yarn.lock
> ls /var/www/ghost__3/ghost/current/content/
adapters  data	images	logs  public  settings	themes
> ls /var/www/ghost__3/ghost/current/content/images/
README.md

> ls /var/www/ghost__3/ghost/versions/
5.44.0
> ls /var/www/ghost__3/ghost/versions/5.44.0
components  content  core  ghost.js  index.js  LICENSE	loggingrc.js  MigratorConfig.js  node_modules  package.json  PRIVACY.md  README.md  yarn.lock
> ls /var/www/ghost__3/ghost/versions/5.44.0/content
adapters  data	images	logs  public  settings	themes
> ls /var/www/ghost__3/ghost/versions/5.44.0/content/images
README.md

@eauchat
Copy link

eauchat commented Aug 12, 2023

I tried digging in this issue again today.
First I restored the app to before upgrade state.

I tried upgrading again and it created the same issue, contents had disappeared, custom theme was missing...
I found that the appropriate contents were stored in /var/www/ghost__3/ghost/content/content/.
The /var/www/ghost__3/ghost/content/ contain the appropriate directories, but they are mostly empty, and missing contents (and it has this additional nested content/ directory that really seems like, mmh, there's been some typo somewhere in the migration).
So it seems to me that the update script is still broken.

I noted that in my situation:
Before upgrade /var/www/ghost__3/ghost/core/config.production.json contains among other things:

    "paths": {
        "contentPath": "content/"
    },

After upgrade /var/www/ghost__3/ghost/config.production.json contains among other things:

  "paths": {
    "contentPath": "/var/www/ghost__3/ghost/content"
  }

I don't know if that's of any use for figuring out the issue with the upgrade script.

I managed to have the site working seemingly right replacing /var/www/ghost__3/ghost/content/ contents by /var/www/ghost__3/ghost/content/content/ one's.
Then I had to chown the directory to ghost__3 user and group because ownership was messed up somehow.
Then after running yunohost service restart ghost__3 the site seem to be working.

I don't know how it is for other people, but to me it seems this issue shouldn't yet be closed.

@tituspijean tituspijean reopened this Aug 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants