Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to collection failed due to (405) #68

Closed
mkanchwala opened this issue Jun 8, 2016 · 8 comments
Closed

Request to collection failed due to (405) #68

mkanchwala opened this issue Jun 8, 2016 · 8 comments

Comments

@mkanchwala
Copy link

mkanchwala commented Jun 8, 2016

16/06/08 17:30:27 ERROR CloudSolrClient: Request to collection core-schemaless failed due to (405) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://MyServer-Node:8983/solr/core-schemaless: Expected mime type application/octet-stream but got text/html.

I created "core-schemaless" and trying to Index my HBase data creating dataframe of it "docdf" and :

docdf.write.format("solr").options(options).mode(org.apache.spark.sql.SaveMode.Overwrite).save

@kiranchitturi
Copy link
Contributor

@mkanchwala

Which version of Solr is this ? Can you show me the entire stacktrace ? i think we have seen a similar error with people who are on 4.10

@mkanchwala
Copy link
Author

mkanchwala commented Jun 10, 2016

@kiranchitturi

Yes I am using Solr 4.10, Please find the stacktrace

16/06/10 13:40:02 ERROR CloudSolrClient: Request to collection MySolrCore failed due to (405) org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://MyServer-Node:8983/solr/MySolrCore: Expected mime type application/octet-stream but got text/html. <html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Method Not Allowed</p>
<p>The method specified in the request is not allowed for the resource identified by the request URI</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>
, retry? 0
Exception in thread "main" org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://MyServer-Node:8983/solr/MySolrCore: Expected mime type application/octet-stream but got text/html. <html>
<head>
   <title>Status page</title>
</head>
<body style="font-family: sans-serif;">
<p style="font-size: 1.2em;font-weight: bold;margin: 1em 0px;">Method Not Allowed</p>
<p>The method specified in the request is not allowed for the resource identified by the request URI</p>
<p>You can get technical details <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6">here</a>.<br>
Please continue your visit at our <a href="/">home page</a>.
</p>
</body>
</html>

    at org.apache.solr.client.solrj.impl.HttpSolrClient.executeMethod(HttpSolrClient.java:543)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:241)
    at org.apache.solr.client.solrj.impl.HttpSolrClient.request(HttpSolrClient.java:230)
    at org.apache.solr.client.solrj.impl.LBHttpSolrClient.doRequest(LBHttpSolrClient.java:372)
    at org.apache.solr.client.solrj.impl.LBHttpSolrClient.request(LBHttpSolrClient.java:325)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.sendRequest(CloudSolrClient.java:1100)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.requestWithRetryOnStaleState(CloudSolrClient.java:871)
    at org.apache.solr.client.solrj.impl.CloudSolrClient.request(CloudSolrClient.java:807)
    at org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:150)
    at com.lucidworks.spark.SolrRelation.insert(SolrRelation.scala:214)
    at solr.DefaultSource.createRelation(DefaultSource.scala:27)
    at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:222)
    at org.apache.spark.sql.DataFrameWriter.save(DataFrameWriter.scala:148)
    at com.mkanchwala.solr.app.IndexerApp$delayedInit$body.apply(IndexerApp.scala:100)
    at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
    at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
    at scala.App$$anonfun$main$1.apply(App.scala:71)
    at scala.App$$anonfun$main$1.apply(App.scala:71)
    at scala.collection.immutable.List.foreach(List.scala:318)
    at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
    at scala.App$class.main(App.scala:71)
    at com.mkanchwala.solr.app.IndexerApp$.main(IndexerApp.scala:41)
    at com.mkanchwala.solr.app.IndexerApp.main(IndexerApp.scala)

@Duyyuan
Copy link

Duyyuan commented Jul 4, 2016

I have the same problem, can you solve it ?

@egamboau
Copy link

Seems that the library tries to use a call on the Schema API from Solr, which was relased on Solr version 5 As we use an older version, the Schema API is not present. Is there a way to configure this to avoid the errror?

@thelabdude
Copy link
Contributor

We're not supporting Solr 4.x ... feel free to fork

@skannan009
Copy link

skannan009 commented Sep 12, 2017

Hi, Could you please share me the actual fix provided for this issue.

Issue:-
org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at Expected mime type application/octet-stream but got text/html.

While calling :-
var writeToSolrOpts = Map("zkhost" -> solrZkHost, "collection" -> solrCollection)


salesDF.write.format("solr").options(writeToSolrOpts).save

Below are the version i am using in pom.xml:-
Solr version -> 6.3.0
com.lucidworks.spark.spark-solr -> 3.0.0-beta
Spark -> 2.1.0

@kiranchitturi
Copy link
Contributor

Could you please open a new issue? Please do not add onto closed issues

@skannan009
Copy link

skannan009 commented Sep 16, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants