search_api_ai gives field value, returning in error (cron stuck)

Created on 10 July 2024, 6 months ago

Problem/Motivation

| 2024-07-10T06:25:56.053153400Z NOTICE: PHP message: ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty in /var/www/html/web/modules/contrib/openai/src/Utility/StringHelper.php on line 66 #0 /var/www/html/web/modules/contrib/openai/src/Utility/StringHelper.php(66): DOMDocument->loadHTML() | 2024-07-10T06:25:56.053446600Z #1 /var/www/html/web/modules/contrib/search_api_ai/src/Plugin/search_api/data_type/Embeddings.php(58): Drupal\openai\Utility\StringHelper::prepareText() | 2024-07-10T06:25:56.053474000Z #2 /var/www/html/web/modules/contrib/search_api/src/Item/Field.php(568): Drupal\search_api_ai\Plugin\search_api\data_type\Embeddings->getValue() | 2024-07-10T06:25:56.054575100Z #3 /var/www/html/web/modules/contrib/search_api/src/Utility/FieldsHelper.php(189): Drupal\search_api\Item\Field->addValue() | 2024-07-10T06:25:56.054676200Z #4 /var/www/html/web/modules/contrib/search_api/src/Utility/FieldsHelper.php(148): Drupal\search_api\Utility\FieldsHelper->extractField() | 2024-07-10T06:25:56.054707600Z #5 /var/www/html/web/modules/contrib/search_api/src/Item/Item.php(275): Drupal\search_api\Utility\FieldsHelper->extractFields() | 2024-07-10T06:25:56.054735400Z #6 /var/www/html/web/modules/contrib/search_api/src/Plugin/search_api/processor/RenderedItem.php(180): Drupal\search_api\Item\Item->getFields() | 2024-07-10T06:25:56.054761900Z #7 /var/www/html/web/modules/contrib/search_api/src/Item/Item.php(281): Drupal\search_api\Plugin\search_api\processor\RenderedItem->addFieldValues() | 2024-07-10T06:25:56.054792800Z #8 /var/www/html/web/modules/contrib/search_api/src/Entity/Index.php(987): Drupal\search_api\Item\Item->getFields() | 2024-07-10T06:25:56.054819800Z #9 /var/www/html/web/modules/contrib/search_api/src/Entity/Index.php(935): Drupal\search_api\Entity\Index->indexSpecificItems() | 2024-07-10T06:25:56.054844600Z #10 /var/www/html/web/modules/contrib/search_api/search_api.module(117): Drupal\search_api\Entity\Index->indexItems() | 2024-07-10T06:25:56.054869500Z #11 /var/www/html/web/core/lib/Drupal/Core/Cron.php(335): search_api_cron() | 2024-07-10T06:25:56.054896100Z #12 /var/www/html/web/core/lib/Drupal/Core/Extension/ModuleHandler.php(395): Drupal\Core\Cron->Drupal\Core\{closure}() | 2024-07-10T06:25:56.054914700Z #13 /var/www/html/web/core/lib/Drupal/Core/Cron.php(318): Drupal\Core\Extension\ModuleHandler->invokeAllWith() | 2024-07-10T06:25:56.054941600Z #14 /var/www/html/web/core/lib/Drupal/Core/Cron.php(159): Drupal\Core\Cron->invokeCronHandlers() | 2024-07-10T06:25:56.054974000Z #15 /var/www/html/web/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run() | 2024-07-10T06:25:56.055000000Z #16 /var/www/html/web/core/modules/automated_cron/src/EventSubscriber/AutomatedCron.php(65): Drupal\Core\ProxyClass\Cron->run() | 2024-07-10T06:25:56.056011000Z #17 [internal function]: Drupal\automated_cron\EventSubscriber\AutomatedCron->onTerminate() | 2024-07-10T06:25:56.056093600Z #18 /var/www/html/web/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func() | 2024-07-10T06:25:56.056128100Z #19 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(115): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch() | 2024-07-10T06:25:56.056210700Z #20 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(66): Symfony\Component\HttpKernel\HttpKernel->terminate() | 2024-07-10T06:25:56.056237000Z #21 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(715): Drupal\Core\StackMiddleware\StackedHttpKernel->terminate() | 2024-07-10T06:25:56.056342500Z #22 /var/www/html/web/index.php(22): Drupal\Core\DrupalKernel->terminate() | 2024-07-10T06:25:56.056508100Z #23 {main} | 2024-07-10T06:25:56.056555400Z 172.19.0.5 - 10/Jul/2024:06:25

Steps to reproduce

"drupal/openai": "1.0.x-dev@dev",
"drupal/search_api": "^1.29",
"drupal/search_api_ai": "^1.0@alpha",

in search_api
I added
-> the rendered node
-> the title field
-> a tags field
-> the body field (as embeddings) to the search.

Proposed resolution

not sure yet, just logging to see if I'm the only one.

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇧🇪Belgium wouters_f Leuven

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024