After the release of the new dev-version of Search API, I get this error if I do a search:
The website encountered an unexpected error. Please try again later.

In the log:
Drupal\Component\Plugin\Exception\PluginNotFoundException: The "text" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of /var/www/public/example.com/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

I use Search API together with the alpha release of Search API Autocomplete, if that makes any difference.

Comments

ressa created an issue. See original summary.

ressa’s picture

Priority: Normal » Major
ressa’s picture

And here is some more info for debugging:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "text" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php).

Drupal\Core\Plugin\DefaultPluginManager->getDefinition('text') (Line: 78)
Drupal\Core\TypedData\TypedDataManager->createInstance('text', Array) (Line: 104)
Drupal\Core\TypedData\TypedDataManager->create(Object, Object) (Line: 415)
Drupal\search_api\Plugin\views\field\SearchApiStandard->preRender(Array) (Line: 1490)
Drupal\views\ViewExecutable->render() (Line: 171)
Drupal\views\Plugin\views\display\Page->execute() (Line: 1617)
Drupal\views\ViewExecutable->executeDisplay('fl_search', Array) (Line: 78)
Drupal\views\Element\View::preRenderViewElement(Array)
call_user_func(Array, Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
ressa’s picture

StatusFileSize
new58.76 KB
new16.05 KB

Here are my Processors and the View, attached:
index processors

drunken monkey’s picture

Component: General code » Plugins
Priority: Major » Normal
Status: Active » Needs review
StatusFileSize
new1.88 KB

Thanks for reporting this problem!
It seems the cause is that the "Rendered item" processor (I guess the view tries to display that processor's field, right?) creates a property definition with the data type text – which is not a data type known by Drupal (by default), leading to that error.
We can either create a Typed Data plugin for that type, so it can be used in this cases, or just use one of the existing fulltext types for the processor.

The attached patch implements the latter suggestion, please test whether it fixes your problem!

ressa’s picture

Thanks for the patch! I get this error message while viewing any page, after applying it:

The website encountered an unexpected error. Please try again later.

Drupal\Component\Plugin\Exception\PluginNotFoundException: The "" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions(NULL) (Line: 171)
Drupal\Core\Entity\EntityFieldManager->getBaseFieldDefinitions(NULL) (Line: 394)
Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions(NULL) (Line: 154)
Drupal\Core\Entity\EntityManager->getFieldStorageDefinitions(NULL) (Line: 326)
Drupal\views\Plugin\views\field\Field->getFieldStorageDefinition() (Line: 346)
Drupal\views\Plugin\views\field\Field->defineOptions() (Line: 99)
Drupal\search_api\Plugin\views\field\SearchApiEntityField->defineOptions() (Line: 138)
Drupal\views\Plugin\views\PluginBase->init(Object, Object, Array) (Line: 102)
Drupal\views\Plugin\views\HandlerBase->init(Object, Object, Array) (Line: 108)
Drupal\views\Plugin\views\field\FieldPluginBase->init(Object, Object, Array) (Line: 177)
Drupal\views\Plugin\views\field\Field->init(Object, Object, Array) (Line: 57)
Drupal\search_api\Plugin\views\field\SearchApiEntityField->init(Object, Object, Array) (Line: 888)
Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('field') (Line: 1030)
Drupal\views\ViewExecutable->_initHandler('field', Array) (Line: 888)
Drupal\views\ViewExecutable->initHandlers() (Line: 2552)
Drupal\views\Plugin\views\display\DisplayPluginBase->viewExposedFormBlocks() (Line: 29)
Drupal\views\Plugin\Block\ViewsExposedFilterBlock->build() (Line: 203)
Drupal\block\BlockViewBuilder::preRender(Array)
call_user_func('Drupal\block\BlockViewBuilder::preRender', Array) (Line: 376)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 448)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 303)
__TwigTemplate_7598e732c4894a0f0816a66a6aa0e2cf98fe0ffc266d58f63b7defd7c7cffa56->block_header(Array, Array) (Line: 167)
Twig_Template->displayBlock('header', Array, Array) (Line: 193)
__TwigTemplate_7598e732c4894a0f0816a66a6aa0e2cf98fe0ffc266d58f63b7defd7c7cffa56->block_main(Array, Array) (Line: 167)
Twig_Template->displayBlock('main', Array, Array) (Line: 79)
__TwigTemplate_7598e732c4894a0f0816a66a6aa0e2cf98fe0ffc266d58f63b7defd7c7cffa56->doDisplay(Array, Array) (Line: 381)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 355)
Twig_Template->display(Array) (Line: 366)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/faktalink/templates/page.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('page', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 474)
Drupal\Core\Template\TwigExtension->escapeFilter(Object, Array, 'html', NULL, 1) (Line: 90)
__TwigTemplate_2d5c3a16568466232191c02742652d285039517d111460c7b9d1869b85b1c198->doDisplay(Array, Array) (Line: 381)
Twig_Template->displayWithErrorHandling(Array, Array) (Line: 355)
Twig_Template->display(Array) (Line: 366)
Twig_Template->render(Array) (Line: 64)
twig_render_template('themes/bootstrap/templates/system/html.html.twig', Array) (Line: 384)
Drupal\Core\Theme\ThemeManager->render('html', Array) (Line: 435)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array) (Line: 147)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 148)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 62)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 207)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 121)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 75)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
ressa’s picture

StatusFileSize
new50.21 KB

And here the two fields I use. Let me know if you need more info!
fields

ressa’s picture

On a hunch, I just tried removing the field which was present after I created my full-text Search View - the one which is created after selecting my index (called Index FL index) under View settings -> Show during the Views creation process.

The field I removed was called Index FL index: Rendered HTML output, and that seems to fix this issue. It's a bit counter-intuitive that the field which is added when creating the View is not needed, but perhaps that's necessary somehow? Anyway, it now works again :-)

bddemers’s picture

I installed Search API yesterday and after doing a search, I got, 'The website encountered an unexpected error. Please try again later.' My website is still down and that message is all you get when going to my site. Without going into a boring explanation of why I don't have a backup for the site...I don't have a backup recent enough to help. Can I go into a file and modify it manually or delete whatever Search API has done to get my site back? Thanks...Newbie Drupal User.

bddemers’s picture

Ressa, looks like you figured it out. Can you please tell me where to locate the file and what line needs to be removed? I am very new to drupal, but learning fast. I am building my site, but of course it is down now with the same error you received. Please help. Thank you so much. Brian Demers

drunken monkey’s picture

Status: Needs review » Fixed

@ ressa: Good to hear it works again!

@ bddemers: That error message is very, very generic, it can have all kinds of causes. If it really has the same cause as discussed here, you'd probably need to manually modify (or remove) the search index in the database.
You can find it with the following database query:

SELECT * FROM `config` WHERE name LIKE 'search_api.index.%' ;

Locate the right index and either remove it, or remove the field setting you think might cause this from the serialized index data.
In any case, you might also need to TRUNCATE all cache tables.

To find out where the error comes from, try:

SELECT * FROM `config` WHERE name = 'system.logging' ;

and then in that PHP array set error_level to verbose. That should give you more information on the error page.

Otherwise, you could try removing the Search API module from the server and see if that gives you a more manageable error. But in general, getting back from this site state without knowing what went wrong is rather tricky, especially for a Drupal beginner.

  • drunken monkey committed 86a254d on 8.x-1.x
    Issue #2826822 by drunken monkey: Fixed use of illegal typed data type "...
bddemers’s picture

Thank you dm,
Was able to get in to site management and uninstall search API and reinstall the core search.
All is well again.
Now my problem is connecting my newly installed drush to my host.
See..
https://www.drupal.org/node/2830742

Thanks again,
Brian D

Status: Fixed » Closed (fixed)

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

mpp’s picture

This commit seems to trigger the error in #6 upon site re-installatin: [ERROR] The "" entity type does not exist.

Recreating the rendered item field didn't solve the issue, but results in the following warning:

Warning: array_flip(): Can only flip STRING and INTEGER values! in Drupal\Core\Entity\EntityStorageBase->loadMultiple() (line 227 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 212)
Drupal\Core\Entity\EntityStorageBase->load(NULL) (Line: 499)
Drupal\Core\Entity\Entity::load(NULL) (Line: 125)
search_api_solr_form_search_api_index_form_validate_server(Array, Object, Array)
call_user_func_array('search_api_solr_form_search_api_index_form_validate_server', Array) (Line: 277)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 235)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'search_api_field_config') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('search_api_field_config', Array, Object) (Line: 571)
Drupal\Core\Form\FormBuilder->processForm('search_api_field_config', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

The yml config section describing the HTML rendered item:

  rendered_item:
    label: 'Rendered HTML output'
    property_path: rendered_item
    type: text
    configuration:
      roles:
        anonymous: anonymous
      view_mode:
        'entity:node':
          article: full
mpp’s picture

StatusFileSize
new661 bytes

Reverting the commit in #12 seems to fix the issue for us. Note that we don't use this field in the view display and we don't have the initial issue reported here.

Vlad_Bo’s picture

Still doesn't work if rendered item field is used in index. Reverting #12 commit doesn't fix problem, "text" plugin still doesn't exist.

Vlad_Bo’s picture

If rendered item processor is used and this field is displayed in Views it doesn't work in both cases (text/field_item:text_long.string).

drunken monkey’s picture

@ mpp: See #2839932: PluginNotFoundException exception in Views when using an index with multiple entity types. And please either re-open the issue or open a new one if you want to discuss problems – very few people read closed issues.