uboslinux / ubos-admin

UBOS administration tools
Other
15 stars 3 forks source link

Backup error #803

Closed jernst closed 3 years ago

jernst commented 3 years ago
INFO : ubos-admin backup --all --backuptodirectory . -v
INFO : Setting device state to: in maintenance
INFO : Suspending sites
IO error: creating symbolic link : File exists 
 at /usr/share/perl5/vendor_perl/UBOS/BackupOperation.pm line 316.
ERROR: 
INFO : Resuming sites
INFO : Backup sent to: ./site-multi-f322f5094e0c865b7a566e113b8123133315b7e4-20210105032701.ubos-backup
INFO : Setting device state to: operational

And

lrwxrwxrwx 1 root     root              12 Jan  5 04:33 'IO::File=GLOB(0x55c38e1ab0f8)' -> ./Thumbnails
-rw-r--r-- 1 root     root     39619730496 Jan  5 04:33  site-multi-f322f5094e0c865b7a566e113b8123133315b7e4-20210105032701.ubos-backup
jernst commented 3 years ago

This appears to be a rather strange bug inside Perl::Archive::Zip::Member.pm sub _writeData. More investigation required.

Also, we should add symlinks via code like this:

my $newMember = Archive::Zip::Member->newFromString(readlink $fileName, $newName);
$newMember->{'externalFileAttributes'} = 0xA1FF0000;
$self->addMember($newMember);

(from Archive::Zip)

jernst commented 3 years ago

This test data reproduces the problem:

drwxr-xr-x 1 http http 40 Jan 10 04:31 /ubos/lib/nextcloud/a26fd59cbd3fe71fec094976a3b38dd38daab1a5d/data/admin/files
drwxr-xr-x 1 http http 20 Jan 10 04:33 '/ubos/lib/nextcloud/a26fd59cbd3fe71fec094976a3b38dd38daab1a5d/data/admin/files/dir with space'
lrwxrwxrwx 1 root root 3 Jan 10 04:33 '/ubos/lib/nextcloud/a26fd59cbd3fe71fec094976a3b38dd38daab1a5d/data/admin/files/dir with space/Thumbnails' -> xyz
lrwxrwxrwx 1 root root 14 Jan 10 04:31 /ubos/lib/nextcloud/a26fd59cbd3fe71fec094976a3b38dd38daab1a5d/data/admin/files/foobar -> 'dir with space'

but somehow we need to have all of those components.