Cannot restore form tar.gz

What type of hardware are you using: Raspberry Pi 3, 4+
What YunoHost version are you running: 11.3.0.2
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: No

Describe your issue

I have a backup from October 2024 and I wanted to restore from it, but just one app (Wordpress). I installed Yunohost 11.3.0.2 on my Raspberry Pi 3 and I wanted to restore from tar.gz file that I created (via webadmin) and downloaded in October 2024.
I have added the tar.gz file via terminal to the correct location (/home/yunohost.backup/archives/), but I cannot see it in webadmin. I checked it via SSH and it is there.

Share relevant logs or error messages

Traceback (most recent call last):
File “/usr/lib/python3.9/tarfile.py”, line 1712, in gzopen
t = cls.taropen(name, mode, fileobj, **kwargs)
File “/usr/lib/python3.9/tarfile.py”, line 1689, in taropen
return cls(name, mode, fileobj, **kwargs)
File “/usr/lib/python3.9/tarfile.py”, line 1552, in init
self.firstmember = self.next()
File “/usr/lib/python3.9/tarfile.py”, line 2357, in next
tarinfo = self.tarinfo.fromtarfile(self)
File “/usr/lib/python3.9/tarfile.py”, line 1116, in fromtarfile
buf = tarfile.fileobj.read(BLOCKSIZE)
File “/usr/lib/python3.9/gzip.py”, line 300, in read
return self._buffer.read(size)
File “/usr/lib/python3.9/_compression.py”, line 68, in readinto
data = self.read(len(byte_view))
File “/usr/lib/python3.9/gzip.py”, line 487, in read
if not self._read_gzip_header():
File “/usr/lib/python3.9/gzip.py”, line 435, in _read_gzip_header
raise BadGzipFile(‘Not a gzipped file (%r)’ % magic)
gzip.BadGzipFile: Not a gzipped file (b’./')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/yunohost”, line 77, in
yunohost.cli(
File “/usr/lib/python3/dist-packages/yunohost/init.py”, line 41, in cli
ret = moulinette.cli(
File “/usr/lib/python3/dist-packages/moulinette/init.py”, line 110, in cli
Cli(
File “/usr/lib/python3/dist-packages/moulinette/interfaces/cli.py”, line 500, in run
ret = self.actionsmap.process(args, timeout=timeout)
File “/usr/lib/python3/dist-packages/moulinette/actionsmap.py”, line 574, in process
return func(**arguments)
File “/usr/lib/python3/dist-packages/yunohost/backup.py”, line 2347, in backup_restore
restore_manager = RestoreManager(name)
File “/usr/lib/python3/dist-packages/yunohost/backup.py”, line 881, in init
self.info = backup_info(name, with_details=True)
File “/usr/lib/python3/dist-packages/yunohost/backup.py”, line 2512, in backup_info
tar = tarfile.open(
File “/usr/lib/python3.9/tarfile.py”, line 1659, in open
return func(name, filemode, fileobj, **kwargs)
File “/usr/lib/python3.9/tarfile.py”, line 1716, in gzopen
raise ReadError(“not a gzip file”)
tarfile.ReadError: not a gzip file

Can you do a small check to ensure the file looks to be consistent such as checking the file of the backup archive you copied on the server, versus the original file you copied from ?

1 Like

Is there an easy way to do it?

If you have access to your server via SSH, you can run ls -lh /home/yunohost.backup/archives/ to list files with a human-readable size

1 Like
-rw-r--r-- 1 kristijan kristijan 2.0G Feb 26 13:18 20241124-025102.tar.gz
-rw-r--r-- 1 kristijan kristijan 1.8G Feb 26 13:09 20241126-140029.tar.gz
-rw-r--r-- 1 root      root       935 Feb 26 13:21 20250226-132123.info.json
-rw-r--r-- 1 root      root      210K Feb 26 13:21 20250226-132123.tar

I get this. I tried two backups and in the end I tried to make a new bakcup from webadmin. That one is just .tar

Hmokay so i’m a bit confused which one you’re trying to restore exactly … alternatively you can try confirming that the app is indeed a .tar.gz by running:

file /home/yunohost.backup/archives/20241124-025102.tar.gz (or the other .tar.gz file)

it should return something a line containing “gzip compressed data

I get POSIX tar archive

So it looks like you copied the file as a .tar.gz where it’s in fact just a .tar ?

What if you rename it using

mv /home/yunohost.backup/archives/20241124-025102.tar.gz /home/yunohost.backup/archives/20241124-025102.tar

(or similarly for the other one)

1 Like

Thanks. I managed to restore it :smiling_face_with_three_hearts:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.