When I want to make a redirect with the url redirects module I get the following error:
SearchApiException: Unknown or invalid item type redirect. in search_api_get_datasource_controller() (regel 1101 van www/sites/all/modules/search_api/search_api.module)

I am unable to make a redirect.

Comments

drunken monkey’s picture

Please see, whether the patch in #1236642-7: Static cache of search_api_get_item_type_info() is never cleared solves your problem.

vasike’s picture

Status: Active » Needs review

i confirm this issue
but i also can confirm that the pacth suggested solve it http://drupal.org/node/1236642#comment-4827324

Bonaveli’s picture

Status: Needs review » Active
StatusFileSize
new68.13 KB

I'm getting the same error:

SearchApiException: Unknown or invalid item type node. in search_api_get_datasource_controller() (line 1319 of /path-to-drupal-site/sites/all/modules/contrib/search_api/search_api.module)

I'm using Drupal 7.14 and Search API 7.x-1.2. I can't create new node indexes either. When I go to admin/config/search/search_api/add_index there is nothing to select in "item type". See attached screenshot.

Modules in use on the site are (apart from views, entity api and other basic module):

addressfield
email
emfield
feeds
feeds_jsonpath_parser
feeds_tamper
geofield
geophp
job_scheduler
link
media
media_vimeo
media_youtube
oembed
openlayers
search_api
search_api_db
uuid

cangeceiro’s picture

this has started occuring for me as well on drupal 7.15 and search_api 1.2

SearchApiException: Unknown or invalid item type node. in search_api_get_datasource_controller() (line 1319 of /var/www/artbabble/drupal/sites/all/modules/search_api/search_api.module).

cangeceiro’s picture

Hmm, looks like this has something to do with UUID. I just noticed in Bonaveli's post that they are using uuid. And i started receiving this error after enabling uuid myself.

catalin.anghelache’s picture

Sorry, but I don't have uuid module at all and I am still receiving this error.
Also, my all message is this:

SearchApiException: Unknown or invalid item type node. in search_api_get_datasource_controller() (line 1319 of /var/www/vhosts......./subdomains/dev/httpdocs/sites/all/modules/search_api/search_api.module). Backtrace:
search_api_get_datasource_controller('node') index_entity.inc:354
SearchApiIndex->datasource() index_entity.inc:903
SearchApiIndex->entityWrapper() index_entity.inc:725
SearchApiIndex->getFields() search_api.admin.inc:669
search_api_admin_index_view(Object)
call_user_func_array('search_api_admin_index_view', Array) menu.inc:516
menu_execute_active_handler() index.php:21

artusamak’s picture

I confirm that this issue also occurs without UUIDs, i have plugged memcache and it's breaking when i enable the module and set memcache as the cache backend for every cache (except the drupal forms).
If i disable memcache, search api is working like a charm again.

manuel garcia’s picture

I'm also getting this error, with the latest dev release from 2012-Aug-24 (includes the patch mentioned above). Dont have UUIDs nor memcache enabled.

manuel garcia’s picture

If it helps,

I dpm'ed $datasources in the function search_api_get_datasource_controller, and it's an empty array.
search_api_get_item_type_info($type) for 'node' returns an empty string.

If I try to create a new index, in Item type, I only see File, Search server, Search index.

cutesquirrel’s picture

Hi, for me, UUID was the problem as well !
this module implements hook_entity_property_info_alter, and this hook make the $info array empty...

<?php
function uuid_entity_property_info_alter(&$info) {
  foreach (entity_get_info() as $entity_type => $info) {
 // (...)
  }
}
?>

I think the foreach is dangerous :

<?php
foreach (entity_get_info() as $entity_type => $info)
?>

because it puts each entity infos in $info, the parameter passed by reference to the hook, it the reason why $info becomes empty.

cutesquirrel’s picture

With this modification, it works ! I replaced $info by $value in foreach.

<?php
function uuid_entity_property_info_alter(&$info) {
  foreach (entity_get_info() as $entity_type => $value) {
    if (isset($value['uuid']) && $value['uuid'] == TRUE && !empty($value['entity keys']['uuid'])) {
      $info[$entity_type]['properties'][$value['entity keys']['uuid']] = array(
        'label' => t('UUID'),
        'type' => 'text',
        'description' => t('The universally unique ID.'),
        'schema field' => $value['entity keys']['uuid'],
      );
      if (!empty($value['entity keys']['revision uuid'])) {
        $info[$entity_type]['properties'][$value['entity keys']['revision uuid']] = array(
          'label' => t('Revision UUID'),
          'type' => 'text',
          'description' => t("The revision's universally unique ID."),
          'schema field' => $value['entity keys']['revision uuid'],
        );
      }
    }
  }
}
?>

I submited a patch in http://drupal.org/node/1782422#comment-6468352

jackbravo’s picture

Status: Active » Closed (duplicate)

Right, this was also the problem for me so sounds like this is a bug on uuid that's already been fixed on dev. And not a problem on search_api.

#1782422: Bad foreach in hook_entity_property_info_alter()