Skip to content

[config_split:import] Call to undefined method isMaintenance() #4130

Closed

Description

@oukjweather

Problem/Motivation

When running drupal config_split:import -y get an Error: Call to undefined method Drupal\config_split\Command\ImportCommand::isMaintenance() in /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php on line 80

How to reproduce

Install drupal console
Setup a website with Drupal 8.7.6 with the config_split module activated.
Run config_split:import command.

Details to include:

  • Drupal version 8.7.6
    drupal/console 1.9.1 The Drupal CLI. A tool to generate boilerplate code, interact with and debug Drupal.
    drupal/console-core 1.9.1 Drupal Console Core
    drupal/console-en 1.9.1 Drupal Console English Language
    drupal/console-extend-plugin 0.9.2 Drupal Console Extend Plugin
  • Console Launcher version 1.9.1

Solution

Fix the code... add the method that is missing, or remove the method call? I'm good with any of the above.

Details to include:

Stack trace:
/var/www/html $ drupal config_split:import
[16-Aug-2019 18:09:35 UTC] Error: Call to undefined method Drupal\config_split\Command\ImportCommand::isMaintenance() in /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php on line 80 #0 /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php(66): Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->switchMaintenanceMode(Object(Symfony\Component\Console\Event\ConsoleTerminateEvent), 'off')
#1 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->disableMaintenanceMode(Object(Symfony\Component\Console\Event\ConsoleTerminateEvent), 'console.termina...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
#2 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.termina...', Object(Symfony\Component\Console\Event\ConsoleTerminateEvent))
#3 /var/www/html/vendor/symfony/console/Application.php(1014): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.termina...', Object(Symfony\Component\Console\Event\ConsoleTerminateEvent))
#4 /var/www/html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Drupal\config_split\Command\ImportCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#5 /var/www/html/vendor/drupal/console-core/src/Application.php(187): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#6 /var/www/html/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#7 /var/www/html/vendor/symfony/console/Application.php(148): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#8 /var/www/html/vendor/drupal/console/bin/drupal.php(89): Symfony\Component\Console\Application->run()
#9 /var/www/html/vendor/drupal/console/bin/drupal(4): require('/var/www/html/v...')
#10 {main}
Error: Call to undefined method Drupal\config_split\Command\ImportCommand::isMaintenance() in Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->switchMaintenanceMode() (line 80 of /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php)

Activity

  1. hjuarez20 commented on Aug 16, 2019

    @hjuarez20
    Contributor

    Hi @oukjweather This sounds like a issue with the config_split module, they need to update the command. Could report this on https://www.drupal.org/project/issues/config_split?categories=All ?

  2. oukjweather commented on Aug 19, 2019

    @oukjweather
    Author

    Hi @harold20, I have reported the issue here: https://www.drupal.org/project/config_split/issues/3075508

    However, I did find that for whatever reason, when I run config_split import via drush, the command works, while using drupal console it does not.

    -------------------------------------- Console output ----------------------------------------
    php.container:/var/www/html $ drush config-split-import -y
    Do a normal (including filters) config import? (y/n): y
    Configuration successfully imported. [success]
    php.container:/var/www/html $ drupal config_split:import -y
    [19-Aug-2019 14:34:49 UTC] Error: Call to undefined method Drupal\config_split\Command\ImportCommand::isMaintenance() in /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php on line 80 #0 /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php(66): Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->switchMaintenanceMode(Object(Symfony\Component\Console\Event\ConsoleTerminateEvent), 'off')
    #1 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(212): Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->disableMaintenanceMode(Object(Symfony\Component\Console\Event\ConsoleTerminateEvent), 'console.termina...', Object(Symfony\Component\EventDispatcher\EventDispatcher))
    #2 /var/www/html/vendor/symfony/event-dispatcher/EventDispatcher.php(44): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch(Array, 'console.termina...', Object(Symfony\Component\Console\Event\ConsoleTerminateEvent))
    #3 /var/www/html/vendor/symfony/console/Application.php(1014): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('console.termina...', Object(Symfony\Component\Console\Event\ConsoleTerminateEvent))
    #4 /var/www/html/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Drupal\config_split\Command\ImportCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #5 /var/www/html/vendor/drupal/console-core/src/Application.php(187): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #6 /var/www/html/vendor/drupal/console/src/Application.php(64): Drupal\Console\Core\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #7 /var/www/html/vendor/symfony/console/Application.php(148): Drupal\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
    #8 /var/www/html/vendor/drupal/console/bin/drupal.php(89): Symfony\Component\Console\Application->run()
    #9 /var/www/html/vendor/drupal/console/bin/drupal(4): require('/var/www/html/v...')
    #10 {main}
    Error: Call to undefined method Drupal\config_split\Command\ImportCommand::isMaintenance() in Drupal\Console\Core\EventSubscriber\MaintenanceModeListener->switchMaintenanceMode() (line 80 of /var/www/html/vendor/drupal/console-core/src/EventSubscriber/MaintenanceModeListener.php).

    This would seem to suggest to me, that perhaps it is something with drupal console? I'm not particularly familiar with either codebase, so could only guess at the differences, but I would think this would suggest some sort of potential problem with how drupal console is implementing its use of config_split.

  3. hjuarez20 commented on Aug 19, 2019

    @hjuarez20
    Contributor

    Yes @oukjweather, It fails because with added the maintenance mode, see this example
    https://github.com/hechoendrupal/drupal-console/blob/master/src/Command/Update/EntitiesCommand.php#L67 It just add this to the config_split commands

  4. enzolutions commented on Sep 17, 2019

    @enzolutions
    Contributor

    @oukjweather I will close this issue, please let me know if you think this should be reopen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions