- Issue created by @RobLoach
- Merge request !624Issue #3525540: Add fallback for when there isn't a resolveRootDataType() type โ (Merged) created by RobLoach
- ๐จ๐ฆCanada RobLoach Earth
MR over at https://git.drupalcode.org/project/ai/-/merge_requests/624
May not be the best solution around it though. Perhaps we have it return the same `$type` instead of an empty string?
- ๐ฉ๐ชGermany marcus_johansson
I have tried to replicate this with Drupal10.3 and Drupal 10.4 without success - any other modules that might be installed that installs some extra action plugins? I tried ECA.
- ๐ฉ๐ชGermany marcus_johansson
Adding the module list here, for anyone also trying to repliace it - all 1.1.x and Drupal 10.4:
- Drupal AI
- AI Search
- Key
- Search API
- Open AI Provider
- Milvus VDB Provider
- AI Assistant API
- AI Agents
- AI Chatbot
- ๐ฎ๐ณIndia Ishani Patel
Hello,
I've also tried with D10.4 and 1.1.x of AI and sub modules, but no luck. - ๐ช๐ธSpain gxleano Cรกceres
Testing in a clean installation with Drupal
10.4.7
and1.1.x
AI stack and everything works fine.Seems like some module from the other installation is interfering on this.
Closing the issue.
- ๐บ๐ธUnited States j-barnes
We are currently experiencing the same issue on 10.4.7 with ai / ai_agent on latest dev release. It looks like it's caused by the node_unpublish_by_keyword_action and returned no attributes. Adding the above seems to have cured our problem.
- ๐จ๐ฆCanada RobLoach Earth
Confirmed it's something with the
action
module. Try this...drush pm:install action drush cr
Visit
/admin/structure/ai-agent/add
You get the white screen:
The website encountered an unexpected error. Try again later.
Error: Call to a member function newInstance() on null in Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType() (line 183 of modules/contrib/ai/src/Plugin/AiFunctionCall/Derivative/ActionPluginDeriver.php).
- ๐ฒ๐ฆMorocco lakhal
I got the same error when I updated to the last versions of AI modules and applied the database update:
Error : Call to a member function newInstance() on null dans Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType() (C:\xampp\htdocs\onedd\modules\contrib\ai\src\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver.php ligne 183) #0 C:\xampp\htdocs\onedd\modules\contrib\ai\src\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver.php(162): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType('sequence') #1 C:\xampp\htdocs\onedd\modules\contrib\ai\src\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver.php(78): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->getContextDefinitions(Object(Drupal\action\Plugin\Action\UnpublishByKeywordComment)) #2 C:\xampp\htdocs\onedd\core\lib\Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator.php(101): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->getDerivativeDefinitions(Array) #3 C:\xampp\htdocs\onedd\core\lib\Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives(Array) #4 C:\xampp\htdocs\onedd\core\lib\Drupal\Core\Plugin\DefaultPluginManager.php(337): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() #5 C:\xampp\htdocs\onedd\modules\contrib\ai\src\Service\FunctionCalling\FunctionCallPluginManager.php(33): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() #6 C:\xampp\htdocs\onedd\core\lib\Drupal\Component\Plugin\Discovery\DiscoveryCachedTrait.php(22): Drupal\ai\Service\FunctionCalling\FunctionCallPluginManager->getDefinitions() #7 C:\xampp\htdocs\onedd\modules\contrib\ai_agents\ai_agents.install(142): Drupal\Core\Plugin\DefaultPluginManager->getDefinition('ai_agent:get_co...', false) #8 C:\xampp\htdocs\onedd\core\includes\update.inc(178): ai_agents_update_10305(Array) #9 C:\xampp\htdocs\onedd\core\includes\batch.inc(297): update_do_one('ai_agents', 10305, Array, Array) #10 C:\xampp\htdocs\onedd\core\includes\batch.inc(139): _batch_process() #11 C:\xampp\htdocs\onedd\core\includes\batch.inc(95): _batch_do() #12 C:\xampp\htdocs\onedd\core\modules\system\src\Controller\DbUpdateController.php(195): _batch_page(Object(Symfony\Component\HttpFoundation\Request)) #13 [internal function]: Drupal\system\Controller\DbUpdateController->handle('start', Object(Symfony\Component\HttpFoundation\Request)) #14 C:\xampp\htdocs\onedd\core\lib\Drupal\Core\Update\UpdateKernel.php(115): call_user_func_array(Array, Array) #15 C:\xampp\htdocs\onedd\core\lib\Drupal\Core\Update\UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request)) #16 C:\xampp\htdocs\onedd\update.php(27): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #17 {main}
- ๐บ๐ธUnited States keiserjb
Thanks for the tip about the action module. If I turn that off the error goes away. But the patch works for me too.
- ๐ท๐ธSerbia norbert-goco Subotica
The ActionPluginDeriver class is responsible for collecting Action Plugins from contributed modules.
If you debug the getContextDefinitions() function, you can see which configuration contains a mapping whose type cannot be resolved.In my case, it was the configuration of the domain_access module:
Configuration for the add domain(s) to users action (action.configuration.domain_access_add_editor_action)
This configuration contains a sequence within a mapping, meaning it can hold multiple values.
Therefore, in such mappings, the inner type of the sequence should be considered.
Iโm attaching a patch that fixes this issue in my case โ it might help others as well. If not, then further investigation is needed to identify additional cases that should be handled.
- ๐ซ๐ฎFinland merilainen
I get this error after installing Drupal AI 1.1.0 and simply going to Chat explorer /admin/config/ai/explorers/chat_generator
Error: Call to a member function newInstance() on null in Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType() (line 183 of /var/www/html/web/modules/contrib/ai/src/Plugin/AiFunctionCall/Derivative/ActionPluginDeriver.php).
Here is the backtrace I get in Drupal logs:
#0 /var/www/html/web/modules/contrib/ai/src/Plugin/AiFunctionCall/Derivative/ActionPluginDeriver.php(162): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType() #1 /var/www/html/web/modules/contrib/ai/src/Plugin/AiFunctionCall/Derivative/ActionPluginDeriver.php(78): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->getContextDefinitions() #2 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(101): Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->getDerivativeDefinitions() #3 /var/www/html/web/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php(87): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDerivatives() #4 /var/www/html/web/core/lib/Drupal/Core/Plugin/DefaultPluginManager.php(337): Drupal\Component\Plugin\Discovery\DerivativeDiscoveryDecorator->getDefinitions() #5 /var/www/html/web/modules/contrib/ai/src/Service/FunctionCalling/FunctionCallPluginManager.php(33): Drupal\Core\Plugin\DefaultPluginManager->findDefinitions() #6 /var/www/html/web/modules/contrib/ai/modules/ai_api_explorer/src/Plugin/AiApiExplorer/ChatGenerator.php(188): Drupal\ai\Service\FunctionCalling\FunctionCallPluginManager->getDefinitions() #7 /var/www/html/web/modules/contrib/ai/modules/ai_api_explorer/src/Form/AiApiExplorerForm.php(60): Drupal\ai_api_explorer\Plugin\AiApiExplorer\ChatGenerator->buildForm() #8 [internal function]: Drupal\ai_api_explorer\Form\AiApiExplorerForm->buildForm() #9 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(536): call_user_func_array() #10 /var/www/html/web/core/lib/Drupal/Core/Form/FormBuilder.php(284): Drupal\Core\Form\FormBuilder->retrieveForm() #11 /var/www/html/web/core/lib/Drupal/Core/Controller/FormController.php(73): Drupal\Core\Form\FormBuilder->buildForm() #12 [internal function]: Drupal\Core\Controller\FormController->getContentResult() #13 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array() #14 /var/www/html/web/core/lib/Drupal/Core/Render/Renderer.php(638): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #15 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(121): Drupal\Core\Render\Renderer->executeInRenderContext() #16 /var/www/html/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() #17 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(181): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #18 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw() #19 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle() #20 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle() #21 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle() #22 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(116): Drupal\Core\StackMiddleware\ContentLength->handle() #23 /var/www/html/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(90): Drupal\page_cache\StackMiddleware\PageCache->pass() #24 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\page_cache\StackMiddleware\PageCache->handle() #25 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() #26 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() #27 /var/www/html/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle() #28 /var/www/html/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle() #29 /var/www/html/web/index.php(19): Drupal\Core\DrupalKernel->handle() #30 {main}
- ๐ฎ๐ณIndia prashant.c Dharamshala
Just to make sure that we do not have this error on
1.2.x
of AI and1.2.x
of AI agents, tried replicating with Drupal core11.x
, all pages are working fine without any error, etc.Seems to be specific to Drupal core 10 and Drupal AI 1.1.0, as mentioned in the Steps to reproduce.
- ๐ฉ๐ชGermany marcus_johansson
I think this should be solved in 1.2.x with the inclusion of ๐ Create Context upcaster for complex data types Active .
- ๐ฎ๐ณIndia prashant.c Dharamshala
Got the same error on the page
admin/config/ai/explorers/tools_explorer
.Will something like the following work:
if (!empty($attributes)) { return $attributes[0]->newInstance()->id; } return $type;
- Status changed to Needs work
about 2 months ago 11:54am 8 August 2025 - ๐ซ๐ฎFinland merilainen
Still getting this error with Drupal AI 1.2.x-dev and Drupal 10.5.2:
Error: Call to a member function newInstance() on null in Drupal\ai\Plugin\AiFunctionCall\Derivative\ActionPluginDeriver->resolveRootDataType() (line 215 of /var/www/html/web/modules/contrib/ai/src/Plugin/AiFunctionCall/Derivative/ActionPluginDeriver.php).
I think this is pretty critical because the module claims to support core ^10.4.
- ๐ฉ๐ชGermany marcus_johansson
Based on the feedback from norbert-goco, I was able to reproduce the issue. I've added his fix on top of the fix that already existed. Sorry for the delay with this one.
The problem is that any type that is complex and based on mapping wouldn't work - but I don't think mapping types are allowed anyway?
Will set this to Needs review and backport to 1.1.x, but will push two different branches for them since they have diverged too much.
@merilainen - could you check if this fixes your issue on 1.1.x branch.
And in general - please review.
- ๐ช๐ธSpain gxleano Cรกceres
Testing on AI and AI Agents 1.1.x with Drupal 10.5.2 the changes make it works.
Setup to be reproduce it
- Drupal
10.5.2
- AI1.1.x
(AI Assistant API, AI Search and AI Chatbot)
- AI Agents1.1.x
- Action (Core module, so it just needs to be enabled)
- Keylatest_version
- Search APIlatest_version
- Ollama Provider (ddev addon)latest_version
- Milvus VDB Provider (ddev addon)latest_version
After applying the MR into AI module the error from the next pages is gone:
/admin/config/ai/explorers/tools_explorer
/admin/config/ai/explorers/chat_generator
/admin/structure/ai_agent/add
Moving the issue to RTBC, thanks everyone involved.