{"record":{"id":"22497e434438ef01","repo":"octobercms/october","slug":"system-lang-updates-plugin-version-not-found","errorCode":"system::lang.updates.plugin_version_not_found","errorMessage":"Plugin version not found","messagePattern":"Plugin version not found","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/system/classes/updatemanager/ManagesPlugins.php","lineNumber":162,"sourceCode":"        $this->note('<error>Unable to find</error> ' . $name);\n    }\n\n    /**\n     * rollbackPlugin removes an existing plugin database and version record\n     */\n    public function rollbackPluginToVersion(string $name, string $toVersion)\n    {\n        $toVersion = ltrim($toVersion, 'v');\n\n        $plugin = $this->pluginManager->findByIdentifier($name);\n\n        if (!$plugin && $this->versionManager->purgePlugin($name)) {\n            $this->note('<info>Purged from database</info> ' . $name);\n            return;\n        }\n\n        if (!$this->versionManager->hasVersion($plugin, $toVersion)) {\n            throw new ApplicationException(Lang::get('system::lang.updates.plugin_version_not_found'));\n        }\n\n        if ($this->versionManager->removePluginToVersion($plugin, $toVersion)) {\n            $this->note(\"<info>Rolled back</info> {$name} <info>to version</info> {$toVersion}\");\n            return;\n        }\n\n        $this->note('<error>Unable to find</error> ' . $name);\n    }\n}\n","sourceCodeStart":144,"sourceCodeEnd":173,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/classes/updatemanager/ManagesPlugins.php#L144-L173","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Open plugins/<author>/<plugin>/updates/version.yaml and copy a version key exactly as written (mind leading zeros and patch segments)","Update the plugin to a release that contains the version you want, then roll back to it","Remember the leading 'v' is tolerated (it is ltrimmed) but the rest must match character-for-character","If you only want a fresh reinstall, use `php artisan plugin:refresh Author.Plugin` instead of targeting a version"],"exampleFix":"// before — version not defined in the installed plugin\nphp artisan plugin:rollback Acme.Blog --version=2.5.99\n// after — use a key that exists in plugins/acme/blog/updates/version.yaml\nphp artisan plugin:rollback Acme.Blog --version=2.5.9","handlingStrategy":"validation","validationCode":"// Verify the target version exists in the installed plugin's version file\n$versionFile = plugins_path('acme/blog/updates/version.yaml');\n$versions = is_file($versionFile) ? \\Symfony\\Component\\Yaml\\Yaml::parseFile($versionFile) : [];\n$target = ltrim('v2.5.9', 'v');\nif (!array_key_exists($target, (array) $versions)) {\n    throw new InvalidArgumentException(\"Version {$target} not defined by the plugin\");\n}\n// safe to call rollbackPluginToVersion('Acme.Blog', $target)","typeGuard":null,"tryCatchPattern":"try {\n    \\System\\Classes\\UpdateManager::instance()->rollbackPluginToVersion($name, $toVersion);\n} catch (\\October\\Rain\\Exception\\ApplicationException $ex) {\n    if (str_contains($ex->getMessage(), trans('system::lang.updates.plugin_version_not_found'))) {\n        $this->error('Unknown version — pick one from updates/version.yaml');\n        return 1;\n    }\n    throw $ex;\n}","preventionTips":["Read the plugin's updates/version.yaml and paste version keys exactly","Don't trust marketplace version numbers for a locally pinned install","Use plugin:refresh for clean reinstalls instead of guessing rollback versions"],"tags":["octobercms","plugin","rollback","version","migrations"],"backgroundTag":"version-not-found","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}