AJAX HTTP error when executing Batch Update

Created on 9 March 2023, almost 2 years ago
Updated 17 May 2023, over 1 year ago

Problem/Motivation

Batch Update failed with the the following error:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /batch?id=13811&op=do_nojs&op=do
StatusText: OK
ResponseText: Error: Call to a member function getType() on null in Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker() (line 137 of /docroot/modules/contrib/entity_usage/src/EntityUsageBatchManager.php).

Steps to reproduce

I'm not sure if this was due to a misconfiguration that I did in the setting tab, but I've followed the instruction per the provided "Installation and basic usage" and modified the following default setting

  1. Enabled Media and Content under the "ENABLED LOCAL TASKS" section
  2. Enabled File and Media under the "ENABLED SOURCE ENTITY TYPES" section in addition to the default enabled entities
  3. Enabled Content and Media under the "ENABLED TARGET ENTITY TYPES" section in addition to the default enabled entities
  4. Disabled HTML links under "ENABLED TRACKING PLUGINS" section
  5. Enabled Content and Media under "WARNING MESSAGE ON DELETE FORM" section
  6. Enabled Track referencing basefields under "GENERIC" section
  7. Saved the configuration and executed the Batch Update

Update:

I tried running the Batch Update from my terminal using the drush command $ drush eu-r -y and the process failed to complete with this error:

Unable to decode output into JSON: Syntax error                                                                                                                                                                                        
                                                                                                                                                                                                                                         
  Error: Call to a member function getType() on null in Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker() (line 137 of /home/ffattal/mndor/docroot/modules/contrib/entity_usage/src/EntityUsageBatchManager.php).

Error trace:

[warning] Undefined array key 0 EntityUsageBatchManager.php:131
>  [error]  Error: Call to a member function getType() on null in Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker() (line 137 of /home/ffattal/mndor/docroot/modules/contrib/entity_usage/src/EntityUsageBatchManager.php) #0 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(256): Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker()
> #1 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(201): _drush_batch_worker()
> #2 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command()
> #3 /home/ffattal/mndor/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php(20): drush_batch_command()
> #4 [internal function]: Drush\Drupal\Commands\core\BatchCommands->process()
> #5 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
> #6 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
> #7 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
> #8 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(390): Consolidation\AnnotatedCommand\CommandProcessor->process()
> #9 /home/ffattal/mndor/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
> #10 /home/ffattal/mndor/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
> #11 /home/ffattal/mndor/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
> #12 /home/ffattal/mndor/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
> #13 /home/ffattal/mndor/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
> #14 /home/ffattal/mndor/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
> #15 /home/ffattal/mndor/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
> #16 /home/ffattal/mndor/vendor/drush/drush/drush(4): require('...')
> #17 /home/ffattal/mndor/vendor/bin/drush(117): include('...')
> #18 {main}. 
> Error: Call to a member function getType() on null in /home/ffattal/mndor/docroot/modules/contrib/entity_usage/src/EntityUsageBatchManager.php on line 137 #0 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(256): Drupal\entity_usage\EntityUsageBatchManager::updateSourcesBatchWorker()
> #1 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(201): _drush_batch_worker()
> #2 /home/ffattal/mndor/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command()
> #3 /home/ffattal/mndor/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php(20): drush_batch_command()
> #4 [internal function]: Drush\Drupal\Commands\core\BatchCommands->process()
> #5 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array()
> #6 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
> #7 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
> #8 /home/ffattal/mndor/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(390): Consolidation\AnnotatedCommand\CommandProcessor->process()
> #9 /home/ffattal/mndor/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
> #10 /home/ffattal/mndor/vendor/symfony/console/Application.php(1039): Symfony\Component\Console\Command\Command->run()
> #11 /home/ffattal/mndor/vendor/symfony/console/Application.php(275): Symfony\Component\Console\Application->doRunCommand()
> #12 /home/ffattal/mndor/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
> #13 /home/ffattal/mndor/vendor/drush/drush/src/Runtime/Runtime.php(124): Symfony\Component\Console\Application->run()
> #14 /home/ffattal/mndor/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
> #15 /home/ffattal/mndor/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
> #16 /home/ffattal/mndor/vendor/drush/drush/drush(4): require('...')
> #17 /home/ffattal/mndor/vendor/bin/drush(117): include('...')
> #18 {main}
>  [warning] Drush command terminated abnormally.
๐Ÿ› Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States alfattal Minnesota

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

Comments & Activities

Production build 0.71.5 2024