getgrav/grav · error · NamespaceNotFoundException
Plugin "{$this->pluginName}" is not enabled.
Error message
Plugin "{$this->pluginName}" is not enabled. What it means
Grav's PluginApplication throws this when the named plugin IS registered but its enabled property is false, so its CLI commands are deliberately not exposed. It is a configuration gate, not a code failure: Grav refuses to attach the PluginCommandLoader for a disabled plugin.
Source
Thrown at system/src/Grav/Console/Application/PluginApplication.php:111
if (null === $this->pluginName) {
$this->setDefaultCommand('plugins:list');
return;
}
$grav = Grav::instance();
$grav->initializeCli();
/** @var Plugins $plugins */
$plugins = $grav['plugins'];
$plugin = $this->pluginName ? $plugins::get($this->pluginName) : null;
if (null === $plugin) {
throw new NamespaceNotFoundException("Plugin \"{$this->pluginName}\" is not installed.");
}
if (!$plugin->enabled) {
throw new NamespaceNotFoundException("Plugin \"{$this->pluginName}\" is not enabled.");
}
$this->setCommandLoader(new PluginCommandLoader($this->pluginName));
}
}
View on GitHub (pinned to 6040efed04)
Solutions
- Enable the plugin: in Admin under Plugins, toggle it on, or edit user/config/plugins/<slug>.yaml and set `enabled: true` (create the file if absent).
- Check for competing overrides: the effective value comes from user/config/system.yaml, user/config/plugins/<slug>.yaml and the plugin's own YAML — make sure none sets enabled: false later in the merge order.
- Verify: `bin/gpm info <slug>` or reload admin Plugins page to confirm the state, then re-run the CLI command.
- If it must stay disabled in web context but run in CLI, note Grav does not support that split via this flag — you need the plugin enabled for its CLI commands.
Example fix
# user/config/plugins/email.yaml # before enabled: false # after enabled: true # then: bin/plugin email flush-queue works
Defensive patterns
Strategy: validation
Validate before calling
use Grav\Common\Grav;
use Grav\Common\Plugins;
$grav = Grav::instance();
$grav['plugins']->init();
$plugin = Plugins::get($slug);
if (null === $plugin) {
exit("Plugin {$slug} not installed" . PHP_EOL);
}
if (!$plugin->enabled) {
exit("Plugin {$slug} is disabled; set enabled: true in user/config/plugins/{$slug}.yaml" . PHP_EOL);
} Try / catch
try {
$app->run();
} catch (\Symfony\Component\Console\Exception\NamespaceNotFoundException $e) {
// distinguish 'not installed' vs 'not enabled' from the message
if (str_contains($e->getMessage(), 'not enabled')) {
fwrite(STDERR, "Enable it: edit user/config/plugins/{$slug}.yaml" . PHP_EOL);
}
exit(1);
} Prevention
- Check Plugins::get($slug)->enabled before shelling out to bin/plugin.
- Automate plugin enablement in deployment config so staging/production states cannot drift.
- After disabling a plugin in admin, remember its CLI commands become unavailable too.
When it happens
Trigger: Running `bin/plugin <slug> <command>` while user/config/plugins/<slug>.yaml (or the plugin's own user/plugins/<slug>/<slug>.yaml) sets enabled: false; the plugin was disabled from the admin interface; a site-wide plugins config override disables it; or the plugin ships disabled by default and was never turned on.
Common situations: Plugin toggled off in admin during troubleshooting and forgotten; staging config copied to production with enabled: false; plugin disabled by default (many premium/plugin-first plugins are) after a fresh install; YAML indentation error making the enabled flag land under the wrong key.
Related errors
- Plugin "{$this->pluginName}" is not installed.
- No backups defined...
- Backup location: {$backup_root} does not exist...
- Cache folder not defined.
- Setup: Configuration reload loop detected!
AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17).
Data as JSON: /api/errors/e447839dac84cd4d.
Report an issue: GitHub.