Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9680

Better error messages in SolrCLI when authentication required

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.3, master (7.0)
    • Component/s: scripts and tools
    • Security Level: Public (Default Security Level. Issues are Public)
    • Labels:
      None

      Description

      Currently the status tool does not distinguish between Authentication/Authorization errors and other IO errors and just throws a generic Exception with the 401 HTML output from Jetty:

      $ bin/solr status
      
      Found 1 Solr nodes: 
      
      Solr process 4332 running on port 8983
      
      ERROR: Failed to get system information from http://localhost:8983/solr due to: org.apache.http.client.ClientProtocolException: Expected JSON response from server but received: <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
      <title>Error 401 require authentication</title>
      </head>
      <body><h2>HTTP ERROR 401</h2>
      <p>Problem accessing /solr/admin/info/system. Reason:
      <pre>    require authentication</pre></p>
      </body>
      </html>
      
      Typically, this indicates a problem with the Solr server; check the Solr server logs for more information.
      

      Instead, the tool should exit with a clear message that authentication is required, and the status tool should throw a security related exception that tool consumers (such as assertTool) can detect. Due to this assert -u also fails when Solr is password protected.

        Issue Links

          Activity

          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit db43bfb0464347143e58e662113a5630224b070e in lucene-solr's branch refs/heads/master from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=db43bfb ]

          SOLR-9610: Add timeout option, abort early on auth failure
          SOLR-9680: Better error messages in SolrCLI when authentication required

          Show
          jira-bot ASF subversion and git services added a comment - Commit db43bfb0464347143e58e662113a5630224b070e in lucene-solr's branch refs/heads/master from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=db43bfb ] SOLR-9610 : Add timeout option, abort early on auth failure SOLR-9680 : Better error messages in SolrCLI when authentication required
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c2e3cde822054795040acba5fc806c58df947d00 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl
          [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c2e3cde ]

          SOLR-9610: Add timeout option, abort early on auth failure
          SOLR-9680: Better error messages in SolrCLI when authentication required

          (cherry picked from commit db43bfb)

          Show
          jira-bot ASF subversion and git services added a comment - Commit c2e3cde822054795040acba5fc806c58df947d00 in lucene-solr's branch refs/heads/branch_6x from Jan Høydahl [ https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=c2e3cde ] SOLR-9610 : Add timeout option, abort early on auth failure SOLR-9680 : Better error messages in SolrCLI when authentication required (cherry picked from commit db43bfb)
          Hide
          shalinmangar Shalin Shekhar Mangar added a comment -

          Closing after 6.3.0 release.

          Show
          shalinmangar Shalin Shekhar Mangar added a comment - Closing after 6.3.0 release.

            People

            • Assignee:
              janhoy Jan Høydahl
              Reporter:
              janhoy Jan Høydahl
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development