After upgrading to 1.16, I started getting the following when installing via drush on Travis CI for my distro for vih.dk build on top of Panopoly.

WD search_api: SearchApiException while adding index Database Node   [error]
Index to server Database Server: SQLSTATE[42S02]: Base table or view
not found: 1146 Table 'drupal.search_api_db_database_node_index_text'
doesn't exist in SearchApiDbService->fieldsUpdated() (line 684 of
/home/travis/build/vih/drupal/sites/all/modules/contrib/search_api_db/service.inc).
WD php: Warning: array_keys() expects parameter 1 to be array, null  [warning]
given in drupal_schema_fields_sql() (line 7293 of
/home/travis/build/vih/drupal/includes/common.inc).
WD search_api: SearchApiException while adding index Database Node   [error]
Index to server Database Server: SQLSTATE[42S02]: Base table or view
not found: 1146 Table 'drupal.search_api_db_database_node_index_text'
doesn't exist in SearchApiDbService->fieldsUpdated() (line 684 of
/home/travis/build/vih/drupal/sites/all/modules/contrib/search_api_db/service.inc).

See Travis build here: https://travis-ci.org/vih/vih-build/jobs/50526089#L757

The build is able to complete.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dsnopek’s picture

Version: 7.x-1.16 » 7.x-1.x-dev

This is also happening with the Panopoly tests on Travis-CI, but I didn't notice it since all the tests (including the search ones) are passing!

dsnopek’s picture

Title: Search API exceptions after upgrading » Search API exceptions during install
adamsro’s picture

Related issue.

I'm using features (provided by the Panopoly distribution) and I had this problem. You basically need to replace the table name manually in you feature for all text fields like so:
"table" : "search_api_db_database_node_index_title",

adamsro’s picture

Sorry previous issue referenced isn't related. Although I'm not sure if this is the best solution, I was able to prevent the exception by changing the boost parameter on search_api_panelizer_title field from "1.0" to "8.0", panopoly_search.features.inc:335.

The exception happens because in search_api_db/service.inc:555 there's a check to see if $field['boost'] != $new_fields[$name]['boost'] which evaluates to true leading to code that attempts to update table that doesn't yet exist.

adamsro’s picture

$field's boost is expected to be 8.0 because its assigned that in the search_api_index entities imported on panopoly_search.features.inc:52 and panopoly_search.features.inc:147, so I suppose making the search_api_panelizer_title field boost also equal to 8.0 on the search_api_server is the right solution.

  • dsnopek committed 01a72fc on 7.x-1.x
    Update Panopoly Search for Issue #2425903 by adamsro: Search API...
dsnopek’s picture

Status: Active » Fixed

@adamsro: Thanks for digging into this! I tried out your patch on Travis-CI and it works - committing! :-)

adamsro’s picture

hurray!

hefox’s picture

ahaha

I had a ticket in the private OA issue queue to fix these errors on the test install site

"Hm, they stopped occuring on Feb 19th, what happened?"
"Hm, I updated panopoly to 1.17"
"...oh!"

Thanks :)

Status: Fixed » Closed (fixed)

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