{"record":{"id":"da65e21320bd60e1","repo":"router-for-me/CLIProxyAPI","slug":"direct-install-plugin-q-version-q-not-found-in-s","errorCode":null,"errorMessage":"direct install plugin %q version %q not found in source","messagePattern":"direct install plugin %q version %q not found in source","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginstore/install.go","lineNumber":240,"sourceCode":"\t}\n\tfor _, candidate := range plugin.Versions {\n\t\tif normalizeVersion(candidate.Version) != version {\n\t\t\tcontinue\n\t\t}\n\t\tplugin.Version = version\n\t\tplugin.Install = NormalizeInstallPlan(candidate.Install)\n\t\tif plugin.Install.Type == \"\" {\n\t\t\tplugin.Install.Type = InstallTypeDirect\n\t\t}\n\t\tif plugin.Install.Type != InstallTypeDirect {\n\t\t\treturn Plugin{}, fmt.Errorf(\"direct install plugin %q version %q resolved as %q\", id, version, plugin.Install.Type)\n\t\t}\n\t\tif errPlan := ValidateInstallPlan(plugin.Install); errPlan != nil {\n\t\t\treturn Plugin{}, fmt.Errorf(\"direct install plugin %q version %q: %w\", id, version, errPlan)\n\t\t}\n\t\treturn plugin, nil\n\t}\n\treturn Plugin{}, fmt.Errorf(\"direct install plugin %q version %q not found in source\", id, version)\n}\n\nfunc InstallArchive(archiveData []byte, plugin Plugin, options InstallOptions) (InstallResult, error) {\n\toptions = normalizeInstallOptions(options)\n\tid := strings.TrimSpace(plugin.ID)\n\tif !validPluginID(id) {\n\t\treturn InstallResult{}, fmt.Errorf(\"invalid plugin id %q\", plugin.ID)\n\t}\n\tversion := normalizeVersion(plugin.Version)\n\tif !validPluginVersion(version) {\n\t\treturn InstallResult{}, fmt.Errorf(\"invalid plugin version %q\", plugin.Version)\n\t}\n\tplugin.Version = version\n\treader, errZip := zip.NewReader(bytes.NewReader(archiveData), int64(len(archiveData)))\n\tif errZip != nil {\n\t\treturn InstallResult{}, fmt.Errorf(\"open zip: %w\", errZip)\n\t}\n","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginstore/install.go#L222-L258","documentation":"Terminal error from directPluginVersion: the requested version matches neither the plugin's top-level version nor any entry in plugin.Versions (comparison is done after normalizeVersion, so 'v' prefixes are ignored). The plugin exists in the source registry but that specific version does not.","triggerScenarios":"Requesting a version like \"2.0.0\" when the registry only has \"1.x\" entries; typo in the version string; version exists in a different registry than the one at SourceURL; manifest written against a newer registry state than the deployed one.","commonSituations":"Registry lag: plugin released upstream but the consumed registry snapshot is stale; pinning to a version that was never published or was yanked; environments pointing at different registries (staging has it, prod does not).","solutions":["Fetch the registry and list the plugin's available versions (top-level Version plus Versions[]) to confirm what exists","Update the requested manifest.Version to a published version","Refresh/re-point the registry (SourceURL or Client.RegistryURL) if it is stale relative to upstream releases"],"exampleFix":"// before\nmanifest.Version = \"2.0.0\" // only 1.0.0, 1.1.0 published\nplugin, err := client.ResolveDirect(ctx, manifest)\n\n// after\nmanifest.Version = \"1.1.0\"\nplugin, err := client.ResolveDirect(ctx, manifest)","handlingStrategy":"validation","validationCode":"func versionPublished(reg pluginstore.Registry, id, version string) bool {\n    p, ok := reg.PluginByID(strings.TrimSpace(id))\n    if !ok {\n        return false\n    }\n    norm := func(v string) string { return strings.TrimPrefix(strings.TrimSpace(v), \"v\") }\n    if norm(p.Version) == norm(version) {\n        return true\n    }\n    for _, cand := range p.Versions {\n        if norm(cand.Version) == norm(version) {\n            return true\n        }\n    }\n    return false\n}","typeGuard":"func isVersionNotFoundInSource(err error) bool {\n    return err != nil && strings.Contains(err.Error(), \"not found in source\")\n}","tryCatchPattern":"if err != nil {\n    if isVersionNotFoundInSource(err) {\n        // enumerate published versions and suggest the closest match\n    }\n}","preventionTips":["Check requested versions against the live registry before pinning","Refresh the registry before resolving newly released versions","Treat 'v'-prefixed and bare versions as equivalent in your own tooling, as the store does"],"tags":["go","plugin-store","registry","version","lookup"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}