ayufan / pve-patches

Repository with public Proxmox patches
223 stars 54 forks source link

Error on 5.4-3 #17

Closed bdallen closed 5 years ago

bdallen commented 5 years ago

ERROR: Backup of VM 102 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. INFO: stat: missing operand INFO: Try 'stat --help' for more information.

Full backup set to every 7, with Max Backups set to 14

tillo commented 5 years ago

I have a very similar issue, probably the same.

INFO: starting new backup job: vzdump --mailnotification failure --storage --node --all 1 --quiet 1 --maxfiles 3 --mailto

--mode snapshot --fullbackup 4 --compress lzo ERROR: Backup of VM 101 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. ERROR: Backup of VM 102 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. ERROR: Backup of VM 109 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. ERROR: Backup of VM 110 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. ERROR: Backup of VM 113 failed - Day '' out of range 1..31 at /usr/share/perl5/PVE/VZDump.pm line 824. INFO: Backup job finished with errors

I noticed that the 5.4 patch has introduced a change in that section, compared to the 5.3 patch:

@@ -421,10 +421,10 @@
 -   }
 +    my $fullbackup = undef;
 +    if ($opts->{fullbackup} && !$opts->{stdout}) {
++        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
 +        my $bklist = get_backup_file_list($opts->{dumpdir}, $bkname);
 +        $bklist = [ sort { $b->[1] <=> $a->[1] } @$bklist ];
-+        my $mintime = timelocal ($lt->sec, $lt->min, $lt->hour,
-+        $lt->mday, $lt->mon, $lt->year) -
++        my $mintime = timelocal($sec, $min, $hour, $mday, $mon, $year) -
 +        $opts->{fullbackup} * 24 * 60 * 60 -
 +        12 * 60 * 60; # - 12h just to make sure that on last day we create full backup
 +

I can't explain why this new code doesn't work - it works when I tested it independently... But I'm wondering if the change is really necessary, because $lt is still initialised from localtime() just a few lines back.

I will try and revert this portion of the patch and see if it fixes the issue.

tillo commented 5 years ago

I confirm, this fixes the issue. Any since this is the only change in the 5.4-5 patch, it also means that the last patch that works for PVE 5.4-3 is patch 5.3-9.

For the OP and whomever will encounter the same error, the fix is as simple as this:

./pve-5.4-5-diff-backup-addon revert
./pve-5.3-9-diff-backup-addon apply

Like the OP, I thought I should wait for the first 5.4-x patch after migrating to PVE 5.4... but the latest 5.3 worked just fine. It's a bit counterintuitive, but makes sense.

ayufan commented 5 years ago

I usually do small fixes and mark that against the version that patch was created, so sometimes the 5.4-5 might work with earlier versions.

I usually grab pve from pvetest repo.