getgrav/grav · error · NamespaceNotFoundException

Plugin "{$this->pluginName}" is not installed.

Error message

Plugin "{$this->pluginName}" is not installed.

What it means

Thrown by Grav's PluginApplication before any plugin command runs: `bin/plugin <slug> ...` looks the slug up in the global Plugins registry via Plugins::get(), and if no plugin object is registered under that name it fails with this NamespaceNotFoundException. It means Grav's plugin initialization never produced a plugin for that slug — effectively 'unknown plugin' at the CLI level.

Source

Thrown at system/src/Grav/Console/Application/PluginApplication.php:108

        }

        parent::init();

        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

  1. Confirm the plugin exists and is recognized: run `bin/gpm info <slug>` and check user/plugins/<slug>/ exists with its blueprints and main plugin PHP file.
  2. If missing, install it: `bin/gpm install <slug>` (or unzip the plugin so the folder is user/plugins/<slug>).
  3. Fix the folder/file naming: the directory name must equal the plugin slug and contain <slug>.php defining class Grav\Plugin\<Slug>Plugin.
  4. Check for load errors: run `bin/grav clearcache` and look at web-server/CLI logs for PHP fatals in the plugin's files that would prevent registration.

Example fix

# before
$ bin/plugin formms clear-cache  # typo -> Plugin "formms" is not installed.

# after
$ bin/gpm info form   # confirm real slug
$ bin/plugin form clear-cache
Defensive patterns

Strategy: validation

Validate before calling

$slug = 'form';
if (!is_dir('user/plugins/' . $slug)) {
    fwrite(STDERR, "Plugin {$slug} is not installed. Run: bin/gpm install {$slug}" . PHP_EOL);
    exit(1);
}
// then: popen('bin/plugin ' . escapeshellarg($slug) . ' ...', 'r')

Try / catch

try {
    $app->run();
} catch (\Symfony\Component\Console\Exception\NamespaceNotFoundException $e) {
    // message names the plugin; surface install hint
    fwrite(STDERR, $e->getMessage() . PHP_EOL . "Install with: bin/gpm install <slug>" . PHP_EOL);
    exit(1);
}

Prevention

When it happens

Trigger: Running `bin/plugin errorslug command` with a typo in the plugin slug; the plugin was never installed (no user/plugins/<slug>/ directory); the directory exists but the plugin class file <slug>.php or <slug>Plugin.php fails to load (fatal parse error), so it never gets registered; or the folder name does not match the plugin slug Grav expects.

Common situations: Fresh clone or migration where user/plugins content was not carried over; plugin manually copied under a different folder name (e.g. grav-plugin-forms instead of forms); plugin installed via composer but into vendor instead of user/plugins; PHP version incompatibility silently preventing the plugin class from loading during initializeCli().

Related errors


AI-assisted analysis of getgrav/grav@6040efed04 (2026-08-17). Data as JSON: /api/errors/5d30761e17a631de. Report an issue: GitHub.