[ 
https://issues.apache.org/jira/browse/SOLR-13421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16824832#comment-16824832
 ] 

Erick Erickson commented on SOLR-13421:
---------------------------------------

>From "require authentication" it looks like you have authentication enabled.

 

And this would have best been raised on the user's list before raising a JIRA.

> Intermittent error 401 with JSON Facet query to retrieve count all collections
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-13421
>                 URL: https://issues.apache.org/jira/browse/SOLR-13421
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: Authentication
>    Affects Versions: 8.0
>            Reporter: Edwin Yeo Zheng Lin
>            Priority: Major
>              Labels: BasicAuth
>
> I am using the below JSON Facet to retrieve the count of all the different 
> collections in one query.
>   
>  
> [https://localhost:8983/solr/collection1/select?q=testing&shards=https://localhost:8983/solr/collection1,https://localhost:8983/solr/collection2,https://localhost:8983/solr/collection3,https://localhost:8983/solr/collection4,https://localhost:8983/solr/collection5,https://localhost:8983/solr/collection6&rows=0&json.facet={categories|https://localhost:8983/solr/collection1/select?q=testing&shards=https://localhost:8983/solr/collection1,https://localhost:8983/solr/collection2,https://localhost:8983/solr/collection3,https://localhost:8983/solr/collection4,https://localhost:8983/solr/collection5,https://localhost:8983/solr/collection6&rows=0&json.facet=%7Bcategories]
>  : \{type : terms,field : content_type,limit : 100}}
>   
>   
>  Previously, in Solr 7.6 and Solr 7.7, this query can work correctly and we 
> are able to produce the correct output.
>   
>  {
>    "responseHeader":
> {     "zkConnected":true,     "status":0,     "QTime":24}
> ,
>    "response":
> {"numFound":41200,"start":0,"maxScore":12.993215,"docs":[]   }
> ,
>    "facets":{
>      "count":41200,
>      "categories":{
>        "buckets":[
> {           "val":"collection1",           "count":26213}
> ,
>         
> {           "val":"collection2",           "count":12075}
> ,
>         
> {           "val":"collection3",           "count":1947}
> ,
>         
> {           "val":"collection4",           "count":850}
> ,
>         
> {           "val":"collection5",           "count":111}
> ,
>         
> {           "val":"collection6",           "count":4}
> ]}}}
>   
>   
>  However, in the new Solr 8.0.0, this query can only work occasionally. Most 
> of the time, we will get the following error of 'Error 401 require 
> authentication':
>   
>  {
>    "responseHeader":
> {     "zkConnected":true,     "status":401,     "QTime":11}
> ,
>    "error":{
>      "metadata":[
>        
> "error-class","org.apache.solr.client.solrj.impl.Http2SolrClient$RemoteSolrException",
>        
> "root-error-class","org.apache.solr.client.solrj.impl.Http2SolrClient$RemoteSolrException"],
>      "msg":"Error from server at null: Expected mime type 
> application/octet-stream but got text/html. <html>\n<head>\n<meta 
> http-equiv=\"Content-Type\" 
> content=\"text/html;charset=utf-8\"/>\n<title>Error 401 require 
> authentication</title>\n</head>\n<body><h2>HTTP ERROR 401</h2>\n<p>Problem 
> accessing /solr/collection6/select. Reason:\n<pre>    require 
> authentication</pre></p>\n</body>\n</html>\n",
>      "code":401}}
>   
>  This issue does not occur in Solr 7.6 and Solr 7.7, even though I have set 
> up the same authentication for all the versions.
>   
>  What could be the issue that causes this?
>   
>  Below is the format of my security.json:
>   
>  {
>  "authentication":
> {    "blockUnknown": true,    "class":"solr.BasicAuthPlugin",    
> "credentials":\\{"user1":"hyHXXuJSqcZdNgdSTGUvrQZRpqrYFUQ2ffmlWQ4GUTk= 
> E0w3/2FD+rlxulbPm2G7i9HZqT+2gMBzcyJCcGcMWwA="}
> },
>  "authorization":
> {    "class":"solr.RuleBasedAuthorizationPlugin",    
> "user-role":\\{"user1":"admin"}
> ,
>     "permissions":[
> {"name":"security-edit",                   "role":"admin"}
> ]
>  }}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to