Fatal Error on enabling

Created on 31 March 2025, 24 days ago

Problem/Motivation

Using the curent dev version of the module on a clean Drupal 10 install, I get the following fatal error trying to turn the AI Agents module on through the UI:

The website encountered an unexpected error. Try again later.

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

This appears to be related to code added on 11 March to src/PluginManager/AiAgentManager.php, specifically the

$this->mergeAgentConfigurations();

This seems to be trying to load the ai_agent entity storage handler before the ai_agent entity type exists? Presumably the plugin manager is getting created before the module has fully installed?

🐛 Bug report
Status

Active

Version

1.1

Component

Code

Created by

🇬🇧United Kingdom MrDaleSmith

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

Merge Requests

Comments & Activities

  • Issue created by @MrDaleSmith
  • 🇬🇧United Kingdom MrDaleSmith

    OK, well I get this every time I try to enable the 1.1 dev version, so the MR makes a change that resolves the issue for me: I'll leave it to the maintainers to work out if this is required,.

  • 🇬🇧United Kingdom tim corkerton

    I get the same error when installing the 1.1 dev version. In order to progress I needed to

    1. uninstall the dev version
    2. composer remove to completely remove the agent module (just in case).
    3. install the 1.0 version and enable
    4. composer require the 1.1 dev version.
    5. drush cr

    Bingo it works !
    Nice, Naive RAG here we come.

  • 🇬🇧United Kingdom MrDaleSmith

    @tim corkerton - have you tried using the changes in the MR to see if that resolves the issue for you?

  • 🇮🇳India prashant.c Dharamshala

    Not exactly sure about the steps to replicate, but I also got this error when all the modules ai, ai_agents, and ai_provider_openai were not on 1.1.x.

    I am on 11.x of Drupal core.

  • 🇬🇧United Kingdom tim corkerton

    @mrdalesmith Nice one, the changes in the MR resolves the issue for me.

Production build 0.71.5 2024