Peertube can't install backup after fail upgrade nodejs problem

What app is this about, and its version: peertube 7.0.2
What YunoHost version are you running: 12.1.35 stable
What type of hardware are you using: Raspberry Pi 3, 4+

Describe your issue

basicly, there was a fail upgrade possibly due to network.
Then fail backup restore due to node-js problem.

I did the following solution proposed by @fflorent : Impossible de restaurer une sauvegarde de Peertube - #8 by CptCurk
Check the nodejs folder if everything is in the right place (it was).

But unfortunatly, as you can see in the logs, peertube backup force cleanup the good nodejs version.

How could I prevent the backup to clean it ? Is there a way to unpack this tar Then modify the nodejs line (by what? Or by the good nodejs version ?) and repack ?)
And is that the *.tar or the *.tar.gz I should be concerned about ?
What about this again by @fflorent ! Need a simple way to change the restore script of a backup · Issue #2664 · YunoHost/issues · GitHub

Thank you !

Share relevant logs or error messages

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

Hello !

So I’ve download the backup file *.tar.gz from the webGUI (dunno how to do in command line yet.)

But I got it on my desk. Just trying to get into files and being able to find that line saying it need to install “node-v = latest” or something like that. I don’t know what I’m looking for yet.
May be I could do a grep into all files in the tar ?
How to do that on macOS ?

And should I look for something like that line :

N_PREFIX=/opt/node_n/ /usr/share/yunohost/helpers.v2.1.d/vendor/n/n install VERSION

Any guy who knows some command line would be helpful ! Haha

Btw : tried again from the webgui to restor backup. Same error.

Hello @CptCurk
You can try this

  1. go to your yunohost archive folder and copy your peertube archive (safer)
cp -pr peertube-archive.tar peertube-archive-copy.tar
  1. Read the service file inside the archive (to check thje nodejs version used at lines Environment and ExecStart) and read the settings.yml file

a) service file

tar -xOf peertube-archive-copy.tar apps/peertube/backup/etc/systemd/system/peertube.service

b) settings.yml

tar -xOf peertube-archive-copy.tar apps/peertube/settings/settings.yml
  1. change the service file according to your needs

a) extract the service file

tar -xvf peertube-archive-copy.tar apps/peertube/backup/etc/systemd/system/peertube.service

b) edit it (22.21.1 instead of 22.19.0 I guess)

nano apps/peertube/backup/etc/systemd/system/peertube.service
  1. Once edited

a) calculate the checksum of the modified service file and copy its value

md5sum apps/peertube/backup/etc/systemd/system/peertube.service

b)[edit] extract and edit settings.yml and change the checksum value at line checksum__etc_systemd_system_peertube.service

tar -xvf peertube-archive-copy.tar apps/peertube/settings/settings.yml
nano apps/peertube/settings/settings.yml
  1. Update the archive
tar --update -f peertube-archive-copy.tar apps/peertube/backup/etc/systemd/system/peertube.service
tar --update -f peertube-archive-copy.tar apps/peertube/settings/settings.yml
  1. Restore the peertube-archive-copy (it should appear in, webadmin > tools> backup …)

Hello !

I’m doing everything as you say. Just added the tar -xvf peertube-archive-copy.tar apps/peertube/settings/settings.yml to get the file to do the change

But the settings.yml is like the service file : 22.19.0, should I right the line here too with 22.21.1 ?

Also, it looks like the *.tar is somewhat linked to the *.tar.gz peertube-archive-copy.tar -> /home/yunohost.backup/archives/peertube-pre-upgrade2.tar.gz

So with that, I can’t change the peertube-archive-copy.tar because it says that’s compressed. How can I “unlink” this ?

I could copy the cp -pr peertube-pre-upgrade2.tar.gz peertube-archive-copy.tar.gz and do gunzip but then would it link the same way ?

Also, a big Thank you for helping, I guess/hope this will work :slight_smile:

Update :
Okay, I did some research about that, it looks like it’s a symlink that got preserved by cp -pr (the p here preserve attribut). So I think I need to dereferrence, and build a tar.gz from the new tar. with symlink. I’ll try also to cp the info.json to get the same name.
I did that anyway, and try to update right now.

Would that be right ?

Yes, I forgot to write that, thanks ! I will edit my previous post.

If you ran cp -pr archive.tar.gz archive-copy.tar, then archive-copy.tar looks like a .tar, but it is actually still a .tar.gz.

You should try decompressing the .tar.gz into a .tar first (gunzip -k ...), then copy it as peertube-archive-copy.tar

1 Like

Well I got peertube up to almost working… Show a nginx issue. I’ll dig in that later, but I think I can solve this issue myself.

Thank a lot. Without you and especially the md5sum, I couldn’t do that myself. I didn’t knew that even existed those checksum ^^’

Well hope you’ll be rewarded in life for helping :sunny: