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

Improve the error message when any issue happens while communicating to the target Jenkins

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • job-import-plugin
    • None

      Current situation does an error difficult to decrypt because the plugin doesn't check for the response status code:
       

      2019-06-12 11:14:33.668+0000 [id=86689] SEVERE  o.j.c.p.j.client.RestApiClient#getRemoteItems: Failed to list job from remote <url> org.xml.sax.SAXParseException; lineNumber: 10; columnNumber: 3; The element type "hr" must be terminated by the matching end-tag "</hr>".     at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:257)     at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:339)     at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)     at org.jenkins.ci.plugins.jobimport.client.RestApiClient.getRemoteItems(RestApiClient.java:34)     at org.jenkins.ci.plugins.jobimport.JobImportAction.doQueryInternal(JobImportAction.java:278)     at org.jenkins.ci.plugins.jobimport.JobImportAction.doQuery(JobImportAction.java:174)

       
      Proposed fix checking for this status code:

      Jun 13, 2019 12:41:52 PM org.jenkins.ci.plugins.jobimport.client.RestApiClient getRemoteItems
      SEVERE: Failed to list job from remote <url>. Response status code received 401. Content: <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
      <title>Error 401 Invalid password/token for user: pierre</title>
      </head>
      <body><h2>HTTP ERROR 401</h2>
      <p>Problem accessing /api/xml. Reason:
      <pre>    Invalid password/token for user: pierre</pre></p><hr><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/></body>
      </html>

            pierrebtz Pierre Beitz
            pierrebtz Pierre Beitz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: