{"__v":1,"_id":"57881ef4ab7e190e00a372be","category":{"project":"56be3387be55991700c3ca0d","version":"56be3388be55991700c3ca10","_id":"5787da96b008c91900aae865","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-07-14T18:31:50.937Z","from_sync":false,"order":3,"slug":"troubleshooting","title":"Troubleshooting"},"parentDoc":null,"project":"56be3387be55991700c3ca0d","user":"5633ec9b35355017003ca3f2","version":{"__v":8,"_id":"56be3388be55991700c3ca10","project":"56be3387be55991700c3ca0d","createdAt":"2016-02-12T19:33:28.313Z","releaseDate":"2016-02-12T19:33:28.313Z","categories":["56be3389be55991700c3ca11","57646709b0a8be1900fcd0d8","5764671c89da831700590782","57646d30c176520e00ea8fe5","5764715d4f867c0e002bc8e3","57698fa2e93bfd190028815c","576c2af16c24681700c902da","5787da96b008c91900aae865"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-14T23:23:32.207Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The two most common Drupal modules for Solr, [ApacheSolr](doc:drupal-7-with-the-apachesolr-module) and [Search API](doc:drupal-7-with-the-search-api-solr-module), are known to have authorization issues with Websolr. These modules will attempt to request various administrative pages to show some statistics about the index usage and the server that it is on.\n\nUnfortunately, we must restrict access to most administrative pages within Solr, due to security and privacy concerns in our shared environment. Thus, requests to most `/admin` endpoints will respond with a HTTP 401 Unauthorized error response. While the modules will gracefully handle an empty response, skipping this particular check, 401 responses are treated much more severely.\n\nThe problem can be avoided by [commenting out two lines](https://gist.github.com/nz/5193924) in the Drupal_Apache_Solr_Service.php file:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"  const SEARCH_SERVLET = 'select';\\n  const LUKE_SERVLET = 'admin/luke';\\n  const SYSTEM_SERVLET = 'admin/system';\\n  #const STATS_SERVLET = 'admin/stats.jsp';\\n \\n  /**\\n  * Server url\\n  * Get summary information about the Solr Core.\\n  */\\n   public function getStatsSummary() {\\n     #$stats = $this->getStats();\\n     $summary = array(\\n      ':::at:::pending_docs' => '',\\n      '@autocommit_time_seconds' => '',\",\n      \"language\": \"php\",\n      \"name\": \"Drupal_Apache_Solr_Service.php \"\n    }\n  ]\n}\n[/block]\nWe welcome any feedback from Drupal users about how we may improve our service based on their expectations and previous experiences using search with either of these modules.","excerpt":"Learn about common authorization issues the common Drupal modules have with Websolr, and how to fix them.","slug":"drupal-401-authorization-required","type":"basic","title":"Drupal \"401 Authorization Required\""}

Drupal "401 Authorization Required"

Learn about common authorization issues the common Drupal modules have with Websolr, and how to fix them.

The two most common Drupal modules for Solr, [ApacheSolr](doc:drupal-7-with-the-apachesolr-module) and [Search API](doc:drupal-7-with-the-search-api-solr-module), are known to have authorization issues with Websolr. These modules will attempt to request various administrative pages to show some statistics about the index usage and the server that it is on. Unfortunately, we must restrict access to most administrative pages within Solr, due to security and privacy concerns in our shared environment. Thus, requests to most `/admin` endpoints will respond with a HTTP 401 Unauthorized error response. While the modules will gracefully handle an empty response, skipping this particular check, 401 responses are treated much more severely. The problem can be avoided by [commenting out two lines](https://gist.github.com/nz/5193924) in the Drupal_Apache_Solr_Service.php file: [block:code] { "codes": [ { "code": " const SEARCH_SERVLET = 'select';\n const LUKE_SERVLET = 'admin/luke';\n const SYSTEM_SERVLET = 'admin/system';\n #const STATS_SERVLET = 'admin/stats.jsp';\n \n /**\n * Server url\n * Get summary information about the Solr Core.\n */\n public function getStatsSummary() {\n #$stats = $this->getStats();\n $summary = array(\n '@pending_docs' => '',\n '@autocommit_time_seconds' => '',", "language": "php", "name": "Drupal_Apache_Solr_Service.php " } ] } [/block] We welcome any feedback from Drupal users about how we may improve our service based on their expectations and previous experiences using search with either of these modules.