I have an Aegir setup where I install multiple sites from the administration, and do various tasks that in the backend call Drush. I have Apachesolr and Apachesolr Views in my build. When Apachesolr Views is installed, it calls the

$solr_fields = $solr->getFields(0);

to build the available views handlers. Unfortunately, at this point the solr core is not configured properly, and there are two watchdog errors, which are also handled as errors by Drush:

WD Apache Solr: HTTP Status: 0; Message: Request failed: Connection refused; Response: ; Request: Unknown; Caller: apachesolr_views_views_data() (line 43 of                                                                          [error]
.../sites/all/modules/contrib/apachesolr_views/apachesolr_views.views.inc)
WD Apache Solr Views: HTTP 0; Request failed: Connection refused                                                                                                                                                                      [error]
WD Apache Solr: HTTP Status: 0; Message: Request failed: Connection refused; Response: ; Request: Unknown; 

One is from apachesolr_views_views_data(), the other from DrupalApacheSolrService::checkResponse().
The problem is that drush hooks itself on watchdog and outputs error on WATCHDOG_ERROR. Then the Aegir task fails to complete.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MiroslavBanov’s picture

Status: Active » Needs review
Related issues: +#2194541: Drush site-install errors
FileSize
514 bytes

I have added the related issue in Apachesolr view. I patch it by changing the severity to warning in both modules, which allows the drush site install to finish.

Grayside’s picture

Status: Needs review » Needs work

SOLR not being available is definitely an error except in the context of an incompletely set up Drupal site. Applying this patch would be an operational bug.

MiroslavBanov’s picture

@Grayside
Then how do you suppose this can be fixed? apachesolr_install() configures the environment with the localhost server:
db_insert('apachesolr_environment')->fields(array('env_id' => 'solr', 'name' => 'localhost server', 'url' => 'http://localhost:8983/solr'))->execute();
It's assumed that there is a Solr configured and working on localhost? But that being unavailable is an error?

Edit: Just to clarify - my Solr is not on localhost.

Grayside’s picture

If I knew, I wouldn't have moved enabling apachesolr after the main drush si in my install script.