• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • other
    • None

      As was reported in the thread http://groups.google.com/group/jenkinsci-users/browse_thread/thread/1f269f9ccad08fd9# the XML API is broken as of 1.399ish:

      When I try to use the XML API to fetch some information about aproject's latest build i.e.http://jenkins/job/foo/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top I get an error:

      Status Code: 500
      
      Exception: 
      Stacktrace:
      hudson.util.IOException2: Error on line 1 of document  : Element type "origin" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "origin" must be followed by either attribute specifications, ">" or "/>".
      	at hudson.model.Api.doXml(Api.java:142)
      	at sun.reflect.GeneratedMethodAccessor650.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:282)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:149)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:88)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:102)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:204)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:204)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      	at org.kohsuke.stapler.MetaClass$7.doDispatch(MetaClass.java:242)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:562)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:640)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:478)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:160)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
      	at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.basicauth.BasicProcessingFilter.doFilter(BasicProcessingFilter.java:173)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:66)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      	at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
      	at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
      	at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
      	at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
      	at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
      	at java.lang.Thread.run(Thread.java:636)
      Caused by: org.dom4j.DocumentException: Error on line 1 of document  : Element type "origin" must be followed by either attribute specifications, ">" or "/>". Nested exception: Element type "origin" must be followed by either attribute specifications, ">" or "/>".
      	at org.dom4j.io.SAXReader.read(SAXReader.java:482)
      	at org.dom4j.io.SAXReader.read(SAXReader.java:365)
      	at hudson.model.Api.doXml(Api.java:100)
      	... 62 more
      Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 163; Element type "origin" must be followed by either attribute specifications, ">" or "/>".
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:391)
      	at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1391)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.seekCloseOfStartTag(XMLDocumentFragmentScannerImpl.java:1366)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:245)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
      	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
      	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
      	at org.dom4j.io.SAXReader.read(SAXReader.java:465)
      	... 64 more
      

      If I try to use a more basic URL: http://jenkins/job/foo/lastSuccessfulBuild/api/xml I get:

      This page contains the following errors:
      
      error on line 1 at column 162: error parsing attribute name
      Below is a rendering of the page up to the first error.
      
      Started by an SCM change
      

      yet the JSON and Python APIs for the same URL work just fine: http://jenkins/job/foo/lastSuccessfulBuild/api/xml

      {"actions":[{"causes":[{"shortDescription":"Started by an SCM
      change"}]},{},{"buildsByBranchName":{"...":
      ...
      ,"changeSet":{"items":[],"kind":null},"culprits":[]}
      

          [JENKINS-8988] xml api broken in 1.399

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/5367ba36b8a1727f11b968670e5421638501f6df
          Log:
          JENKINS-8988 picking up new Stapler that fies the XML API issue.

          Compare: https://github.com/jenkinsci/jenkins/compare/a39141b^...5367ba3

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml http://jenkins-ci.org/commit/jenkins/5367ba36b8a1727f11b968670e5421638501f6df Log: JENKINS-8988 picking up new Stapler that fies the XML API issue. Compare: https://github.com/jenkinsci/jenkins/compare/a39141b ^...5367ba3

          kutzi added a comment -

          Can this issue be closed now?

          kutzi added a comment - Can this issue be closed now?

          Brian Murrell added a comment -

          No. As I reported two comments ago, it does not seem to be working completely. For some jobs an API path of api/xml?xpath=//artifact/displayPath&wrapper=top seems to return the job's artifacts and for other jobs it does not. In the case of it not working, the response I get is:

          <top/>

          The same URL without the api/xml?xpath=//artifact/displayPath&wrapper=top trailer (i.e. in a browser) most definitely has artifacts in it. And I can even get the whole XML output from the job with:

          https://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml

          But as soon as I try to narrow the scope of the XML with an xpath such as:

          https://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top

          all I get is the "<top/>".

          Brian Murrell added a comment - No. As I reported two comments ago, it does not seem to be working completely. For some jobs an API path of api/xml?xpath=//artifact/displayPath&wrapper=top seems to return the job's artifacts and for other jobs it does not. In the case of it not working, the response I get is: <top/> The same URL without the api/xml?xpath=//artifact/displayPath&wrapper=top trailer (i.e. in a browser) most definitely has artifacts in it. And I can even get the whole XML output from the job with: https://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml But as soon as I try to narrow the scope of the XML with an xpath such as: https://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top all I get is the "<top/>".

          kutzi added a comment -

          The comment after that said, that something was committed to fix the issue.
          Have you tried it with current Jenkins versions?

          kutzi added a comment - The comment after that said, that something was committed to fix the issue. Have you tried it with current Jenkins versions?

          kutzi added a comment -

          Cannot reproduce it e.g. here http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top

          Can you show the XML for a not working case without the '?xpath=//artifact/displayPath&wrapper=top' ?

          kutzi added a comment - Cannot reproduce it e.g. here http://ci.jenkins-ci.org/view/Jenkins%20core/job/jenkins_main_trunk/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top Can you show the XML for a not working case without the '?xpath=//artifact/displayPath&wrapper=top' ?

          Brian Murrell added a comment -

          We are at 1.423 now and this issue is still reproducible. From the URL:

          http://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top

          all I get is:

          <top/>
          

          However from

          http://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml

          I get the job's full XML output:

          <matrixRun><action><cause><shortDescription>Started by upstream project "foo" build number 231</shortDescription><upstreamBuild>231</upstreamBuild><upstreamProject>foo</upstreamProject><upstreamUrl>job/foo/</upstreamUrl></cause></action><action><buildsByBranchName><originmaster><buildNumber>231</buildNumber><revision><SHA1>...</SHA1><branch><SHA1>...</SHA1><name>origin/master</name></branch></revision></originmaster></buildsByBranchName><lastBuiltRevision><SHA1>...</SHA1><branch><SHA1>...</SHA1><name>origin/master</name></branch></lastBuiltRevision></action><action></action><action></action><action></action><artifact><fileName>filelists.xml.gz</fileName><relativePath>artifacts/repodata/filelists.xml.gz</relativePath></artifact><artifact><fileName>other.xml.gz</fileName><relativePath>artifacts/repodata/other.xml.gz</relativePath></artifact><artifact><fileName>primary.xml.gz</fileName><relativePath>artifacts/repodata/primary.xml.gz</relativePath></artifact><artifact><fileName>repomd.xml</fileName><relativePath>artifacts/repodata/repomd.xml</relativePath></artifact><artifact><fileName>foo1-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-debuginfo-common-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-debuginfo-common-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-devel-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-devel-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-headers-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-headers-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-foo3-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-foo3-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-modules-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-modules-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-source-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-source-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-tests-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-tests-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo1-1.2.3-4.src.rpm</relativePath></artifact><artifact><fileName>foo2-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo2-1.2.3-4.src.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo2-foo3-1.2.3-4.src.rpm</relativePath></artifact><building>false</building><duration>429123</duration><fullDisplayName>foo » x86_64,el5 #231</fullDisplayName><id>2011-07-26_23-31-15</id><keepLog>false</keepLog><number>231</number><result>SUCCESS</result><timestamp>1311748274500</timestamp><url>http://jenkins/job/foo/arch=x86_64,distro=el5/231/</url><builtOn>builder</builtOn><changeSet><item><author><absoluteUrl>http://jenkins/user/Fred%20Flintstone</absoluteUrl><fullName>Fred Flintstone</fullName></author><comment>A test
          </comment><date>2011-07-26 21:17:19 -0400</date><id>...</id><msg>A test</msg><path><editType>edit</editType><file>foo2/bar/bar.c</file></path></item></changeSet><culprit><absoluteUrl>http://jenkins/user/Fred%20Flintsone</absoluteUrl><fullName>Fred Flintsone</fullName></culprit></matrixRun>
          

          Brian Murrell added a comment - We are at 1.423 now and this issue is still reproducible. From the URL: http://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top all I get is: <top/> However from http://jenkins/job/foo/arch=x86_64,distro=el5/lastSuccessfulBuild/api/xml I get the job's full XML output: <matrixRun><action><cause><shortDescription>Started by upstream project "foo" build number 231</shortDescription><upstreamBuild>231</upstreamBuild><upstreamProject>foo</upstreamProject><upstreamUrl>job/foo/</upstreamUrl></cause></action><action><buildsByBranchName><originmaster><buildNumber>231</buildNumber><revision><SHA1>...</SHA1><branch><SHA1>...</SHA1><name>origin/master</name></branch></revision></originmaster></buildsByBranchName><lastBuiltRevision><SHA1>...</SHA1><branch><SHA1>...</SHA1><name>origin/master</name></branch></lastBuiltRevision></action><action></action><action></action><action></action><artifact><fileName>filelists.xml.gz</fileName><relativePath>artifacts/repodata/filelists.xml.gz</relativePath></artifact><artifact><fileName>other.xml.gz</fileName><relativePath>artifacts/repodata/other.xml.gz</relativePath></artifact><artifact><fileName>primary.xml.gz</fileName><relativePath>artifacts/repodata/primary.xml.gz</relativePath></artifact><artifact><fileName>repomd.xml</fileName><relativePath>artifacts/repodata/repomd.xml</relativePath></artifact><artifact><fileName>foo1-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-debuginfo-common-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-debuginfo-common-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-devel-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-devel-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-headers-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo1-headers-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-foo3-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-debuginfo-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-foo3-debuginfo-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-modules-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-modules-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-source-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-source-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo2-tests-1.2.3-4.x86_64.rpm</fileName><relativePath>artifacts/RPMS/x86_64/foo2-tests-1.2.3-4.x86_64.rpm</relativePath></artifact><artifact><fileName>foo1-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo1-1.2.3-4.src.rpm</relativePath></artifact><artifact><fileName>foo2-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo2-1.2.3-4.src.rpm</relativePath></artifact><artifact><fileName>foo2-foo3-1.2.3-4.src.rpm</fileName><relativePath>artifacts/SRPMS/foo2-foo3-1.2.3-4.src.rpm</relativePath></artifact><building> false </building><duration>429123</duration><fullDisplayName>foo » x86_64,el5 #231</fullDisplayName><id>2011-07-26_23-31-15</id><keepLog> false </keepLog><number>231</number><result>SUCCESS</result><timestamp>1311748274500</timestamp><url>http: //jenkins/job/foo/arch=x86_64,distro=el5/231/</url><builtOn>builder</builtOn><changeSet><item><author><absoluteUrl>http://jenkins/user/Fred%20Flintstone</absoluteUrl><fullName>Fred Flintstone</fullName></author><comment>A test </comment><date>2011-07-26 21:17:19 -0400</date><id>...</id><msg>A test</msg><path><editType>edit</editType><file>foo2/bar/bar.c</file></path></item></changeSet><culprit><absoluteUrl>http: //jenkins/user/Fred%20Flintsone</absoluteUrl><fullName>Fred Flintsone</fullName></culprit></matrixRun>

          kutzi added a comment -

          Brian, there is no 'displayPath' element below 'artifact' in your example. So the xml API is IMO working correct.

          Probably this is some Matrix project specific thing that displayPath is not rendered.
          Are you sure that matrix projects used to render it?

          kutzi added a comment - Brian, there is no 'displayPath' element below 'artifact' in your example. So the xml API is IMO working correct. Probably this is some Matrix project specific thing that displayPath is not rendered. Are you sure that matrix projects used to render it?

          Brian Murrell added a comment -

          kutzi,

          Yes, it works with matrix jobs and in fact will work with a different axis value on the same job as it fails with a different axis value! But first I have to confess that to keep the examples simple, in my examples above, I reduced the number of matrix values. So to further illustrate:

          https://jenkins/job/foo/arch=x86_64,build_type=client,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top

          Yields artifacts, yet:

          https://jenkins/job/foo/arch=x86_64,build_type=server,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top

          does not. And yes, when I look at the XML from those two URLs (without the xpath), indeed, one job has it's artifacts section looking like:

          <artifact>
          <displayPath>filelists.xml.gz
          </displayPath>
          <fileName>filelists.xml.gz
          </fileName>
          <relativePath>artifacts/repodata/filelists.xml.gz
          </relativePath>
          </artifact>
          <artifact>

          and the other is simply:

          <artifact>
          <fileName>filelists.xml.gz
          </fileName>
          <relativePath>artifacts/repodata/filelists.xml.gz
          </relativePath>
          </artifact>

          But these are two jobs from the exact same matrix job!

          In any case, I seem to be able to work around the problem by using an xpath of fileName instead of displayPath.

          Brian Murrell added a comment - kutzi, Yes, it works with matrix jobs and in fact will work with a different axis value on the same job as it fails with a different axis value! But first I have to confess that to keep the examples simple, in my examples above, I reduced the number of matrix values. So to further illustrate: https://jenkins/job/foo/arch=x86_64,build_type=client,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top Yields artifacts, yet: https://jenkins/job/foo/arch=x86_64,build_type=server,distro=el5/lastSuccessfulBuild/api/xml?xpath=//artifact/displayPath&wrapper=top does not. And yes, when I look at the XML from those two URLs (without the xpath), indeed, one job has it's artifacts section looking like: <artifact> <displayPath>filelists.xml.gz </displayPath> <fileName>filelists.xml.gz </fileName> <relativePath>artifacts/repodata/filelists.xml.gz </relativePath> </artifact> <artifact> and the other is simply: <artifact> <fileName>filelists.xml.gz </fileName> <relativePath>artifacts/repodata/filelists.xml.gz </relativePath> </artifact> But these are two jobs from the exact same matrix job! In any case, I seem to be able to work around the problem by using an xpath of fileName instead of displayPath.

          kutzi added a comment -

          I guess that's an issue with matrix jobs in general, that the displayPath is not generated for all matrix values.
          Please open a bug report against the matrix component, if this is an issue for you.

          kutzi added a comment - I guess that's an issue with matrix jobs in general, that the displayPath is not generated for all matrix values. Please open a bug report against the matrix component, if this is an issue for you.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/ce48d096ab27fd3aa4d52e7f83ce576b0aefe2a2
          Log:
          JENKINS-8988 picking up new Stapler that fies the XML API issue.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml http://jenkins-ci.org/commit/jenkins/ce48d096ab27fd3aa4d52e7f83ce576b0aefe2a2 Log: JENKINS-8988 picking up new Stapler that fies the XML API issue.

            kohsuke Kohsuke Kawaguchi
            brian Brian Murrell
            Votes:
            6 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: