Im keep experementals with Webform, when installing key webform_encrypt webform_content_creator was get error, and now im trying to remove this module, but this is difficult
root@help:/var/www/html# ./vendor/drush/drush/drush pm:uninstall key webform_encrypt webform_content_creator -vvv -d
[preflight] Config paths: /var/www/html/vendor/drush/drush/drush.yml
[preflight] Alias paths: /var/www/html/drush/sites,/var/www/drush/sites
[preflight] Commandfile search paths: /var/www/html/vendor/drush/drush/src
[debug] Bootstrap further to find pm:uninstall [0.09 sec, 8.05 MB]
[debug] Trying to bootstrap as far as we can [0.09 sec, 8.05 MB]
[debug] Drush bootstrap phase: bootstrapDrupalRoot() [0.09 sec, 8.05 MB]
[debug] Change working directory to /var/www/html [0.09 sec, 8.05 MB]
[debug] Initialized Drupal 9.1.2 root directory at /var/www/html [0.09 sec, 8.05 MB]
[debug] Drush bootstrap phase: bootstrapDrupalSite() [0.09 sec, 8.44 MB]
[debug] Initialized Drupal site default at sites/default [0.1 sec, 8.61 MB]
[debug] Drush bootstrap phase: bootstrapDrupalConfiguration() [0.1 sec, 8.61 MB]
[debug] Add service modifier [0.1 sec, 8.78 MB]
[debug] Drush bootstrap phase: bootstrapDrupalDatabase() [0.11 sec, 9.25 MB]
[debug] Successfully connected to the Drupal database. [0.11 sec, 9.25 MB]
[debug] Drush bootstrap phase: bootstrapDrupalFull() [0.11 sec, 9.25 MB]
[debug] Start bootstrap of the Drupal Kernel. [0.11 sec, 9.25 MB]
[debug] Finished bootstrap of the Drupal Kernel. [0.16 sec, 15.29 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigCommands [0.25 sec, 23.01 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigExportCommands [0.25 sec, 23.04 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\config\ConfigImportCommands [0.25 sec, 23.05 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\BatchCommands [0.25 sec, 23.05 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\CliCommands [0.25 sec, 23.06 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\DrupalCommands [0.25 sec, 23.06 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\DeployHookCommands [0.25 sec, 23.07 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\EntityCommands [0.25 sec, 23.08 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\ImageCommands [0.25 sec, 23.09 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\JsonapiCommands [0.25 sec, 23.1 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\LanguageCommands [0.25 sec, 23.11 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\LocaleCommands [0.26 sec, 23.12 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\MessengerCommands [0.26 sec, 23.14 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\QueueCommands [0.26 sec, 23.14 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\RoleCommands [0.26 sec, 23.15 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\StateCommands [0.26 sec, 23.18 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\TwigCommands [0.26 sec, 23.2 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\UserCommands [0.26 sec, 23.21 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\ViewsCommands [0.26 sec, 23.25 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\core\WatchdogCommands [0.26 sec, 23.28 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\pm\PmCommands [0.27 sec, 23.3 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\pm\ThemeCommands [0.27 sec, 23.32 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommands [0.27 sec, 23.32 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeCommentsCommands [0.27 sec, 23.33 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeSessionsCommands [0.27 sec, 23.33 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserFieldsCommands [0.27 sec, 23.33 MB]
[debug] Add a commandfile class: Drush\Drupal\Commands\sql\SanitizeUserTableCommands [0.27 sec, 23.34 MB]
[debug] Add a commandfile class: Drupal\encrypt\Commands\EncryptCommands [0.27 sec, 23.34 MB]
[debug] Add a commandfile class: Drupal\key\Commands\KeyCommands [0.27 sec, 23.35 MB]
[debug] Add a commandfile class: Drupal\token\Commands\TokenCommands [0.27 sec, 23.38 MB]
[debug] Add a commandfile class: Drupal\webform\Commands\WebformCommands [0.27 sec, 23.38 MB]
[debug] Add a commandfile class: Drupal\webform\Commands\WebformSanitizeSubmissionsCommands [0.28 sec, 23.45 MB]
[debug] Add a commandfile class: Drupal\webform_scheduled_email\Commands\WebformScheduledEmailCommands [0.28 sec, 23.46 MB]
[debug] Done with bootstrap max in Application::bootstrapAndFind(): trying to find pm:uninstall again. [0.28 sec, 23.46 MB]
[debug] Starting bootstrap to none [0.28 sec, 23.51 MB]
[debug] Drush bootstrap phase 0 [0.28 sec, 23.51 MB]
[debug] Try to validate bootstrap phase 0 [0.28 sec, 23.51 MB]
The following extensions will be uninstalled: key, webform_encrypt, webform_content_creator, encrypt
Do you want to continue? (yes/no) [yes]:
>
In Container.php line 151:
[Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException]
You have requested a non-existent service "entity.manager".
Exception trace:
at /var/www/html/core/lib/Drupal/Component/DependencyInjection/Container.php:151
Drupal\Component\DependencyInjection\Container->get() at /var/www/html/modules/webform_encrypt/src/WebformEncryptSubmissionStorage.php:66
Drupal\webform_encrypt\WebformEncryptSubmissionStorage::createInstance() at /var/www/html/core/lib/Drupal/Core/Entity/EntityTypeManager.php:285
Drupal\Core\Entity\EntityTypeManager->createHandlerInstance() at /var/www/html/core/lib/Drupal/Core/Entity/EntityTypeManager.php:274
Drupal\Core\Entity\EntityTypeManager->getHandler() at /var/www/html/core/lib/Drupal/Core/Entity/EntityTypeManager.php:208
Drupal\Core\Entity\EntityTypeManager->getStorage() at /var/www/html/core/modules/field/field.module:176
field_entity_field_storage_info() at n/a:n/a
call_user_func_array() at /var/www/html/core/lib/Drupal/Core/Extension/ModuleHandler.php:392
Drupal\Core\Extension\ModuleHandler->invoke() at /var/www/html/core/lib/Drupal/Core/Entity/EntityFieldManager.php:570
Drupal\Core\Entity\EntityFieldManager->buildFieldStorageDefinitions() at /var/www/html/core/lib/Drupal/Core/Entity/EntityFieldManager.php:446
Drupal\Core\Entity\EntityFieldManager->getFieldStorageDefinitions() at /var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php:462
Drupal\Core\Extension\ModuleInstaller->uninstall() at /var/www/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:91
Drupal\Core\ProxyClass\Extension\ModuleInstaller->uninstall() at /var/www/html/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php:116
Drush\Drupal\Commands\pm\PmCommands->uninstall() at n/a:n/a
call_user_func_array() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:257
Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:212
Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter() at /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php:176
Consolidation\AnnotatedCommand\CommandProcessor->process() at /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php:311
Consolidation\AnnotatedCommand\AnnotatedCommand->execute() at /var/www/html/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /var/www/html/vendor/symfony/console/Application.php:1027
Symfony\Component\Console\Application->doRunCommand() at /var/www/html/vendor/symfony/console/Application.php:273
Symfony\Component\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:149
Symfony\Component\Console\Application->run() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:118
Drush\Runtime\Runtime->doRun() at /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php:49
Drush\Runtime\Runtime->run() at /var/www/html/vendor/drush/drush/drush.php:72
require() at /var/www/html/vendor/drush/drush/drush:4
pm:uninstall [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--xh-link XH-LINK] [--notify [NOTIFY]] [--] <command> [<modules>...]
Comments
Back up database before installing
When experimenting with modules, back up the database before installing.
If it turns out the module turns out to be bad, just rollback and you will not have to struggle with uninstalling.
- gisle
Is there any chance to
Is there any chance to disable module with db directly in drupal 9?
Even google is sielent
First, follow Gisle's advice
First, follow Gisle's advice and have a tested backup.
Second, do the simple stuff first. Go to admin/modules and if the module is active, unclick it and click "install" at the bottom. If the module is not a dependency of another module you may get it deactivated. IF you do, you can go to admin/modules/uninstall and try to uninstall the module. That will "really" turn it off. Some modules cannot be uninstalled this way because other modules are dependent. IF you can deactivate and uninstall the other modules first (i.e., you don't need them) you may be able to work through the process to uninstall them all. If that works, you should be able to go into the file system and delete the module from the modules directory (either in core or contrib). Test and clear cache at each step.
You don't want to try to "adjust" module status through the database directly. There are just too many dependencies for that to be a viable approach. In each module's home directory there are install and uninstall programs that need to be run and tweaking the database directly won't let that happen.
Drush no longer supports removing modules.
That command will work on Drupal 8, but not on Drupal 9. See https://www.drupal.org/node/2549139, replacing service entity.manager with entity_type.manager.
Agree that the preferred method is uninstalling that module using the web interface. That is because the module does/should provide the code to remove it from an installation. When removing it, everything will be removed so it can be installed again.
Drupal knows which modules are active for your site by the information stored in {key_value}. Under collection "system.schema" it stores the update id for each active module. Removing such an entry makes it no longer available on your site. This applies to Drupal 8 and is still valid for Drupal 9. You would need to check the module to see what you need to revert when you want to install again later.