Hitting a wall trying to test out this very cool project.

I'm seeing the following exception all over the place:

SearchApiException: Unknown or invalid item type . in search_api_get_datasource_controller() (line 1278 of /Users/miles/Sites/import.dev/sites/all/modules/search_api/search_api.module).

Steps leading to this:

  1. Installed/enabled required modules using Drush.
  2. Created Sarnia server per instructions in README.
  3. Selected ID field and created entity type.
  4. Verified that I could see relevant schema fields listed under "Solr properties"
  5. Visited main Search API config page and verified that Sarnia created a Search API index.
  6. Trying to visit the config page for the Sarnia index brings the exception. Then, if I clear cache, I get this exception on every page, making the site inaccessible.

Search API 7.x-1.0
Search API Solr 7.x-1.0-rc1
Entity API 7.x-1.0-rc1

CommentFileSizeAuthor
#4 sarnia.patch477 byteschristowm
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

christowm’s picture

I get the same problem. I used the same steps and ended up with the same error.

egarias’s picture

same here without drush

christowm’s picture

So here is what we found out so far. The item_type field in the search_api_index table is NULL. Which seems to cause the uncaught exception. If a value is entered such as "Node" or the value that you would have in the "machine_name" column, then the server is at least accessible again. However at this point we don't know yet what the correct value must be in the item_type field, nor do we know why it is NULL. Hopefully someone can come up with additional information.

christowm’s picture

Status: Active » Needs review
FileSize
477 bytes

One of our developers (Chris) has done the debugging and found the problem in the sarnia_entity_type_save function of the sarnia.entities.inc file. It looks like the creation of the item_type was omitted in the save function. Here is a patch that Chris created and tested. Please review this patch and provide feedback if it fixes the problem.

Oh, and if you have already fubared your Drupal installation and get the error listed above you can fix it by updating the item_type field in the search_api_index table. Just enter the machine_name into the item_type field and you should be able to get back to your Drupal instance.

Mitch

egarias’s picture

Confirmed, this solves my issue
Many Thanks!!!

It was a blocking problem, with inaccessible site as a result.

christowm’s picture

Great. Glad to see it works. Could the powers that be add this patch to the next release candidate? Many thanks.

becw’s picture

Version: 7.x-1.0-rc1 » 7.x-1.x-dev
Status: Needs review » Fixed

I've committed this patch; its in the 7.x-1.x branch. Thanks for working this out!

milesw’s picture

Nice work! Looking forward to giving this another shot. :)

Status: Fixed » Closed (fixed)

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

mwangi’s picture

I was having a similar problem
SearchApiException: Unknown or invalid item type node. in search_api_get_datasource_controller() (line 1677 of /home/frontlin/public_html/drop_jobs/profiles/drop_jobs/modules/contrib/search_api/search_api.module).

solved it by rolling back search API module from 7.x-1.8 to 7.x-1.7

Now the site is ok

dergachev’s picture

Issue summary: View changes

I believe this might be related/duplicate of https://www.drupal.org/node/1338156