@@ -1707,6 +1707,8 @@ public static S3AccessIO getS3AccessForDirectUpload(Dataset dataset) {
1707
1707
1708
1708
public static void validateDataFileChecksum (DataFile dataFile ) throws IOException {
1709
1709
DataFile .ChecksumType checksumType = dataFile .getChecksumType ();
1710
+
1711
+ logger .info (checksumType .toString ());
1710
1712
if (checksumType == null ) {
1711
1713
String info = BundleUtil .getStringFromBundle ("dataset.publish.file.validation.error.noChecksumType" , Arrays .asList (dataFile .getId ().toString ()));
1712
1714
logger .log (Level .INFO , info );
@@ -1720,6 +1722,7 @@ public static void validateDataFileChecksum(DataFile dataFile) throws IOExceptio
1720
1722
storage .open (DataAccessOption .READ_ACCESS );
1721
1723
1722
1724
if (!dataFile .isTabularData ()) {
1725
+ logger .info ("It is not tabular" );
1723
1726
in = storage .getInputStream ();
1724
1727
} else {
1725
1728
// if this is a tabular file, read the preserved original "auxiliary file"
@@ -1738,7 +1741,9 @@ public static void validateDataFileChecksum(DataFile dataFile) throws IOExceptio
1738
1741
1739
1742
String recalculatedChecksum = null ;
1740
1743
try {
1744
+ logger .info ("Before calculating checksum" );
1741
1745
recalculatedChecksum = FileUtil .calculateChecksum (in , checksumType );
1746
+ logger .info ("Checksum:" + recalculatedChecksum );
1742
1747
} catch (RuntimeException rte ) {
1743
1748
recalculatedChecksum = null ;
1744
1749
} finally {
@@ -1757,6 +1762,9 @@ public static void validateDataFileChecksum(DataFile dataFile) throws IOExceptio
1757
1762
if (!recalculatedChecksum .equals (dataFile .getChecksumValue ())) {
1758
1763
// There's one possible condition that is 100% recoverable and can
1759
1764
// be automatically fixed (issue #6660):
1765
+ logger .info (dataFile .getChecksumValue ());
1766
+ logger .info (recalculatedChecksum );
1767
+ logger .info ("Checksums are not equal" );
1760
1768
boolean fixed = false ;
1761
1769
if (!dataFile .isTabularData () && dataFile .getIngestReport () != null ) {
1762
1770
// try again, see if the .orig file happens to be there:
@@ -1786,6 +1794,7 @@ public static void validateDataFileChecksum(DataFile dataFile) throws IOExceptio
1786
1794
}
1787
1795
1788
1796
if (!fixed ) {
1797
+ logger .info ("checksum cannot be fixed" );
1789
1798
String info = BundleUtil .getStringFromBundle ("dataset.publish.file.validation.error.wrongChecksumValue" , Arrays .asList (dataFile .getId ().toString ()));
1790
1799
logger .log (Level .INFO , info );
1791
1800
throw new IOException (info );
0 commit comments