Details
-
Bug
-
Resolution: Fixed
-
High
-
1.7.0
Description
The Solr Search Engine bundle is not working when the Solr service has basic HTTP authorisation enabled.
Configuration used (where xxx / yyy are HTTP authorisation credentials):
Unable to find source-code formatter for language: yml. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
ez_search_engine_solr: endpoints: endpoint0: dsn: "http://localhost:8983/solr" user: xxx pass: yyy core: collection1 connections: default: entry_endpoints: - endpoint0 mapping: default: endpoint0
The correct authorisation header is sent, however the endpoint URL is missing authorisation credentials:
[2017-08-14 11:24:34] request.CRITICAL: Uncaught PHP Exception RuntimeException: "->response not set: array ( 0 => stdClass::__set_state(array( 'responseHeader' => stdClass::__set_state(array( 'status' => 401, 'QTime' => 4, 'params' => stdClass::__set_state(array( 'q' => '{!lucene}*:*', 'shards' => 'localhost:8983/solr/collection1', 'defType' => 'edismax', 'fl' => '*,score,[shard]', 'start' => '0', 'fq' => '{!lucene}((document_type_id:"location") AND (meta_indexed_is_main_translation_b:"true") AND ((content_type_id_id:"3") AND (parent_id_id:"44")))', 'sort' => 'content_name_s asc', 'rows' => '0', 'wt' => 'json', )), )), 'error' => stdClass::__set_state(array( 'metadata' => array ( 0 => 'error-class', 1 => 'org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException', 2 => 'root-error-class', 3 => 'org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException', ), 'msg' => 'Error from server at http://localhost:8983/solr/collection1: Expected mime type application/octet-stream but got text/html. <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <title>Error 401 Unauthorized</title> </head> <body><h2>HTTP ERROR 401</h2> <p>Problem accessing /solr/collection1/select. Reason: <pre> Unauthorized</pre></p> </body> </html> ', 'code' => 401, )), )), 1 => array ( 'defType' => 'edismax', 'q' => '{!lucene}*:*', 'fq' => '{!lucene}((document_type_id:"location") AND (meta_indexed_is_main_translation_b:"true") AND ((content_type_id_id:"3") AND (parent_id_id:"44")))', 'sort' => 'content_name_s asc', 'start' => 0, 'rows' => 0, 'fl' => '*,score,[shard]', 'wt' => 'json', 'shards' => 'localhost:8983/solr/collection1', ), )" at /home/ubuntu/project/vendor/ezsystems/ezplatform-solr-search-engine/lib/Gateway/Native.php line 448 {"exception":"[object] (RuntimeException(code: 0): ->response not set: array (\n 0 => \n stdClass::__set_state(array(\n 'responseHeader' => \n stdClass::__set_state(array(\n 'status' => 401,\n 'QTime' => 4,\n 'params' => \n stdClass::__set_state(array(\n 'q' => '{!lucene}*:*',\n 'shards' => 'localhost:8983/solr/collection1',\n 'defType' => 'edismax',\n 'fl' => '*,score,[shard]',\n 'start' => '0',\n 'fq' => '{!lucene}((document_type_id:\"location\") AND (meta_indexed_is_main_translation_b:\"true\") AND ((content_type_id_id:\"3\") AND (parent_id_id:\"44\")))',\n 'sort' => 'content_name_s asc',\n 'rows' => '0',\n 'wt' => 'json',\n )),\n )),\n 'error' => \n stdClass::__set_state(array(\n 'metadata' => \n array (\n 0 => 'error-class',\n 1 => 'org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException',\n 2 => 'root-error-class',\n 3 => 'org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException',\n ),\n 'msg' => 'Error from server at http://localhost:8983/solr/collection1: 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 Unauthorized</title>\n</head>\n<body><h2>HTTP ERROR 401</h2>\n<p>Problem accessing /solr/collection1/select. Reason:\n<pre> Unauthorized</pre></p>\n</body>\n</html>\n',\n 'code' => 401,\n )),\n )),\n 1 => \n array (\n 'defType' => 'edismax',\n 'q' => '{!lucene}*:*',\n 'fq' => '{!lucene}((document_type_id:\"location\") AND (meta_indexed_is_main_translation_b:\"true\") AND ((content_type_id_id:\"3\") AND (parent_id_id:\"44\")))',\n 'sort' => 'content_name_s asc',\n 'start' => 0,\n 'rows' => 0,\n 'fl' => '*,score,[shard]',\n 'wt' => 'json',\n 'shards' => 'localhost:8983/solr/collection1',\n ),\n) at /home/ubuntu/project/vendor/ezsystems/ezplatform-solr-search-engine/lib/Gateway/Native.php:448)"} []
Attachments
Issue Links
- relates to
-
EZP-27783 Please document how to configure Solr Bundle to work with Basic HTTP authorisation
- Closed