Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-19357

Fingerprint file is incorrect if ampersand character is part of the file name.

      If a file name contains an ampersand character then the XML file which is generated in the fingerprint directory is not correct.

      Example:
      <fileName>XYZ (x86 & x64Wow).abc</fileName>
      The ampersand must be written in a XML file with "& amp;":
      <fileName>XYZ (x86 & amp; x64Wow).abc</fileName>

      An error occurred after updating Jenkins and executing a job with the CopyArtifacts plugin.
      The following callstack was logged:

      09:26:07 at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyOne(FingerprintingCopyMethod.java:105)
      09:26:07 at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyAll(FingerprintingCopyMethod.java:68)
      09:26:07 at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:261)
      09:26:07 at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:238)
      09:26:07 at org.jenkinsci.plugins.conditionalbuildstep.BuilderChain.perform(BuilderChain.java:71)
      09:26:07 at org.jenkins_ci.plugins.run_condition.BuildStepRunner$2.run(BuildStepRunner.java:110)
      09:26:07 at org.jenkins_ci.plugins.run_condition.BuildStepRunner$DontRun.conditionalRun(BuildStepRunner.java:264)
      09:26:07 at org.jenkins_ci.plugins.run_condition.BuildStepRunner.perform(BuildStepRunner.java:105)
      09:26:07 at org.jenkinsci.plugins.conditionalbuildstep.ConditionalBuilder.perform(ConditionalBuilder.java:133)
      09:26:07 at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      09:26:07 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
      09:26:07 at hudson.model.Build$BuildExecution.build(Build.java:199)
      09:26:07 at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      09:26:07 at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
      09:26:07 at hudson.model.Run.execute(Run.java:1597)
      09:26:07 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      09:26:07 at hudson.model.ResourceController.execute(ResourceController.java:88)
      09:26:07 at hudson.model.Executor.run(Executor.java:247)
      09:26:07 Caused by: hudson.util.IOException2: Unable to read /var/lib/jenkins/fingerprints/b5/2a/838c36091ab3d0693f551b8bd49d.xml
      09:26:07 at hudson.XmlFile.read(XmlFile.java:147)
      09:26:07 at hudson.model.Fingerprint.load(Fingerprint.java:1211)
      09:26:07 at hudson.model.Fingerprint.load(Fingerprint.java:1199)
      09:26:07 at hudson.model.FingerprintMap.load(FingerprintMap.java:94)
      09:26:07 at hudson.model.FingerprintMap.load(FingerprintMap.java:45)
      09:26:07 at hudson.util.KeyedDataStorage.get(KeyedDataStorage.java:154)
      09:26:07 at hudson.model.FingerprintMap.get(FingerprintMap.java:79)
      09:26:07 at hudson.model.FingerprintMap.get(FingerprintMap.java:45)
      09:26:07 at hudson.util.KeyedDataStorage.getOrCreate(KeyedDataStorage.java:108)
      09:26:07 at hudson.model.FingerprintMap.getOrCreate(FingerprintMap.java:65)
      09:26:07 at hudson.plugins.copyartifact.FingerprintingCopyMethod.copyOne(FingerprintingCopyMethod.java:98)
      09:26:07 ... 17 more

          [JENKINS-19357] Fingerprint file is incorrect if ampersand character is part of the file name.

          We are also affected. In our case a matrix job was created that contained a label-expression-axis. The label contained an AND-conjunction (&&). The problem remains even after removing the label expression and deleting all builds that were made with the former configuration.

          Jenkins Log:

          Recording fingerprints
          ERROR: Failed to record fingerprints
          hudson.util.IOException2: Unable to read /var/lib/jenkins/fingerprints/d5/81/09a8248d03246c105969439fef56.xml
          at hudson.XmlFile.read(XmlFile.java:147)
          at hudson.model.Fingerprint.load(Fingerprint.java:1211)
          at hudson.model.Fingerprint.load(Fingerprint.java:1199)
          at hudson.model.FingerprintMap.load(FingerprintMap.java:94)
          at hudson.model.FingerprintMap.load(FingerprintMap.java:45)
          at hudson.util.KeyedDataStorage.get(KeyedDataStorage.java:154)
          at hudson.model.FingerprintMap.get(FingerprintMap.java:79)
          at hudson.model.FingerprintMap.get(FingerprintMap.java:45)
          at hudson.util.KeyedDataStorage.getOrCreate(KeyedDataStorage.java:108)
          at hudson.model.FingerprintMap.getOrCreate(FingerprintMap.java:65)
          at hudson.tasks.Fingerprinter$1Record.addRecord(Fingerprinter.java:208)
          at hudson.tasks.Fingerprinter.record(Fingerprinter.java:252)
          at hudson.tasks.Fingerprinter.perform(Fingerprinter.java:133)
          at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
          at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804)
          at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776)
          at hudson.model.Build$BuildExecution.post2(Build.java:183)
          at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726)
          at hudson.model.Run.execute(Run.java:1628)
          at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
          at hudson.model.ResourceController.execute(ResourceController.java:88)
          at hudson.model.Executor.run(Executor.java:247)
          Caused by: com.thoughtworks.xstream.converters.ConversionException: : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72)
          ---- Debugging information ----
          message : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72)
          cause-exception : com.thoughtworks.xstream.io.StreamException
          cause-message : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72)
          class : java.lang.String
          required-type : java.lang.String
          converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper
          wrapped-converter : com.thoughtworks.xstream.converters.basic.StringConverter
          path : /fingerprint/usages/entry[4]/string
          line number : 20
          class[1] : java.util.Hashtable
          converter-type[1] : com.thoughtworks.xstream.converters.collections.MapConverter
          class[2] : hudson.model.Fingerprint
          converter-type[2] : hudson.util.RobustReflectionConverter
          version : null
          -------------------------------
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
          at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
          at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71)
          at com.thoughtworks.xstream.converters.collections.MapConverter.putCurrentEntryIntoMap(MapConverter.java:86)
          at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:78)
          at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:72)
          at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:67)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333)
          at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275)
          at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
          at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
          at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061)
          at hudson.util.XStream2.unmarshal(XStream2.java:109)
          at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045)
          at com.thoughtworks.xstream.XStream.fromXML(XStream.java:925)
          at hudson.XmlFile.read(XmlFile.java:143)
          ... 21 more
          Caused by: com.thoughtworks.xstream.io.StreamException: : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72)
          at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124)
          at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148)
          at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135)
          at com.thoughtworks.xstream.io.xml.AbstractPullReader.getValue(AbstractPullReader.java:180)
          at com.thoughtworks.xstream.io.ReaderWrapper.getValue(ReaderWrapper.java:48)
          at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49)
          at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
          ... 46 more
          Caused by: org.xmlpull.v1.XmlPullParserException: entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72)
          at org.xmlpull.mxp1.MXParser.parseEntityRef(MXParser.java:2212)
          at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1275)
          at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
          at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109)
          ... 52 more
          Build step 'Record fingerprints of files to track usage' changed build result to FAILURE

          Steffen Templin added a comment - We are also affected. In our case a matrix job was created that contained a label-expression-axis. The label contained an AND-conjunction (&&). The problem remains even after removing the label expression and deleting all builds that were made with the former configuration. Jenkins Log: Recording fingerprints ERROR: Failed to record fingerprints hudson.util.IOException2: Unable to read /var/lib/jenkins/fingerprints/d5/81/09a8248d03246c105969439fef56.xml at hudson.XmlFile.read(XmlFile.java:147) at hudson.model.Fingerprint.load(Fingerprint.java:1211) at hudson.model.Fingerprint.load(Fingerprint.java:1199) at hudson.model.FingerprintMap.load(FingerprintMap.java:94) at hudson.model.FingerprintMap.load(FingerprintMap.java:45) at hudson.util.KeyedDataStorage.get(KeyedDataStorage.java:154) at hudson.model.FingerprintMap.get(FingerprintMap.java:79) at hudson.model.FingerprintMap.get(FingerprintMap.java:45) at hudson.util.KeyedDataStorage.getOrCreate(KeyedDataStorage.java:108) at hudson.model.FingerprintMap.getOrCreate(FingerprintMap.java:65) at hudson.tasks.Fingerprinter$1Record.addRecord(Fingerprinter.java:208) at hudson.tasks.Fingerprinter.record(Fingerprinter.java:252) at hudson.tasks.Fingerprinter.perform(Fingerprinter.java:133) at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20) at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:804) at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:776) at hudson.model.Build$BuildExecution.post2(Build.java:183) at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:726) at hudson.model.Run.execute(Run.java:1628) at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) at hudson.model.ResourceController.execute(ResourceController.java:88) at hudson.model.Executor.run(Executor.java:247) Caused by: com.thoughtworks.xstream.converters.ConversionException: : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) ---- Debugging information ---- message : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) cause-exception : com.thoughtworks.xstream.io.StreamException cause-message : : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) class : java.lang.String required-type : java.lang.String converter-type : com.thoughtworks.xstream.converters.SingleValueConverterWrapper wrapped-converter : com.thoughtworks.xstream.converters.basic.StringConverter path : /fingerprint/usages/entry [4] /string line number : 20 class [1] : java.util.Hashtable converter-type [1] : com.thoughtworks.xstream.converters.collections.MapConverter class [2] : hudson.model.Fingerprint converter-type [2] : hudson.util.RobustReflectionConverter version : null ------------------------------- at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:71) at com.thoughtworks.xstream.converters.collections.MapConverter.putCurrentEntryIntoMap(MapConverter.java:86) at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:78) at com.thoughtworks.xstream.converters.collections.MapConverter.populateMap(MapConverter.java:72) at com.thoughtworks.xstream.converters.collections.MapConverter.unmarshal(MapConverter.java:67) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at hudson.util.RobustReflectionConverter.unmarshalField(RobustReflectionConverter.java:333) at hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:275) at hudson.util.RobustReflectionConverter.unmarshal(RobustReflectionConverter.java:222) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66) at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50) at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134) at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1061) at hudson.util.XStream2.unmarshal(XStream2.java:109) at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1045) at com.thoughtworks.xstream.XStream.fromXML(XStream.java:925) at hudson.XmlFile.read(XmlFile.java:143) ... 21 more Caused by: com.thoughtworks.xstream.io.StreamException: : entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:124) at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:148) at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:135) at com.thoughtworks.xstream.io.xml.AbstractPullReader.getValue(AbstractPullReader.java:180) at com.thoughtworks.xstream.io.ReaderWrapper.getValue(ReaderWrapper.java:48) at com.thoughtworks.xstream.converters.SingleValueConverterWrapper.unmarshal(SingleValueConverterWrapper.java:49) at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72) ... 46 more Caused by: org.xmlpull.v1.XmlPullParserException: entity reference names can not start with character '&' (position: START_TAG seen ...<string>generateCodeCoverage/branch=release-7.4.0,label_exp=ant&&... @20:72) at org.xmlpull.mxp1.MXParser.parseEntityRef(MXParser.java:2212) at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1275) at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:109) ... 52 more Build step 'Record fingerprints of files to track usage' changed build result to FAILURE

          Thomas Oswald added a comment -

          see duplicate link

          Thomas Oswald added a comment - see duplicate link

            marcsanfacon Marc Sanfacon
            thomas_oswald Thomas Oswald
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: