After I installed module on production server (drush en ultimate_cron), I received a fatal error and the following message in dblog:

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

After quickly deactivated module, clear cache and installed module again, module is started normally, without errors.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

devlada created an issue. See original summary.

Berdir’s picture

Status: Active » Closed (cannot reproduce)

Can't reproduce and nobody else ever reported this, so closing.

stimalsina’s picture

Version: 8.x-2.x-dev » 8.x-2.0-alpha1
Status: Closed (cannot reproduce) » Postponed (maintainer needs more info)

I was able to reproduce this as well. Here are the steps to reproduce:

  1. Install Module (I installed 2.0-alpha1.)
  2. Navigate to Configuration > System > Cron. WSOD, with fatal error as mentioned above.
  3. Rebuild cache and refresh cron page. The page should show up without any issue.

This seems to be a common error among many modules. A quick search for "The * entity type does not exist" reveals many such issues. Unfortunately, I have not found any core issues relating to this.

aangel’s picture

We are seeing this, too.

cristian100’s picture

Version: 8.x-2.0-alpha1 » 8.x-2.0-alpha2
Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Active

So sad, I'm having this same issue, once I install the module through the UI, it will go into a white page with the error mentioned:

The website encountered an unexpected error. Please try again later.Drupal\Component\Plugin\Exception\PluginNotFoundException: The "ultimate_cron_job" entity type does not exist. in Drupal\Core\Entity\EntityTypeManager->getDefinition() (line 133 of core/lib/Drupal/Core/Entity/EntityTypeManager.php).

Module Version 8.x-2.0-alpha2
PHP 7.1
Hosted in Pantheon
Drupal Version 8.4.2

17chances’s picture

Entity schema not instantiated while install process. On post update state entity definitions added by module are allowed to use. So job discovery should be moved into post update hook.

17chances’s picture

Status: Active » Needs review
Berdir’s picture

That fix doesn't make sense, that's now how update functions work. If you install then Drupal will never run any update or post update functions.

Using its own entity type in a hook_install() should work just fine, in fact core does that too if you have default configuration, even earlier than that.

Augusto182’s picture

I have this issue, but, uninstall and reinstall via Druhs does not solve the situation.

simoneb’s picture

I've the same issue, sometimes ultimate cron stops to work and I see this error on cron page

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

Only way to solve is uninstall and reinstall

Any idea?

Thanks

Modules:
- Drupal core 8.7.5
- Ultimate Cron 8.x-2.0-alpha4

simoneb’s picture

any news on this one? I need to uninstall and re-enable near daily.

lamp5’s picture

Version: 8.x-2.0-alpha2 » 8.x-2.x-dev

Hi. I made the same error today. This is an instruction on how I did it and how to solve it.

  1. Implement your own hook_cron
  2. do not clear cache
  3. install Ultimate cron and enable
  4. you can see your cron job in the list and everything works
  5. try to export the configuration: you may see an error
  6. Drush cache cleanup doesn't work
  7. go to: / admin / config / system / cron / jobs
  8. then click "discover jobs" and clear the cache on your site
  9. now: drush cex is running
Berdir’s picture

Priority: Critical » Major
Status: Needs review » Postponed (maintainer needs more info)

I can't fix problems that I can't reproduce. non-defined or incomplete entity type definitions usually happen when there are other issues with a site that prevent full discovery or break alter hooks.