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

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

    • 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>

          [JENKINS-57991] Improve the error message when any issue happens while communicating to the target Jenkins

          Pierre Beitz created issue -
          Pierre Beitz made changes -
          Assignee New: Pierre Beitz [ pierrebtz ]
          Pierre Beitz made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Pierre Beitz made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Pierre Beitz made changes -
          Summary Original: Improve the error message when the credentials of the remote Jenkins are not correct New: Improve the error message when any issue happens while communicating to the target Jenkins
          Pierre Beitz made changes -
          Description Original: Current situation does an error difficult to decrypt because the plugin doesn't check for the response status code:
           
          {noformat}
          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){noformat}
           
          Proposed fix checking for this status code:
          {noformat}
          Jun 12, 2019 5:36:04 PM org.jenkins.ci.plugins.jobimport.client.RestApiClient getRemoteItems
          SEVERE: Failed to list job from remote <url>/SEVERE: Failed to list job from remote <url>/org.acegisecurity.AccessDeniedException: Remote Jenkins denied access. Please check the provided credentials at org.jenkins.ci.plugins.jobimport.utils.URLUtils.fetchUrl(URLUtils.java:88) at org.jenkins.ci.plugins.jobimport.client.RestApiClient.getRemoteItems(RestApiClient.java:35) at org.jenkins.ci.plugins.jobimport.JobImportAction.doQueryInternal(JobImportAction.java:278) at org.jenkins.ci.plugins.jobimport.JobImportAction.doQuery(JobImportAction.java:174){noformat}
          New: Current situation does an error difficult to decrypt because the plugin doesn't check for the response status code:
            
          {noformat}
          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){noformat}
           
           Proposed fix checking for this status code:
          {noformat}
          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>{noformat}
          Pierre Beitz made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]

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

              Created:
              Updated:
              Resolved: