If Solr Suddenly Stopped Working on Your Drupal Site

Posted Dec 23, 2008 // 1 comments
Irakli:

Ok, so you can swear Solr was working just fine on your Drupal-powered website and suddenly it does not! You made sure nobody messed with your install and you do not believe in goblins. What to do?

Keep your cool. Here’s what may have happened.

Apache Solr module uses Drupal’s drupal_http_request() function. This is a very useful function that has numerous benefits over PHP curl library for the retrieval of information via HTTP. Simplicity, reliability and speed are just a few.

However, it has one serious shortcoming. Somebody thought it was a good idea to check if the Drupal installation can make HTTP calls at, by fetching self-generated page. If that request fails – Drupal blocks the function by setting a variable ‘drupal_http_request_fails’ in the database and then it’s all downhill from there.

So, if your Solr installation suddenly stops working for no good reason, or your FeedAPI is not bringing feed items, anymore, try clearing the flag by either issuing: variable_set(drupal_http_request_fails, false); in Drupal, or running the following command in mysql:

mysql> update variable set value='b:0;' where name='drupal_http_request_fails';

About Irakli

Irakli is Director of Product Development at Phase2 Technology. His main responsibility is development of packaged, turn-key solutions using open-source technologies and cutting-edge semantic APIs.

Irakli has been an avid open-source ...

more >

Read Irakli's Blog

Comments

by jrglasgow (not verified) on Sat, 12/27/2008 - 01:01

Resetting drupal_http_request_fails

The big thing to remember is that since Drupal is checking is it can get pages by calling self generating pages,... if the site is in maintenance mode it will fail. This has become a problem for me on development sites not retrieving feeds, and not checking for module and core updates.

I put together a module that will regularly (using cron) check if drupal_http_request_fails is set to TRUE and reset it if necessary, the Http Request Fail Reset Module.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <a> <strong> <code> <p> <img> <ul> <ol> <li> <h2> <h3> <h4> <b> <u> <i>
  • You may insert videos with [video:URL]

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.