krateng / maloja

Self-hosted music scrobble database to create personal listening statistics and charts
https://maloja.krateng.ch
GNU General Public License v3.0
1.18k stars 69 forks source link

Maloja backup names tar as `tar.gz` but returns a POSIX tar archive (ungzipped) #318

Open Bujiraso opened 10 months ago

Bujiraso commented 10 months ago

Steps to Reproduce

  1. Click Backup image image
  2. Navigate to back-up download in a terminal
  3. gunzip it or tar -zxf it to untar from gzip

Expected Result

Untarred files

Actual Result

Error that it's not gzipped.

$ tar -zxvf maloja_backup.tar.gz 

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

Details

file(1) shows that it is not actually gzipped

$ file maloja_backup.tar.gz
maloja_backup.tar.gz: POSIX tar archive

Suspected Root-Cause

I took a look over https://github.com/krateng/maloja/blob/master/maloja/proccontrol/tasks/backup.py#L20 and the syntax for creating a gzip looks right and works locally when I run it with python in a terminal, so I'm inclined to say this is a network transfer oddity. Perhaps something in the web framework (bottle, is it?) might be stripping the gzip layer when sending it over.