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

a job dedicated to copyartifacts from a build specified by a build paramter (ie a run parameter) fails when launched manuallyco

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Defect
    • Component/s: copyartifact-plugin
    • Labels:
      None
    • Environment:
      Jenkins ver. 1.450
      copy artifacts plugin v1.21
    • Similar Issues:
      Show 5 results

      Description

      The tested job is minimalist:

      • it defines a Run parameter (named "IFW") to select a build from the job "IFW"
      • it defines a "copy artifacts from another project" specified by a "build parameter", the parameter name beeing "IFW", and selectif the followinfg artifacts "**/*zip"

      When manually launching the job, selecting the (succesful) last build of the IFW job, I got the following error:

      FATAL: : only whitespace content allowed before start tag and not h (position: START_DOCUMENT seen h... @1:1)
      com.thoughtworks.xstream.io.StreamException: : only whitespace content allowed before start tag and not h (position: START_DOCUMENT seen h... @1:1)
      at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:78)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.readRealEvent(AbstractPullReader.java:154)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.readEvent(AbstractPullReader.java:147)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.move(AbstractPullReader.java:126)
      at com.thoughtworks.xstream.io.xml.AbstractPullReader.moveDown(AbstractPullReader.java:111)
      at com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:48)
      at com.thoughtworks.xstream.io.xml.XppDriver.createReader(XppDriver.java:44)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:856)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:848)
      at hudson.plugins.copyartifact.BuildSelectorParameter.getSelectorFromXml(BuildSelectorParameter.java:81)
      at hudson.plugins.copyartifact.ParameterizedBuildSelector.getBuild(ParameterizedBuildSelector.java:52)
      at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:164)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
      at hudson.model.Build$RunnerImpl.build(Build.java:178)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:470)
      at hudson.model.Run.run(Run.java:1409)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:238)
      Caused by: org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not h (position: START_DOCUMENT seen h... @1:1)
      at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1519)
      at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
      at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
      at com.thoughtworks.xstream.io.xml.XppReader.pullNextEvent(XppReader.java:63)
      ... 20 more

        Attachments

          Activity

          Hide
          mindless Alan Harder added a comment -

          oh, I was right there was confusion, but just now I figured out what it was... I see that "Run parameter" is one of the choices for the types of parameters you can add in a job, and indeed you can make one for picking a particular build from a particular project, like "IFW". Copy Artifact's "from build parameter" option does not support this type of parameter. It only supports the "Build selector for Copy Artifact" type of build parameter. You can select "specific build" here, but you have to type the build number.. you won't get a list of existing build numbers the way a "Run parameter" shows.

          Show
          mindless Alan Harder added a comment - oh, I was right there was confusion, but just now I figured out what it was... I see that "Run parameter" is one of the choices for the types of parameters you can add in a job, and indeed you can make one for picking a particular build from a particular project, like "IFW". Copy Artifact's "from build parameter" option does not support this type of parameter. It only supports the "Build selector for Copy Artifact" type of build parameter. You can select "specific build" here, but you have to type the build number.. you won't get a list of existing build numbers the way a "Run parameter" shows.
          Hide
          mindless Alan Harder added a comment -

          Closing. If you like you can file a feature request to support "Run parameter" for the build selector (though I have no plans to implement it).

          Show
          mindless Alan Harder added a comment - Closing. If you like you can file a feature request to support "Run parameter" for the build selector (though I have no plans to implement it).
          Hide
          abatkin Adam Batkin added a comment -

          How is this not a defect? The error message gives no indication of what was wrong or where to even start debugging the issue. Literally the best you can do is Google the message and hope that you find this bug. Google should be the last resort, not the only option.

          Show
          abatkin Adam Batkin added a comment - How is this not a defect? The error message gives no indication of what was wrong or where to even start debugging the issue. Literally the best you can do is Google the message and hope that you find this bug. Google should be the last resort, not the only option.
          Hide
          anentropic Anentropic added a comment -

          +1 to Adam's comment, this is confusing and frustrating

          using a "Build selector for Copy Artifact" parameter is not possible because it does not provide a way to select a build from another project (the upstream and downstream options are too restrictive)

          a "Run parameter" makes the necessary selection possible, and should have been reused, but it seems it is not possible for Copy Artifacts to use that kind of parameter, I tried:

          • "specified by a build parameter" ...already noted above doesn't work
          • "specific build" and $ {MY_RUN_PARAM_NAME}

            as the value ...doesn't work

          Show
          anentropic Anentropic added a comment - +1 to Adam's comment, this is confusing and frustrating using a "Build selector for Copy Artifact" parameter is not possible because it does not provide a way to select a build from another project (the upstream and downstream options are too restrictive) a "Run parameter" makes the necessary selection possible, and should have been reused, but it seems it is not possible for Copy Artifacts to use that kind of parameter, I tried: "specified by a build parameter" ...already noted above doesn't work "specific build" and $ {MY_RUN_PARAM_NAME} as the value ...doesn't work
          Hide
          anentropic Anentropic added a comment -

          I've opened a feature request here and will try and get a pull request ready
          https://issues.jenkins-ci.org/browse/JENKINS-31569

          Show
          anentropic Anentropic added a comment - I've opened a feature request here and will try and get a pull request ready https://issues.jenkins-ci.org/browse/JENKINS-31569

            People

            • Assignee:
              mindless Alan Harder
              Reporter:
              christophem christopheM
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: