{"record":{"id":"4c7ada92e0b9cef5","repo":"asdf-vm/asdf","slug":"plugin-s-not-found-in-repository","errorCode":null,"errorMessage":"plugin %s not found in repository","messagePattern":"plugin (.+?) not found in repository","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginindex/pluginindex.go","lineNumber":159,"sourceCode":"}\n\nfunc lastUpdated(dir string) (int64, error) {\n\tinfo, err := os.Stat(filepath.Join(dir, repoUpdatedFilename))\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"unable to read last updated file: %w\", err)\n\t}\n\n\t// info.Atime_ns now contains the last access time\n\tupdated := time.Now().UnixNano() - info.ModTime().UnixNano()\n\treturn updated, nil\n}\n\nfunc readPlugin(dir, name string) (string, error) {\n\tfilename := filepath.Join(dir, \"plugins\", name)\n\n\tpluginInfo, err := ini.Load(filename)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"plugin %s not found in repository\", name)\n\t}\n\n\treturn pluginInfo.Section(\"\").Key(\"repository\").String(), nil\n}\n\nfunc getPlugins(dir string) (plugins []Plugin, err error) {\n\tfiles, err := os.ReadDir(filepath.Join(dir, \"plugins\"))\n\tif _, ok := err.(*fs.PathError); ok {\n\t\treturn plugins, nil\n\t}\n\n\tfor _, file := range files {\n\t\tif !file.IsDir() {\n\t\t\turl, err := readPlugin(dir, file.Name())\n\t\t\tif err != nil {\n\t\t\t\treturn plugins, err\n\t\t\t}\n","sourceCodeStart":141,"sourceCodeEnd":177,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/pluginindex/pluginindex.go#L141-L177","documentation":"readPlugin loads plugins/<name> (an ini file) inside the plugin index directory to find the plugin's repository URL. If ini.Load fails — the file does not exist or is not parseable — the (unwrapped) error 'plugin %s not found in repository' is returned. Note it discards the underlying ini error.","triggerScenarios":"Calling GetPluginSourceURL or getPlugins (fed by Refresh) for a plugin name when: the plugin is not listed in the asdf-plugins index; the name is misspelled or has wrong casing; the index is stale/out of date (plugin added upstream recently); the plugin file exists but is malformed ini.","commonSituations":"Typo in `asdf plugin add <name>`; third-party plugin never added to the asdf-plugins repo; an old cached index lacking newly published plugins; community plugins that must be added by git URL instead of short name.","solutions":["Check spelling/casing of the plugin name against `asdf plugin list all`.","Force an index refresh (delete the repository dir under ASDF_DATA_DIR and rerun) so newly published plugins appear.","Add the plugin directly by git URL: asdf plugin add <name> <repo-url>.","If it's your plugin, submit it to the asdf-plugins repository."],"exampleFix":"// before: misspelled / stale index\nasdf plugin add nodejs\n# Error: plugin nodejs not found in repository (if stale)\n// after: refresh index then add\nrm -rf \"${ASDF_DATA_DIR:-$HOME/.asdf}/repository\"\nasdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git","handlingStrategy":"validation","validationCode":"indexFile := filepath.Join(dataDir, \"repository\", \"plugins\", name)\nif _, err := os.Stat(indexFile); err != nil {\n    // not in index; add via full git URL instead\n    return asdf.PluginAdd(conf, name, repoURL)\n}","typeGuard":null,"tryCatchPattern":"url, err := idx.GetPluginSourceURL(name)\nif err != nil {\n    if strings.Contains(err.Error(), \"not found in repository\") {\n        // fall back to explicit git URL\n        url = knownPluginURLs[name]\n    }\n}","preventionTips":["Check `asdf plugin list all` before adding to confirm exact names.","Refresh the index regularly so new plugins are visible.","Use full git URLs for plugins not in the asdf-plugins repo.","Watch for casing: plugin names in the index are exact-match."],"tags":["plugin-index","lookup","naming"],"backgroundTag":"plugin-not-found-in-index","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}