You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nalsrini <na...@gmail.com> on 2018/09/04 21:22:44 UTC

Expected mime type application/octet-stream but got text/html

Hi,I use Solr 5.3 and I don't have any collection. When I execute the
following code, I got this error:Error from server at http://:/solr-master:
Expected mime type application/octet-stream but got text/html.SolrClient
client = new HttpSolrClient("http://:/solr-master"); String sorld =
client.getById("c311cda2-1edc-577f-b00c-36310499c9b0");I am wondering why
this error?thanksSrini



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Expected mime type application/octet-stream but got text/html

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/6/2018 12:29 PM, nalsrini wrote:
> Here is the error message I am getting:
>
> https://screencast.com/t/XwEjA22jX

Alexandre covered things quite well.  It looks like you're using an 
invalid URL.

Your original message shows this code:

SolrClient client = new HttpSolrClient("http://:/solr-master");

That is not a valid URL.  It is missing the hostname, the port, and 
/solr-master is not the correct URL path.  The correct path would be 
/solr and MIGHT need to be /solr/indexname ... depending on exactly how 
the other code is written.  I prefer to use /solr and specify the 
collection name when making the requests.

Also, this is a Tomcat error page.  Is it Solr that's running in Tomcat, 
or are you running another application in Tomcat that is accessing Solr?

Running Solr in Tomcat became an unsupported configuration as of Solr 
5.0.  It is something you can do, but we don't support it.

https://wiki.apache.org/solr/WhyNoWar

Thanks,
Shawn


Re: Expected mime type application/octet-stream but got text/html

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
Why is this http://host:port/solr-master/get? The normal URL is
http://host:port/solr/<collectionname>/<handler>.  "get" as a handler
is fine, <collectionname> can be empty for "collection1" in older
Solr. But what is "solr-master" here and where is the required "/solr"
part? What is your collection name?

So, to me, either your URL is wrong or you were trying to do a custom
URL and your troubleshooting should be focused around that first.

Regards,
   Alex.

On 6 September 2018 at 14:39, Walter Underwood <wu...@wunderwood.org> wrote:
> I thought there was a fix for this in SolrJ. This is a bug. It is getting some error,
> like a 400 or 503, but instead of reporting the error, it makes a different error about
> the content-type.
>
> That is just busted, but I can’t find a Jira for it.
>
> wunder
> Walter Underwood
> wunder@wunderwood.org
> http://observer.wunderwood.org/  (my blog)
>
>> On Sep 6, 2018, at 11:29 AM, nalsrini <na...@gmail.com> wrote:
>>
>> Here is the error message I am getting:
>>
>> https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>
>>
>>
>>
>> --
>> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>

Re: Expected mime type application/octet-stream but got text/html

Posted by Walter Underwood <wu...@wunderwood.org>.
I thought there was a fix for this in SolrJ. This is a bug. It is getting some error,
like a 400 or 503, but instead of reporting the error, it makes a different error about
the content-type.

That is just busted, but I can’t find a Jira for it.

wunder
Walter Underwood
wunder@wunderwood.org
http://observer.wunderwood.org/  (my blog)

> On Sep 6, 2018, at 11:29 AM, nalsrini <na...@gmail.com> wrote:
> 
> Here is the error message I am getting:
> 
> https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>  
> 
> 
> 
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html


Re: Expected mime type application/octet-stream but got text/html

Posted by nalsrini <na...@gmail.com>.
Here is the error message I am getting:

https://screencast.com/t/XwEjA22jX <https://screencast.com/t/XwEjA22jX>  



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Expected mime type application/octet-stream but got text/html

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/4/2018 3:22 PM, nalsrini wrote:
> Hi,I use Solr 5.3 and I don't have any collection. When I execute the
> following code, I got this error:Error from server at http://:/solr-master:
> Expected mime type application/octet-stream but got text/html.SolrClient
> client = new HttpSolrClient("http://:/solr-master"); String sorld =
> client.getById("c311cda2-1edc-577f-b00c-36310499c9b0");I am wondering why
> this error?thanksSrini

It means that the response was an error, which Solr formats as HTML.  
SolrJ is expecting a binary response, but that's not what it got.  The 
error *should* include the full response from the server.

If you can't get your program to display the entire error, which should 
indicate what the problem was, then look in solr.log (Solr's logfile) on 
the server to find the error message.  If you need help understanding 
it, include the entire message here.  Such error messages are typically 
many lines long.

Which specific version are you running?  Saying "Solr 5.3" is not 
specific enough.  Knowing that can be important in understanding Java 
stacktraces.

Thanks,
Shawn