Exactly same 401 error
at
org.apache.solr.client.solrj.impl.BaseHttpClusterStateProvider.fetchLiveNodes(BaseHttpClusterStateProvider.java:227)
The problem is that get live nodes builder build() method that creates
initialClient instanse to get list of nodes, ignores base authentication string
in httpClient.
protected SolrClient getSolrClient(String baseUrl) {
return new
Http2SolrClient.Builder(baseUrl).withHttpClient(httpClient).build();
}
httpClient basicAuthAuthorizationStr lost here - field is not used in build()
method.
I had another issue in 9.x SOLR, with basic authentication over https, it was
related to switching "https://" to "http://" in http2 client but I can't
reproduce it quickly because don't have docker setup for that.
Using legacy client for https and basic authentication.
Thank you,
Andrei Minin | Principal Developer
Intellective
[email protected]
www.intellective.com<http://www.intellective.com/>
Follow us on LinkedIn<https://www.linkedin.com/company/intellectiv/> |
Twitter<https://twitter.com/intellectiv> |
Facebook<https://www.facebook.com/intellectiveglobal>
________________________________
From: Andrei Minin <[email protected]>
Sent: Tuesday, April 4, 2023 8:37
To: [email protected] <[email protected]>
Subject: Re: SOLR 9.2.0 cluster basic authentication with http2 solr client
I tried "builder = builder.withInternalClientBuilder(http2ClientBuilder);"
before debugging - it didn't help - I will try it again to do clean test.
Thank you,
Andrei Minin | Principal Developer
Intellective
[email protected]
www.intellective.com<http://www.intellective.com/><http://www.intellective.com<http://www.intellective.com/>>
Follow us on LinkedIn<https://www.linkedin.com/company/intellectiv/> |
Twitter<https://twitter.com/intellectiv> |
Facebook<https://www.facebook.com/intellectiveglobal>
________________________________
From: Shawn Heisey <[email protected]>
Sent: Tuesday, April 4, 2023 2:49
To: [email protected] <[email protected]>
Subject: Re: SOLR 9.2.0 cluster basic authentication with http2 solr client
On 4/3/23 12:38, Tomás Fernández Löbbe wrote:
> Try replacing this:
> builder = builder.withHttpClient(http2ClientBuilder.build());
> with
> builder = builder.withInternalClientBuilder(http2ClientBuilder);
Looking at the code in CloudHttp2SolrClient on main, branch_9x, and
branch_9_2, the effective result of these two different options appear
to be identical, the only difference being that the clientIsInternal
boolean is false for the first option and true for the second. I would
not expect the described change to help. I do hope I am wrong!
Thanks,
Shawn