Problem/Motivation

PHP Fatal error: Trait 'Robo\TaskAccessor' not found in /path/to/docroot/themes/contrib/radix/Commands/radix/SubThemeCommands.php on line 25
Drush command terminated abnormally due to an unrecoverable error.

Steps to reproduce

Download and enable radix and components: composer require drupal/radix; drush en components radix -y
Create a sub-theme: drush --include="themes/contrib/radix" radix:create "SUB THEME"

Drush version: 8.4.2
Drupal version: 8.9.6

CommentFileSizeAuthor
#12 3173811.patch674 bytesgloomcheng

Comments

huijse created an issue. See original summary.

elaman’s picture

Assigned: Unassigned » elaman

Try running drush radix "SUB THEME".

elaman’s picture

Assigned: elaman » Unassigned
yi_jiang’s picture

I got the same issue, upgrade drush fixed.

Similar issue: https://www.drupal.org/project/bootstrap_storybook/issues/3178927

timlie’s picture

#2 works for me.

timlie’s picture

Version: 8.x-4.9 » 8.x-4.10
ckng’s picture

Status: Active » Closed (works as designed)

Please reopen if this is still an issue. Documentation needs update, also Drush 8 is required, Drush 9/10 is recommended.

nikitas’s picture

Hi, on a fresh drupal 9 installation i get the following error

drush --include="web/themes/contrib/radix" radix:create "test"
PHP Fatal error:  Trait 'Robo\Task\Archive\loadTasks' not found in /Users/user/www/d9/web/themes/contrib/radix/Commands/radix/SubThemeCommands.php on line 27

Fatal error: Trait 'Robo\Task\Archive\loadTasks' not found in /Users/user/www/d9/web/themes/contrib/radix/Commands/radix/SubThemeCommands.php on line 27
 [warning] Drush command terminated abnormally.

This is my composer.json file:

{
    "name": "drupal/recommended-project",
    "description": "Project template for Drupal 9 projects with a relocated document root",
    "type": "project",
    "license": "GPL-2.0-or-later",
    "homepage": "https://www.drupal.org/project/drupal",
    "support": {
        "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
        "chat": "https://www.drupal.org/node/314178"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    ],
    "require": {
        "composer/installers": "^1.9",
        "drupal/components": "^2.4",
        "drupal/core-composer-scaffold": "^9.2",
        "drupal/core-project-message": "^9.2",
        "drupal/core-recommended": "^9.2",
        "drupal/radix": "4.x-dev"
    },
    "conflict": {
        "drupal/drupal": "*"
    },
    "minimum-stability": "stable",
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    },
    "extra": {
        "drupal-scaffold": {
            "locations": {
                "web-root": "web/"
            }
        },
        "installer-paths": {
            "web/core": [
                "type:drupal-core"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library"
            ],
            "web/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "web/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "web/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/Commands/contrib/{$name}": [
                "type:drupal-drush"
            ],
            "web/modules/custom/{$name}": [
                "type:drupal-custom-module"
            ],
            "web/profiles/custom/{$name}": [
                "type:drupal-custom-profile"
            ],
            "web/themes/custom/{$name}": [
                "type:drupal-custom-theme"
            ]
        },
        "drupal-core-project-message": {
            "include-keys": [
                "homepage",
                "support"
            ],
            "post-create-project-cmd-message": [
                "<bg=blue;fg=white>                                                         </>",
                "<bg=blue;fg=white>  Congratulations, you’ve installed the Drupal codebase  </>",
                "<bg=blue;fg=white>  from the drupal/recommended-project template!          </>",
                "<bg=blue;fg=white>                                                         </>",
                "",
                "<bg=yellow;fg=black>Next steps</>:",
                "  * Install the site: https://www.drupal.org/docs/8/install",
                "  * Read the user guide: https://www.drupal.org/docs/user_guide/en/index.html",
                "  * Get support: https://www.drupal.org/support",
                "  * Get involved with the Drupal community:",
                "      https://www.drupal.org/getting-involved",
                "  * Remove the plugin that prints this message:",
                "      composer remove drupal/core-project-message"
            ]
        }
    },
    "require-dev": {
        "drush/drush": "^10.6"
    }
}

Can you help ?
Thank you

nikitas’s picture

Fixed: i was able to fix the issue above by adding to the main drupal composer.json file the missing Robo library. I am using drush 10.6, drupal 9.2.7, components 8.x-2.4 and radix 4.x-dev .
My updated composer.json file looks like this (in the bottom of the composer.json file):
//Last lines of composer.json file
"require-dev": {
"consolidation/robo": "^1.0.0",
"drush/drush": "^10.6"
}
}
Do not forget to run "composer update" after adding the missing Robo library.

voviko’s picture

it is necessary to install composer require "boedah/robo-drush"

charly71’s picture

I'm still not able to install radix subtheme in a starting Drupal 9.3 installation. Same error for me...
I've installed consolidation/robo and boedah/robo-drush.

drush --include="themes/contrib/radix" radix:create "appstato_radix"
PHP Fatal error:  Trait 'Robo\Task\Archive\loadTasks' not found in /var/www/mydomain/mypath/myroot/themes/contrib/radix/Commands/radix/SubThemeCommands.php on line 23
gloomcheng’s picture

StatusFileSize
new674 bytes

@charly71 you could try this patch.

jcandan’s picture

Status: Closed (works as designed) » Reviewed & tested by the community

Ran into this issue on a fresh Drupal 9 instance with drush:10.6.2 and drupal/radix:4.x-dev.

Patch from #12 fixed this issue for me.

lordgretix’s picture

Edit: Sorry, I pasted the error twice.

On a fresh Drupal 9.3.3 with drush 11.0.2 im having this issue. The patch fixes the issue, however it throws a new issue.

drush --include="web/themes/contrib/radix" radix:create "test" 
Error: Call to undefined method Drush\Log\DrushLoggerManager::setErrorStream() in /var/www/drupal9/vendor/consolidation/robo/src/Log/ResultPrinter.php on line 27 #0 /var/www/drupal9/vendor/consolidation/robo/src/Result.php(274): Robo\Log\ResultPrinter->setOutput()
#1 /var/www/drupal9/vendor/consolidation/robo/src/Result.php(84): Robo\Result->resultPrinter()
#2 /var/www/drupal9/vendor/consolidation/robo/src/Result.php(40): Robo\Result->printResult()
#3 /var/www/drupal9/vendor/consolidation/robo/src/Result.php(159): Robo\Result->__construct()
#4 /var/www/drupal9/vendor/consolidation/robo/src/Collection/Collection.php(528): Robo\Result::success()
#5 /var/www/drupal9/vendor/consolidation/robo/src/Collection/Collection.php(518): Robo\Collection\Collection->runWithoutCompletion()
#6 /var/www/drupal9/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(609): Robo\Collection\Collection->run()
#7 /var/www/drupal9/vendor/consolidation/robo/src/Collection/CollectionBuilder.php(590): Robo\Collection\CollectionBuilder->runTasks()
#8 /var/www/drupal9/vendor/consolidation/robo/src/Collection/CollectionProcessHook.php(30): Robo\Collection\CollectionBuilder->run()
#9 /var/www/drupal9/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ProcessResultHookDispatcher.php(53): Robo\Collection\CollectionProcessHook->process()
#10 /var/www/drupal9/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ProcessResultHookDispatcher.php(44): Consolidation\AnnotatedCommand\Hooks\Dispatchers\ProcessResultHookDispatcher->doProcessor()
#11 /var/www/drupal9/vendor/consolidation/annotated-command/src/Hooks/Dispatchers/ProcessResultHookDispatcher.php(35): Consolidation\AnnotatedCommand\Hooks\Dispatchers\ProcessResultHookDispatcher->callProcessor()
#12 /var/www/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(219): Consolidation\AnnotatedCommand\Hooks\Dispatchers\ProcessResultHookDispatcher->process()
#13 /var/www/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(213): Consolidation\AnnotatedCommand\CommandProcessor->processResults()
#14 /var/www/drupal9/vendor/consolidation/annotated-command/src/CommandProcessor.php(176): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
#15 /var/www/drupal9/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(350): Consolidation\AnnotatedCommand\CommandProcessor->process()
#16 /var/www/drupal9/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
#17 /var/www/drupal9/vendor/symfony/console/Application.php(1027): Symfony\Component\Console\Command\Command->run()
#18 /var/www/drupal9/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand()
#19 /var/www/drupal9/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun()
#20 /var/www/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(121): Symfony\Component\Console\Application->run()
#21 /var/www/drupal9/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun()
#22 /var/www/drupal9/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run()
#23 /var/www/drupal9/vendor/drush/drush/includes/preflight.inc(18): require('/var/www/dr...')
#24 phar:///usr/local/bin/drush/bin/drush.php(143): drush_main()
#25 /usr/local/bin/drush(14): require('phar:///usr/loc...')
#26 {main}
Error: Call to undefined method Drush\Log\DrushLoggerManager::setErrorStream() in Robo\Log\ResultPrinter->setOutput() (line 27 of /var/www/drupal9/vendor/consolidation/robo/src/Log/ResultPrinter.php).

Im guessing that this is related to dependecy issue, since radix requires consolidation/robo:^1.1.4 || ^2 and drush 11.x uses consolidation/robo:^3

jcandan’s picture

@Endika Melero, consider reporting that in a new issue, perhaps to support Drush 11.

In that case, @Endika Melero has also tested patch #12 works. In order to see this merged, should documentation be updated to state that, for now, Radix supports Drush 9 and 10 only?

  • doxigo committed 8679d77 on 8.x-4.x authored by gloomcheng
    Issue #3173811 by gloomcheng, elaman, huijse, timlie, nikitas, jcandan,...
doxigo’s picture

Status: Reviewed & tested by the community » Needs work

Thanks to @Endika, pushed the #12 patch to the dev release, have to look into the Drush 11 issue afterward

doxigo’s picture

Status: Needs work » Fixed

Closing this and created a related task: https://www.drupal.org/project/radix/issues/3259559

mauzilla’s picture

Anyone willing to tell me how to apply / install the patch?

doxigo’s picture

@mauzilla try the latest dev instance with Drush 10 for now, should be okay

jcandan’s picture

katekarpenko’s picture

I also had this issue, again.
This time from the groud I've used Drush Version 10.6.1 and performed this:
drush --include="docroot/themes/contrib/radix" radix:create "radix subtheme"

and have got an error like this:
PHP Fatal error: Trait 'Robo\Task\Archive\Tasks' not found in /var/www/html/docroot/themes/contrib/radix/Commands/radix/SubThemeCommands.php on line 24

I've tried a lot of methods to fixed that, unfortunately pacth hadn't work for me, and only one thing helped me - updating consolidation/robo by using next command:
composer require consolidation/robo:^3 -W

and creating a radix subtheme was successfull:

drush --include="docroot/themes/contrib/radix" radix:create "radix subtheme"
 2/2 [============================] 100%
nikitas’s picture

i was able to create a subtheme only with after updating the robo to ^3 as KateKarpenko in
#22 suggests (https://www.drupal.org/project/radix/issues/3173811#comment-14385211)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.