Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The nodes are created, even though there is an error. Versions:
- Drupal 8.4.4, based on https://github.com/drupal-composer/drupal-project
- Drush 9.1, with https://github.com/drush-ops/drush-launcher
- Devel 8.x-1.2
$ drush en devel devel_generate -y && drush genc 50;
[success] Successfully enabled: devel, devel_generate
[status] Finished creating 50 nodes
[status] Generate process complete.
[warning] Invalid argument supplied for foreach() batch.inc:133
[error] Error: Call to a member function claimItem() on null in _drush_batch_worker() (line 218 of /var/www/public/mysite/vendor/drush/drush/includes/batch.inc)
#0 /var/www/public/mysite/vendor/drush/drush/includes/batch.inc(183): _drush_batch_worker()
#1 /var/www/public/mysite/vendor/drush/drush/includes/batch.inc(95): _drush_batch_command('2')
#2 /var/www/public/mysite/vendor/drush/drush/src/Drupal/Commands/core/BatchCommands.php(19): drush_batch_command('2')
#3 [internal function]: Drush\Drupal\Commands\core\BatchCommands->process('2', Array)
#4 /var/www/public/mysite/vendor/consolidation/annotated-command/src/CommandProcessor.php(235): call_user_func_array(Array, Array)
#5 /var/www/public/mysite/vendor/consolidation/annotated-command/src/CommandProcessor.php(181): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#6 /var/www/public/mysite/vendor/consolidation/annotated-command/src/CommandProcessor.php(147): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#7 /var/www/public/mysite/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(404): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#8 /var/www/public/mysite/vendor/symfony/console/Command/Command.php(264): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 /var/www/public/mysite/vendor/symfony/console/Application.php(859): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 /var/www/public/mysite/vendor/symfony/console/Application.php(206): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /var/www/public/mysite/vendor/symfony/console/Application.php(125): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /var/www/public/mysite/vendor/drush/drush/src/Runtime/Runtime.php(112): Symfony\Component\Console\Application->run(Object(Drush\Symfony\LessStrictArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 /var/www/public/mysite/vendor/drush/drush/src/Runtime/Runtime.php(41): Drush\Runtime\Runtime->doRun(Array)
#14 /var/www/public/mysite/vendor/drush/drush/drush.php(64): Drush\Runtime\Runtime->run(Array)
#15 /var/www/public/mysite/vendor/drush/drush/includes/preflight.inc(17): require('/var/www/public...')
#16 phar:///usr/local/bin/drush/bin/drush.php(137): drush_main()
#17 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#18 {main}.
Comment | File | Size | Author |
---|---|---|---|
#12 | devel_generate_claimItem-2943975-12.patch | 557 bytes | DuaelFr |
|
Comments
Comment #2
shrop CreditAttribution: shrop commentedI am seeing the same issue, but the first run generated the error below for each node that was attempted to be created. No nodes were created:
Comment #3
unqunq CreditAttribution: unqunq commentedI can replicate with Drupal: 8.5.0, Drush: 9.2.1 Devel: 8.x-1.2.
I can generate terms fine. This pops up when I try to generate nodes of a custom content type which works fine via the UI.
Comment #4
Prashant.cI have Drush version
8.0.1
and Drupal version8.6.x
, Devel Version8.x-1.x
and commanddrush genc 50
worked fine, it created 50 nodes successfully.In case of #1, #2 and #3 it could be an issue with the Drush 9 only.
Comment #5
imperator_99 CreditAttribution: imperator_99 commentedI get the same error with Drush 9.3.0, Drupal 8.5.4 and Devel 8.x-1.2. Nodes get created, however. I generated 10 nodes.
Cheers,
Jesse.
Comment #6
brayfe CreditAttribution: brayfe commentedI get the exact same error as well when using Drupal 8.5.4, Drush 9.3.0 and Devel 8.x-1.2. Nodes are created, but this error is thrown. Since I'm using BLT, I cannot downgrade drush to the 8.x version. It would be great of someone else could test it with Drush 8.
Comment #7
Amacado CreditAttribution: Amacado commentedSame issue here:
drush 9.3.0
drupal 8.5.6
devel 8.x-1.2
I tried downgrade to drush 8.1.17. Note when downgrading from drush 9 you will run into a
PHP Fatal error: Class 'Drush\Commands\DrushCommands' not found in /var/www/html/path-to-site/drush/Commands/PolicyCommands.php
error. You can fix that when remove/rename the PolicyCommands.php file (https://github.com/drush-ops/drush/issues/3456). For example like this:mv drush/Commands/PolicyCommands.php drush/Commands/PolicyCommands.php.bak
After solving this problem i got into the error
Missing argument 2 for Drush\Sql\SqlBase::__construct() SqlBase.php:34
which i could not resolve.Comment #8
rfsbsbI confirm I'm having the same error with:
Drush Launcher Version: 0.6.0
Drush Launcher Version: 0.6.0
Drush Commandline Tool 9.3.0
PHP: 7.1.21
Drupal: 8.5.5
Comment #9
ressa CreditAttribution: ressa at Ardea commentedStill an issue:
Comment #10
ressa CreditAttribution: ressa at Ardea commentedComment #11
RoSk0Still present:
Drupal version: 8.6.13
Drush version: 9.5.2
Devel: 8.x-2.0
Comment #12
DuaelFrThe issue occurs because
drush_backend_batch_process()
is ran twice.Here is a patch. Reviews welcome!
Comment #14
moshe weitzman CreditAttribution: moshe weitzman commentedRight you are. Merged.
Comment #15
ressa CreditAttribution: ressa at Ardea commentedI no longer get the error, thanks @DuaelFr and @moshe weitzman! It looks like there has been a lot of improvements (including this one) since 8.x-2.0, so perhaps a fresh release is worth considering?
Comment #16
ressa CreditAttribution: ressa at Ardea commentedNot sure why it changed Status ...
Comment #17
DuaelFrThanks a lot!
I supposed you wanted to mark the issue as "Fixed" :)