Please ensure that the class definition "Drupal\acquia_dam\Entity\BundleFieldDefinition" ... was loaded _before_ unserialize() gets called

Created on 20 September 2023, over 1 year ago

When running cron on a Drupal 9.5.9 site, I am seeing the following error:

 [error]  Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "Drupal\acquia_dam\Entity\BundleFieldDefinition" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in field_purge_batch() (line 81 of /var/www/html/docroot/core/modules/field/field.purge.inc) #0 /var/www/html/docroot/core/modules/field/field.module(169): field_purge_batch()
#1 /var/www/html/docroot/core/lib/Drupal/Core/Cron.php(250): field_cron()
#2 /var/www/html/docroot/core/lib/Drupal/Core/Extension/ModuleHandler.php(405): Drupal\Core\Cron->Drupal\Core\{closure}()
#3 /var/www/html/docroot/core/lib/Drupal/Core/Cron.php(258): Drupal\Core\Extension\ModuleHandler->invokeAllWith()
#4 /var/www/html/docroot/core/lib/Drupal/Core/Cron.php(136): Drupal\Core\Cron->invokeCronHandlers()
#5 /var/www/html/docroot/core/lib/Drupal/Core/ProxyClass/Cron.php(75): Drupal\Core\Cron->run()
#6 /var/www/html/vendor/drush/drush/src/Drupal/Commands/core/DrupalCommands.php(76): Drupal\Core\ProxyClass\Cron->run()
#7 [internal function]: Drush\Drupal\Commands\core\DrupalCommands->cron()
#8 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
#9 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
#10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#11 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(391): Consolidation\AnnotatedCommand\CommandProcessor->process()
#12 /var/www/html/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#13 /var/www/html/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
#14 /var/www/html/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
#15 /var/www/html/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#16 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run()
#17 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(48): Drush\Runtime\Runtime->doRun()
#18 /var/www/html/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#19 /var/www/html/vendor/drush/drush/includes/preflight.inc(18): require('...')
#20 /usr/local/drush-launcher/vendor/drush/drush-launcher/bin/drush.php(143): drush_main()
#21 /usr/local/drush-launcher/vendor/drush/drush-launcher/bin/drush(4): require('...')
#22 /usr/local/drush-launcher/vendor/bin/drush(120): include('...')
#23 {main}. 
Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "Drupal\acquia_dam\Entity\BundleFieldDefinition" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in field_purge_batch() (line 81 of /var/www/html/docroot/core/modules/field/field.purge.inc).
 [warning] Drush command terminated abnormally.
🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇦🇺Australia klonos 90% Melbourne, Australia - 10% Larissa, Greece

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

Comments & Activities

  • Issue created by @klonos
  • 🇮🇳India abhishek_virasat

    @klonos, Can you please share more details about this issue. where I will be get this error. please share step to reproduce

  • Status changed to Postponed: needs info over 1 year ago
  • 🇺🇸United States japerry KVUO

    This seems specific to your site configuration? Any other information or steps to reproduce?

  • 🇭🇺Hungary Balu Ertl Budapest 🇪🇺

    Occurred for me too, some circumstances I can recall by heart:

    • Having media entities
    • Module uninstalled via GUI

    (I will return back here to complete the reproducible steps when it occurs again.)

  • Status changed to Needs work 3 months ago
  • 🇩🇪Germany hchonov 🇪🇺🇩🇪🇧🇬

    This happened to me after installing our profile and logging into the page and navigating to the content overview page. After rebuilding the caches the error goes away.

Production build 0.71.5 2024