Skip to content

Error upon running Drupal Console after Drupal was updated. #3282

Closed

Description

@roman-yakimkin

Hello.
Sorry for troubling but I had to open this issue.
The reason of it in an error displaying when I'm trying to run the console.

TypeError: Argument 2 passed to Drupal\Console\Command\Config\ExportCommand::__construct() must implement interface Drupal\Core\Config\StorageInterface, none given in Drupal\Console\Command\Config\ExportCommand->__construct() (line 43 of D:\OpenServer\domains\mysite.local\vendor\drupal\console\src\Command\Config\ExportCommand.php).
It happened after I had updated Drupal from 8.3.0 to 8.3.1. Before it I deleted the vendor folder from the site and after it I reinstalled locally and updated the Drupal Console.
Could you clarify me, what did I do wrong and how to repair it ?

Activity

  1. AndyD328 commented on Apr 24, 2017

    @AndyD328

    Having the exact same error here.

    I tried removing vendor and re-installing everything as well as doing a self-update but it made no difference.
    Rolling back to rc16 has worked as a temporary fix with d 8.3.1

    `TypeError: Argument 2 passed to Drupal\Console\Command\Config\ExportCommand::__construct() must implement interface Drupal\Core\Config\StorageInterface, none given in /var/www/sites/d8/thestyx.org.nz/drupal/vendor/drupal/console/src/Command/Config/ExportCommand.php on line 43 #0 [internal function]: Drupal\Console\Command\Config\ExportCommand->__construct(Object(Drupal\Core\Config\ConfigManager))

    #1 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(936): ReflectionClass->newInstanceArgs(Array)

    #2 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/symfony/dependency-injection/ContainerBuilder.php(476): Symfony\Component\DependencyInjection\ContainerBuilder->createService(Object(Symfony\Component\DependencyInjection\Definition), 'console.config_...')

    #3 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/drupal/console/src/Application.php(170): Symfony\Component\DependencyInjection\ContainerBuilder->get('console.config_...')

    #4 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/drupal/console/src/Application.php(41): Drupal\Console\Application->registerCommands()

    #5 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/symfony/console/Application.php(123): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

    #6 /var/www/sites/d8/thestyx.org.nz/drupal/vendor/drupal/console/bin/drupal.php(68): Symfony\Component\Console\Application->run()

    #7 phar:///usr/local/bin/drupal/src/Utils/Launcher.php(30): include_once('/var/www/sites/...')

    #8 phar:///usr/local/bin/drupal/bin/drupal.php(52): Drupal\Console\Launcher\Utils\Launcher->launch('/var/www/sites/...')

    #9 phar:///usr/local/bin/drupal/bin/drupal(3): require('phar:///usr/loc...')

    #10 /usr/local/bin/drupal(10): require('phar:///usr/loc...')

    #11 {main}
    TypeError: Argument 2 passed to Drupal\Console\Command\Config\ExportCommand::__construct() must implement interface Drupal\Core\Config\StorageInterface, none given in Drupal\Console\Command\Config\ExportCommand->__construct() (line 43 of /var/www/sites/d8/thestyx.org.nz/drupal/vendor/drupal/console/src/Command/Config/ExportCommand.php).`

  2. mattwebdev commented on Apr 27, 2017

    @mattwebdev

    im having this issue as well, im on a per-site installation of drupal console. running self-update returns "command not found" - Drupal Console (1.0.0-rc17)

  3. jmolivas commented on Apr 27, 2017

    @jmolivas
    Member

    @mattwebdev drupal self-update must be run outside of the drupal root.

  4. j3ll3nl commented on Apr 28, 2017

    @j3ll3nl

    When i run self-update outside of the drupal root at the "Whereis drupal" location is says:
    Checking for updates from version: "1.0.0-rc16-2-g56546c5"
    Updated from version "1.0.0-rc16-2-g56546c5" to version "1.0.0-rc17".

    But then it stays at the same version.

  5. dgpalmer commented on Apr 28, 2017

    @dgpalmer

    I am getting the same thing @j3ll3nl

  6. jmolivas commented on Apr 30, 2017

    @jmolivas
    Member

    Try updating to latest DrupalConsole, executing from the site root directory

    composer update drupal/console --with-dependencies
    

    If using the Launcher, try updating it by executing from outside of site root directory:

    drupal self-update
    

    And finally rebuild cache executing from your drupal site:

    drupal cr all
    
  7. jmolivas commented on Apr 30, 2017

    @jmolivas
    Member

    @j3ll3nl and @dgpalmer hash was removed and will be fixed on next release RC18.

    drupal-self-update

    Also on RC18 you will be able to execute self-update from the site, it means no need to move outside of drupal root directory to execute the self-update command.

    drupal-self-update-2

  8. wizonesolutions commented on May 2, 2017

    @wizonesolutions

    @jmolivas Did all this, but the launcher won't stay updated (ran from outside of the site root), and it still fails to run in the Drupal directory.

  9. wizonesolutions commented on May 2, 2017

    @wizonesolutions

    Actually — cache clear did work.

  10. jgunawan commented on May 2, 2017

    @jgunawan

    Sounds dumm but drupal cr all worked for me :)

  11. jmolivas commented on Jun 9, 2017

    @jmolivas
    Member

    Closing this one. Feel free to comment if still happening after updating to the latest version.

  12. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    Tried these directions from above:
    Try updating to latest DrupalConsole, executing from the site root directory

    composer update drupal/console --with-dependencies
    If using the Launcher, try updating it by executing from outside of site root directory:

    drupal self-update
    And finally rebuild cache executing from your drupal site:

    drupal cr all

    My result was that I ran out of memory but when I go to the line of code that the error suggests I do not see a variable that I can increment.
    Error thrown after running drupal cr all was:
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 88 bytes) in /Users/kimbled/Sites/devdesktop/tsbvi-dev/docroot/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php on line 267

  13. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    drupal list also throws the error:
    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 64 bytes) in /Users/kimbled/Sites/devdesktop/tsbvi-dev/docroot/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php on line 267

  14. jmolivas commented on Jun 22, 2017

    @jmolivas
    Member

    @GhostInTheMachines you need to increase that value on your php.ini file.

    You can find which php.ini file is loaded via the CLI by executing php --ini

    Open the php.ini file show on the output and increase the memory_limit value.

  15. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    Does drupalconsole use the apache default on a Mac running Sierra or the one that Dev Desktop is using when I am in that docroot?

    I ran the php --ini command and it reported the file to be in /etc but I only find example.php.ini when I look in this directory.

  16. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    sorry that was php.ini.default . I will try to increase the memory by a Meg in this file and see if it makes a difference.

  17. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    changed the memory_limit to 256M from 128 and now it reports that it tried to allocate 32 bytes instead of 64. Numbers don't seem accurate but it sounds like I am on the right track with the correct file being php.ini.default.
    I'll just up it to 512M and see if that gets it.

  18. jmolivas commented on Jun 22, 2017

    @jmolivas
    Member

    can you try this php -i | grep memory_limit and check the new value is applying ?

  19. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    Weird, now the error states that it tried to allocate 75 bytes. Looks like it is random

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /Users/kimbled/Sites/devdesktop/tsbvi-dev/docroot/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php on line 261
    kilroy:docroot kimbled$ drupal list

    Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 75 bytes) in /Users/kimbled/Sites/devdesktop/tsbvi-dev/docroot/vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php on line 267

  20. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    Sure thing: looks like I am in the wrong file

    kilroy:docroot kimbled$ php -i | grep memory_limit
    memory_limit => 128M => 128M

  21. jmolivas commented on Jun 22, 2017

    @jmolivas
    Member

    Try renaming example.php.ini as php.ini.

  22. GhostInTheMachines commented on Jun 22, 2017

    @GhostInTheMachines

    BINGO! It worked.

    Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions