This is found in apachesolr.module on line 1292:

if (!isset($status[$key])) {
    $ping = FALSE;
    try {
      // Takes advantage of auto-loading.
      // @Todo : Do we have to specify the env_id?
      $solr = new $class($url);
      $ping = @$solr->ping(variable_get('apachesolr_ping_timeout', 4));
    }
    catch (Exception $e) {
      watchdog('Apache Solr', nl2br(check_plain($e->getMessage())), NULL, WATCHDOG_ERROR);
    }
    $status[$key] = $ping;
  }
  return $status[$key];

It bombs when it tries to load the Acquia_Search_Service class. When I look at Acquia_Search_Service.php the actual class name doesn't have underscores. Looking at the code I don't see where Acquia_Search_Service.php is supposed to be loaded? Maybe there is some setting somewhere I am missing?

CommentFileSizeAuthor
#10 1617902-10.patch829 bytespwolanin
#8 apachesolr_service_class.png33.01 KBjbrauer

Comments

drupalninja99’s picture

It looks like the code in apachesolr_update_7000() maybe isn't quite right which might mean this is an apachesolr issue.

$value = variable_get('apachesolr_service_class', NULL);
  if (is_array($value)) {
    list($module, $filepath, $class) = $value;
    variable_set('apachesolr_service_class', $class);
  }

The class seems to be wrong after this update.

nick_vh’s picture

Can you specify which version of Apache Solr?

drupalninja99’s picture

Oh I am using Acquia Search, so whatever version they use. The module version is 7.x-2.4

nick_vh’s picture

Right, but you also downloaded the Apache Solr Search Integration module I expect? What version is that?

drupalninja99’s picture

Oh sorry, yes I have the latest version 7.x-1.0-beta19

nick_vh’s picture

Status: Active » Postponed (maintainer needs more info)

Sorry for not getting back to you

Could you try with latest dev version if this is still not resolved? And also uninstall/reinstall those modules completely. Perhaps something went wrong in the beta

jbrauer’s picture

Version: 7.x-2.4 » 7.x-2.6
Status: Postponed (maintainer needs more info) » Active

Experiencing this error in a site upgraded from D6 to D7 with the 2.6 version of the module

jbrauer’s picture

StatusFileSize
new33.01 KB

So some more digging reveals that even after disabling and uninstalling both the ApacheSolr modules and all of the Acquia Connector (including search) modules the variables in the attached table remain. In particular the apachesolr_service_class is set to "Acquia_Search_Service".

In line 1058 of apachesolr.module this becomes the $class variable which causes a problem since the class definition is now AcquiaSearchService:

$solr = new $class($environments[$env_id]['url'], $env_id);

Once this is deleted and one manages to fiddle with the indexes and make the Acquia Search Service the default index things seem reasonable.

So I would propose that although this is a "apachesolr" variable it would be reasonable for a update function in acquia_search to check and see and if the value is set to the offending Acquia_Search_Service that it be reset or unset.

nick_vh’s picture

I followed the workflow and understand where you are coming from
Something like this should be sufficient normally for the upgrade path. Can you confirm this is what you had in mind?

/**
 * Removing apachesolr_service_class if it was set to AcquiaSearchService.
 * This can be a leftover from a D6 to D7 upgrade
 */
function acquia_search_update_7002() {
  // No need for apachesolr_service_class anymore, each environment can have
  // a separate class
  $class = variable_get('apachesolr_service_class', 'DrupalApacheSolrService');
  if ($class == 'AcquiaSearchService') {
    variable_del('apachesolr_service_class');
  }
}
pwolanin’s picture

StatusFileSize
new829 bytes

The general nature of the update looks ok, but it's looking for the wrong class name. The error is caused by 'Acquia_Search_Service'.

The update in this patch is more generic.

pwolanin’s picture

Version: 7.x-2.6 » 7.x-2.x-dev
Status: Active » Needs review
jbrauer’s picture

#10 looks good. I hope to have time to test it in the next couple of days.

pwolanin’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

pauln600’s picture

Status: Closed (fixed) » Active

I'm still getting this error, in spite of applying the patch in #10.

Paul N.

pwolanin’s picture

Did you run update.php after applying the patch?

coltrane’s picture

Status: Active » Postponed (maintainer needs more info)
pwolanin’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)