HTTP error 0 in apachesolr_autocomplete

If you didn't know it before - there is a nice module which will provide autocomplete functionality to all of the search forms on your Drupal site. Recently i have installed this module on our development box and everything was pretty fine. Today i pushed a new version of the site to the preproduction box and autocomplete stops working with errors:

PHP Fatal error:  Uncaught exception 'Exception' with message '"0" Status: Request failed' in /sites/all/modules/apachesolr/Drupal_Apache_Solr_Service.php:272
Stack trace:
#0 /sites/all/modules/apachesolr/SolrPhpClient/Apache/Solr/Service.php(964): Drupal_Apache_Solr_Service->_sendRawGet('http://192.168....')
#1 /sites/all/modules/apachesolr/apachesolr_search.module(246): Apache_Solr_Service->search('finance', 0, '20', Array)
#2 /sites/all/modules/apachesolr/drush/apachesolr.drush.inc(145): apachesolr_search_execute('finance')
#3 [internal function]: apachesolr_drush_solr_search('finance')
#4 /usr/share/drush/includes/drush.inc(51): call_user_func_array('apachesolr_drus...', Array)
#5 /usr/share/drush/drush.php(90): drush_dispatch(Array)
#6 /usr/share/drush/drush.php(40): drush_main()
#7 {main}
  thrown in /sites/all/modules/apachesolr/Drupal_Apache_Solr_Service.php on line 272
Drush command could not be completed.      

I did some investigation and the problem was in the size of headers which were getting passed to solr. Fix in server.xml:

Change:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="UTF-8"/>

To:

<Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443"
               URIEncoding="UTF-8"
               maxHttpHeaderSize="8192"/>

And restart Tomcat.

Related issues on Drupal.org:
"0" Status: Request failed

Helpful handbook page:
Troubleshooting

No comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.