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

IndexFetcher Http client requests are unauthenticated

    XMLWordPrintableJSON

Details

    Description

      Whenever the IndexFetcher class is called for recovery or replication the HTTP requests are unauthenticated resulting in 401 errors:

       

      2018-01-25 13:16:22.538 WARN  (indexFetcher-25-thread-1) [c:myCollection s:shard1 r:core_node3 x:myCollection_shard1_replica_t1] o.a.s.h.IndexFetcher Master at: http://server1:8983/solr/myCollection_shard1_replica_t4/ is not available. Index fetch failed by exception: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://server1:8983/solr/myCollection_shard1_replica_t4: Expected mime type application/octet-stream but got text/html. <html>
      <head>
      <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
      <title>Error 401 Unauthorized request, Response code: 401</title>
      </head>
      <body><h2>HTTP ERROR 401</h2>
      <p>Problem accessing /solr/myCollection_shard1_replica_t4/replication. Reason:
      <pre>    Unauthorized request, Response code: 401</pre></p>
      </body>
      </html>
      

       

      I checked the source code and before creating a new HTTP client in IndexFetcher it tries to get http auth user/password from initArgs but those properties are always null, event if I set them in the replication handler (under the slave tag).

       

       <lst name="slave">
      <str name="masterUrl">http://remote_host:port/solr/core_name/replication</str>
       <str name="httpBasicAuthUser">username</str>
      <str name="httpBasicAuthPassword">password</str>
      </lst>
      

       

      I downloaded the solr source code and entered the username and password hardcoded, compiled the jar and everything was working fine. Before this I used the logger to check the httpBasicAuthUser/httpBasicAuthPassword and whenever IndexFetcher was called for recovery or replication these fields were null.

       

      Attachments

        Activity

          People

            thelabdude Timothy Potter
            kchristoudias Kyriacos Christoudias
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 5h 10m
                5h 10m