Mark Miller commented on SOLR-1238:

isRepeatable means the payload stream can be read more than once. This can be 
necessary due to authentication and io errors. It doesn't mean that if you send 
an index command and it fails in Solr that the index command will be sent 
again. This is at the HTTP layer.

It also doesn't mean, please do retries - it simply means that the data can be 
read more than once, so you can do what's appropriate (retrying on re-triable 
errors) rather than failing with this exception - many times you can not reread 
a stream unless you provide a mechanism to get a fresh stream. 

Basically - I'm not seeing the problem you are about retries.

What is possibly happening here:

The HTTPClient sends the request with the payload, which gets read - but its an 
authenticated zone, so the client is challenged - it responds again with the 
username/password and the payload - which fails on the next read. Thats just a 
guess. Perhaps its just an authentication/io anomaly that a retry is often used 
to correct.

Based on the info I have though, I'm not convinced that failing and reporting 
the error is the right way to go.

> exception in solrJ when authentication is used
> ----------------------------------------------
>                 Key: SOLR-1238
>                 URL: https://issues.apache.org/jira/browse/SOLR-1238
>             Project: Solr
>          Issue Type: Bug
>          Components: clients - java
>    Affects Versions: 1.3
>            Reporter: Noble Paul
>            Priority: Minor
>         Attachments: SOLR-1238.patch
> see the thread http://markmail.org/thread/w36ih2fnphbubian
> {code}
> I am facing getting error when I am using Authentication in Solr. I
> followed Wiki. The error doesnot appear when I searching. Below is the
> code snippet and the error.
> Please note I am using Solr 1.4 Development build from SVN.
>                        HttpClient client=new HttpClient();
>                        AuthScope scope = new 
> AuthScope(AuthScope.ANY_HOST,AuthScope.ANY_PORT,null, null);
>                        client.getState().setCredentials(scope,new 
> UsernamePasswordCredentials("guest", "guest"));
>                        SolrServer server =new 
> CommonsHttpSolrServer("http://localhost:8983/solr",client);
>                        SolrInputDocument doc1=new SolrInputDocument();
>                        //Add fields to the document
>                        doc1.addField("employeeid", "1237");
>                        doc1.addField("employeename", "Ann");
>                        doc1.addField("employeeunit", "etc");
>                        doc1.addField("employeedoj", "1995-11-31T23:59:59Z");
>                        server.add(doc1);
> Exception in thread "main"
> org.apache.solr.client.solrj.SolrServerException:
> org.apache.commons.httpclient.ProtocolException: Unbuffered entity
> enclosing request can not be repeated.
>        at 
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:468)
>        at 
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:242)
>        at 
> org.apache.solr.client.solrj.request.UpdateRequest.process(UpdateRequest.java:259)
>        at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:63)
>        at test.SolrAuthenticationTest.<init>(SolrAuthenticationTest.java:49)
>        at test.SolrAuthenticationTest.main(SolrAuthenticationTest.java:113)
> Caused by: org.apache.commons.httpclient.ProtocolException: Unbuffered
> entity enclosing request can not be repeated.
>        at 
> org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:487)
>        at 
> org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2114)
>        at 
> org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
>        at 
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
>        at 
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
>        at 
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>        at 
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
>        at 
> org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:415)
>        ... 5 more.
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

Reply via email to