I've automated a process that involves fetching a file from a backup server and them processing it.
Sometimes the processing phase fails and I thought it might be due to the source file being corrupted.
I've found that even when it fails, the md5 of copied file matches the md5 of the file in the backup server. So as an additional sanity check I decided to test the integrity of the .gz file.
Storage machine
md5sum file-2021-08-31-05_15.sql.gz
962b4916651daf54372f25d55e7ee2d2 file-2021-08-31-05_15.sql.gz
gunzip -v -t file-2021-08-31-05_15.sql.gz
file-2021-08-31-05_15.sql.gz: OK
Machine 1
md5sum file-2021-08-31-05_15.sql.gz
962b4916651daf54372f25d55e7ee2d2 file-2021-08-31-05_15.sql.gz
gunzip -v -t file-2021-08-31-05_15.sql.gz
file-2021-08-31-05_15.sql.gz:
gzip: file-2021-08-31-05_15.sql.gz: invalid compressed data--crc error
gzip: file-2021-08-31-05_15.sql.gz: invalid compressed data--length error
Machine 2
md5sum file-2021-08-31-05_15.sql.gz
962b4916651daf54372f25d55e7ee2d2 file-2021-08-31-05_15.sql.gz
gunzip -v -t file-2021-08-31-05_15.sql.gz
file-2021-08-31-05_15.sql.gz: OK
Question:
How is it possible the "file-2021-08-31-05_15.sql.gz" has the same md5 in the 3 machines, but in only one of them the "gunzip -v -t" fails?