-
Notifications
You must be signed in to change notification settings - Fork 25
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
Backup with -test fails when -replace or -to is used #112
Comments
After further testing, looks like -find and -replace do not do anything when used with backup command. But, the -test switch should work either way, IMHO. |
find/replace seems to work right
then
|
If you want to change the stored path, you should use -to -find and -replace are for restoring (or checking) files
|
Three completely different things Backup command (or add): -find/-replace (-to) change the source path to something else The testbackup command, without the -paranoid switch, operates not on the contents of the archives, but on the files themselves. The test command, with a parameter compare SHA-1 fragments (of the archived files) with the SHA-1 "pieces" (of the filesystem). In this case -find/-replace (and -to) is used to "translate" the stored paths with the filesystem paths WHERE THE SOURCE files are => you should use THREE different commands with different -find/-replace (-to)
Then there is the parameterless t (test) command, which still does other things => Normally, if paths are not "treacherously" changed, there is no need for any -find, -replace, -to Normally they are used instead in the case of zfs snapshots, to unify the paths |
The -paranoid switch (in testbackup) will check that the filenumber and filesize (inside the zpaq's index archive) is == the filenumber and filesize (from the chunked pieces) Example When archive files are separated they can be "shuffled," corrupted, deleted etc. When the file (as by default) is one, this does not happen Translation With a monolithic file you will have a 100GB .zpaq today. Tomorrow you will have a 101GB zpaq local file After that (tomorrow) you will get a 102GB zpaq local file |
The problem arises when you want to check that your local 102GB file is identical to the remote 102GB file If you use a multipart archive instead, you will have (in our example) a first 100GB file, then a 1GB file, and a 1GB file (one for day) So you will do a loop like this meta-script BTW there are last and last2 commands, in zpaqfranz, to do... exactly this duty Basically for checking the REMOTE copy you will use a hash comparison (with the local one) If the LOCAL stored-archive is correct (aka: unpackable), and the REMOTE's hash match the local one, then by the transitive property the REMOTE copy is correct In short, these are mechanisms for handling verification of large-scale (hundreds of GB) remote copies, even on anemic systems (Atom, VPS etc) |
The problem that needs to be addressed is the possibility that the remote copy was not properly uploaded (due to a problem during upload), or that it was modified later. |
Thank you for all the information. it was very helpful. Some of it I was aware of and some is new to me. If I understand you correctly, you are suggesting that the error may be related to the fact that the archive that is generated is somehow corrupt. Basically, this error prevents me from using the -test switch in a script. Because what happens then is the script detects non 0 exit code and stops processing further commands, sends a failure notification to me which then forces me to spend time troubleshooting, but since the archive is actually fine, it ends up being a total waste of time.
|
If I understand correctly you want string manipulation in the test function as well. |
60_1g.zip
Then this is NOT good, of course
BUT now you can use -to
or "low level" find/replace
|
I think it is good to re-explain that the t command with one (or more) paths does NOT perform a decompression test of the archive But a comparison of the tree from the filesystem with the files inside the archive So the first step of the test is lexicographic, that is, the file names (from the filesystem) must be == to those in the archive The second step is to check the SHA-1 hash blocks between the files (in the filesystem) and those in the archive. In this step the .zpaq file is NOT expanded or processed in any way. There is NO guarantee that the files are actually "decompressable". Processing speed can be high, or low, depending on various circumstances (CPU speed and mass media) The third (optional) step occurs if the -checksum (or -verify or -paranoid) switch is used. |
The command that actually decompresses the data, simulating an extraction, is t WITHOUT one or more folders.
Now you know that you can decompress the data (or at least no errors are detected)
In this scenario you first have the decompressibility check (and recalculated CRC-32s) and then the filesystem match check If you want to have a higher level of security (!) you will have to write down a data extraction.
If you do not want (or can) write, but you have plenty of RAM (aka: the largest decompressed file in the archive must be smaller than available RAM -10%) there is the w command Finally there is the paranoid command (!) |
Here you have a FILE ("/volume1/snapshots/print$") than the t with parameter (SHA1-chunked) will be called |
The 60 version is not working on the Synology where I need to test it. Looks like it now requires libc.so and the versions do not match between my development machine and the Synology.
This is going to break portability for Linux users, unless you force GLIBC 2.2.5. Basically, reliance on glibc makes it so a development machine and a production machines have to either be the same glibc version or a production machine has to be newer than a development machine. |
??? There is the source code |
Sorry, what do you mean ? |
You can compile yourself the program |
I did. I compiled on a RedHat machine and ran on a Synology machine and that was the error. In the latest version you are using functions that rely on GLIBC library. My RedHat machine has GLIBC 2.28 which becomes the required version of zpaqfranz after it is compiled, however, the Synology machine has GLIBC 2.26 and that's what causes the error. |
Sorry, I do not have "real" Synology |
It doesn't have to be Synology. It just has a Linux OS under the hood. To test it, you need 2 Linux OS, one newer, one older. 2 versions of Ubuntu will do (or any Linux OS you prefer) In a command prompt type in Compile zpaqfranz on a newer version and then run it on the older one and you will get that error. |
As for Synology, you can run one in a container for testing purposes. |
What is the latest version you can run on synology? |
Of zpaqfranz ? 59.9 was running fine. Whatever changes you made in version 60 now require GLIBC library. |
I struggle to understand what the problem is. On Synology (arm) I use a statically compiled version. There is no dynamic library (except for downloading from the internet, but no one cares) |
Our Synology is Intel. I used the Make file you provided. I can try compiling statically if you could provide the command I need to run. |
I ran I will post if I find anything linked to GLIBC version. Debugging this may take a while. |
This is the very last zpaqfranz cross-compiled (on Debian 11) for arm, statically linked running on a physical Annapurna-powered (arm) QNAP NAS Please try the attached (just a quick workaroud) with
|
This is an Intel Synology DSM 7.2 running a Debian-11 (static) compiled latest executable
Please le me know if this runs on your physical Synology |
DSM 7.2 has GLIBC 2.36 which will work fine. I was using it on DSM 7.1 which has GLIBC 2.26. After running Version 59.9 doesn't have that function. Edit: From further tests that I ran it looks like that This command will give you all GLIBC versions required for an elf executable:
|
I will try to explain what happened here. Basically GLIBC is part of the OS and each distribution version comes with a version of GLIBC which doesn't change. See here: https://gist.github.com/richardlau/6a01d7829cc33ddab35269dacc127680 For example my RedHat 8 has GLIBC 2.28 and Synology DSM 7.1 has GLIBC 2.26 In order for you to get that error, you would have to compile on Debian 11, but run the file on Debian 9. So GLIBC is not reverse compatible, meaning you cannot run an app that was compiled with GLIBC 2.28 on any distro where GLIBC < 2.28. Otherwise you get an error as I posed above. One note though, this rule only applies if an app uses GLIBC functions of newer version, otherwise, it would make no difference as with version 59.9 of zpaqfranz which mostly uses GLIBC 2.2.5 and 2.3. So this issue will come up with any user who has a production system where GLIBC version is lower than the development system. I understand that a lot of users will run zpaqfranz on the same machine where it was compiled, but it is not the case for companies with IT departments or even Devs with a lot of different code. In any case, the GLIBC issue is not a bug, but by design. I will try to see if I can find a workaround. I think I have code with examples how to force GLIBC to version 2.2.5 (universally compatible with all modern Linux systems, old and new) Edit: However, as stated above, this won't work as |
It doesn't work for the reasons explained above. I get the same error. |
What does that mean ? Is it still zpaq archive format ? |
Would you be able to update version 59.9 to resolve the -test switch ? |
It is newest zpaqfranz archive format |
I would say no, but I can make 60 executable even for old systems |
Well, it doesn't even matter what command I use or if I understand how it works. I simply reported a bug. A function should only throw an error if an error was detected. But, an error is thrown where there is no error. It is up to you if you want to fix the reported issue or not. |
Ok. I appreciate the time you spent on this issue. I will wait for version 60 that works on older systems and is production ready. I can't use alpha releases for anything other than testing. |
60_1k.zip
|
Seems to work. I did an extraction and all the files were extracted without error. I did get an error when compiling that relates to update function, but that's very minor. when compiling:
when running
|
Backed up with -test switch then verified with t command using different switches. All commands returned (all OK). The issue is resolved. Let me know if you want me to test the update function later. |
I think I found another bug related to backup command and -to switch. Basically if I run this command multiple times, it duplicates the number of files in the index file:
Result: Then I ran the same command again and it shows that another 188 files were added with the same output, but the actual archive size seems to suggest that wasn't the case. The first archive test_00000001.zpaq is 39.1 MB in size - that's correct. Then I ran Result:
This doesn't happen when I omit the -to switch. Ran the following command 2 times:
Then
Result:
|
Do you have any .xls or .ppt file? |
Found. It is indeed a bug, albeit a modest one (the file gets bigger). You need to change this line
|
testbackup command (all OK) Everything is working in relation to this bug. Much appreciated. It is now fully resolved. I will wait for a prod release of version 60. |
Hi again.
I've ran into another bug. When using backup command together with -find "string1" -replace "string2", the verification at the end fails due to the fact that the archive contains paths modified with -replace.
Example:
sudo zpaqfranz backup "/mnt/b2/print$" "/volume1/snapshots/print$" -find "/volume1/snapshots" -replace "/volume1" -verbose -index "/volume1/NetBackup" -test
In this case everything goes well, but then verification fails at the end.
00000193 +external (file missing in ZPAQ)
The text was updated successfully, but these errors were encountered: