octobercms/october · error · ApplicationException

system::lang.updates.plugin_version_not_found

system::lang.updates.plugin_version_not_found

Error message

Plugin version not found

What it means

UpdateManager::rollbackPluginToVersion($name, $toVersion) strips a leading 'v', locates the plugin, and asks versionManager->hasVersion($plugin, $toVersion) whether that version exists in the plugin's migration history (updates/version.yaml). If not, it throws the localized 'Plugin version not found' (system::lang.updates.plugin_version_not_found). The rollback only accepts versions the plugin actually defines — you cannot roll back to an arbitrary or future version number.

Source

Thrown at modules/system/classes/updatemanager/ManagesPlugins.php:162

        $this->note('<error>Unable to find</error> ' . $name);
    }

    /**
     * rollbackPlugin removes an existing plugin database and version record
     */
    public function rollbackPluginToVersion(string $name, string $toVersion)
    {
        $toVersion = ltrim($toVersion, 'v');

        $plugin = $this->pluginManager->findByIdentifier($name);

        if (!$plugin && $this->versionManager->purgePlugin($name)) {
            $this->note('<info>Purged from database</info> ' . $name);
            return;
        }

        if (!$this->versionManager->hasVersion($plugin, $toVersion)) {
            throw new ApplicationException(Lang::get('system::lang.updates.plugin_version_not_found'));
        }

        if ($this->versionManager->removePluginToVersion($plugin, $toVersion)) {
            $this->note("<info>Rolled back</info> {$name} <info>to version</info> {$toVersion}");
            return;
        }

        $this->note('<error>Unable to find</error> ' . $name);
    }
}

View on GitHub (pinned to b608633a7e)

Solutions

  1. Open plugins/<author>/<plugin>/updates/version.yaml and copy a version key exactly as written (mind leading zeros and patch segments)
  2. Update the plugin to a release that contains the version you want, then roll back to it
  3. Remember the leading 'v' is tolerated (it is ltrimmed) but the rest must match character-for-character
  4. If you only want a fresh reinstall, use `php artisan plugin:refresh Author.Plugin` instead of targeting a version

Example fix

// before — version not defined in the installed plugin
php artisan plugin:rollback Acme.Blog --version=2.5.99
// after — use a key that exists in plugins/acme/blog/updates/version.yaml
php artisan plugin:rollback Acme.Blog --version=2.5.9
Defensive patterns

Strategy: validation

Validate before calling

// Verify the target version exists in the installed plugin's version file
$versionFile = plugins_path('acme/blog/updates/version.yaml');
$versions = is_file($versionFile) ? \Symfony\Component\Yaml\Yaml::parseFile($versionFile) : [];
$target = ltrim('v2.5.9', 'v');
if (!array_key_exists($target, (array) $versions)) {
    throw new InvalidArgumentException("Version {$target} not defined by the plugin");
}
// safe to call rollbackPluginToVersion('Acme.Blog', $target)

Try / catch

try {
    \System\Classes\UpdateManager::instance()->rollbackPluginToVersion($name, $toVersion);
} catch (\October\Rain\Exception\ApplicationException $ex) {
    if (str_contains($ex->getMessage(), trans('system::lang.updates.plugin_version_not_found'))) {
        $this->error('Unknown version — pick one from updates/version.yaml');
        return 1;
    }
    throw $ex;
}

Prevention

When it happens

Trigger: `php artisan plugin:rollback Author.Plugin --version=X.Y.Z` where X.Y.Z does not appear as a key in plugins/author/plugin/updates/version.yaml (typo, differently formatted number, or a version from a newer branch); also when passing a version that exists upstream but was never in the installed plugin's version file.

Common situations: Assuming the marketplace's latest version number instead of the installed copy's version.yaml; format drift ('1.10' vs 'v1.10' vs '1.10.0'); rolling back a plugin whose files were updated to a branch without that version entry; copy-pasting a version from the changelog rather than the local file.

Related errors


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/22497e434438ef01. Report an issue: GitHub.