Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SizeDiffPreviousPercent isn't working as expected #182

Closed
byalextran opened this issue Apr 16, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@byalextran
Copy link

commented Apr 16, 2019

I noticed I was using an incorrect MySQL password in my configuration.

When I updated the password, I was expecting the next update to throw an error because I had SizeDiffPreviousPercent set to 10% and the previous file size was 45 bytes (encrypted, 0 bytes raw). However, no error got thrown even though the new file size is 300+% bigger than the previous. I changed the value to 1% and ran another test that also resulted in no error.

Here you'll notice the three file sizes in question.

-rw-rw-r-- 1 alextran alextran      45 Apr 14 03:00 rsh-2019-04-14_0700.sql.bz2.enc
-rw-rw-r-- 1 alextran alextran   14735 Apr 15 03:00 rsh-2019-04-15_0700.sql.bz2.enc
-rw-rw-r-- 1 alextran alextran      45 Apr 15 23:11 rsh-2019-04-16_0311.sql.bz2.enc

The first being the backup with the wrong password. the second the right password. And the third the wrong password with SizeDiffPreviousPercent set to 1%. From my configuration, I would've assumed the last two backups would've thrown an error, but they didn't (I'm running 5.1.11).

Anyway, thought i'd mention it here.

And it's worth noting i'm a big fan of phpbu despite my two bug reports. Don't want to just be submitting bug reports without expressing any gratitude. ;) I appreciate the work you've put into phpbu. I'm glad i stumbled across it the other day and am confident it'll serve me well for the foreseeable future.

Thanks!

@sebastianfeldmann

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2019

Uhh that sounds not good. I’ll look into this ASAP.

Thank you. I really appreciate you taking the time and reporting those bugs. And thanks you for doing it the way you do. Precise, friendly and constructive. You make it quite easy for me :)

@sebastianfeldmann sebastianfeldmann self-assigned this Apr 16, 2019

sebastianfeldmann added a commit that referenced this issue Apr 16, 2019

Fix size diff check - issue #182
Some time ago the collectors where changed to return the current backup
as well. That change was never reflected withing the size diff check.
So the size diff check always checked the size difference against the
current backup, which resulted in 0% change all the time.

sebastianfeldmann added a commit that referenced this issue Apr 16, 2019

Fix size diff check - issue #182
Some time ago the collectors where changed to return the current backup
as well. That change was never reflected withing the size diff check.
So the size diff check always checked the size difference against the
current backup, which resulted in 0% change all the time.
@sebastianfeldmann

This comment has been minimized.

Copy link
Owner

commented Apr 16, 2019

phpbu provides something called Collectors. Those Collectors are responsible to find all backups either on your local drive or on your remote cloud storage.
Someday in the past Collectors where changed to return the current backup as well. This change was never reflected in the CheckSizeDiffPercent check.
So the check did compare the current size to the last element the collector returned. Since this is now the current backup the check always compared the current backup size to the current backup size which results in a 0% difference.

I fixed the issue by comparing the current backup to the second last, so now you should se a difference in size after all.

I also added to debug outputs for the CheckSizeDiffPercent check so if you run, phpbu --debug you get some hints what the check is actually doing.

You can get the fix by upgrading to version 5.2.2

$ phpbu --self-update

Thanks again for reporting this

@sebastianfeldmann sebastianfeldmann added this to the 5.2 milestone Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.