Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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:
- Installed/enabled required modules using Drush.
- Created Sarnia server per instructions in README.
- Selected ID field and created entity type.
- Verified that I could see relevant schema fields listed under "Solr properties"
- Visited main Search API config page and verified that Sarnia created a Search API index.
- 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
Comment | File | Size | Author |
---|---|---|---|
#4 | sarnia.patch | 477 bytes | christowm |
Comments
Comment #1
christowm CreditAttribution: christowm commentedI get the same problem. I used the same steps and ended up with the same error.
Comment #2
egarias CreditAttribution: egarias commentedsame here without drush
Comment #3
christowm CreditAttribution: christowm commentedSo 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.
Comment #4
christowm CreditAttribution: christowm commentedOne 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
Comment #5
egarias CreditAttribution: egarias commentedConfirmed, this solves my issue
Many Thanks!!!
It was a blocking problem, with inaccessible site as a result.
Comment #6
christowm CreditAttribution: christowm commentedGreat. Glad to see it works. Could the powers that be add this patch to the next release candidate? Many thanks.
Comment #7
becw CreditAttribution: becw commentedI've committed this patch; its in the 7.x-1.x branch. Thanks for working this out!
Comment #8
milesw CreditAttribution: milesw commentedNice work! Looking forward to giving this another shot. :)
Comment #10
mwangi CreditAttribution: mwangi commentedI 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
Comment #11
dergachev CreditAttribution: dergachev commentedI believe this might be related/duplicate of https://www.drupal.org/node/1338156