jfrog / build-info

Artifactory's open integration layer for CI build servers
https://www.buildinfo.org
Apache License 2.0
147 stars 155 forks source link

BuildInfoExtractorUtils#searchAdditionalPropertiesFile(...) fails with "Malformed \uxxxx encoding " #799

Open rzo1 opened 1 month ago

rzo1 commented 1 month ago

Describe the bug

As reported in https://github.com/jfrog/jenkins-artifactory-plugin/issues/913, the BuildInfoExtractorUtils might fail due to "Malformed \uxxxx encoding " in some rare occasions.

To Reproduce We didn't manage to reproduce it, because it is merly impossible to debug which file is causing it in a production environment running Jenkins CI

Expected behavior The extractor shouldn't hard fail here. Maybe we can (silently?) ignore the exception or catch it accordingly as proposed in https://github.com/jfrog/jenkins-artifactory-plugin/issues/913#issuecomment-2193934002.

Versions

Additional context Add any other context about the problem here.

rzo1 commented 1 month ago

Wonder, if we can add a

Index: build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java b/build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java
--- a/build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java (revision b82ee0627bd002fc987e85898d3ba48f950a6366)
+++ b/build-info-extractor/src/main/java/org/jfrog/build/extractor/BuildInfoExtractorUtils.java (date 1721392549052)
@@ -114,7 +114,7 @@
                 }
             }
         } catch (IOException | InvalidAlgorithmParameterException | IllegalBlockSizeException | NoSuchPaddingException |
-                 BadPaddingException | NoSuchAlgorithmException | InvalidKeyException e) {
+                 BadPaddingException | NoSuchAlgorithmException | InvalidKeyException | IllegalArgumentException e) {
             throw new RuntimeException("Unable to load build info properties from file: " + propertiesFile.getAbsolutePath(), e);
         }
         return props;

for now, so it becomes more evident in https://github.com/jfrog/jenkins-artifactory-plugin/issues/913 which file actually causes this behaviour. Wdyt?