{"record":{"id":"aa25820c9c940607","repo":"hasura/graphql-engine","slug":"failed-to-install-new-version-w","errorCode":null,"errorMessage":"failed to install new version: %w","messagePattern":"failed to install new version: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/plugins.go","lineNumber":448,"sourceCode":"\n\t// See if it's a newer version\n\tif installReceipt.ParsedVersion != nil {\n\t\tif !installReceipt.ParsedVersion.LessThan(plugin.ParsedVersion) ||\n\t\t\tinstallReceipt.ParsedVersion.Equal(plugin.ParsedVersion) {\n\t\t\treturn plugin, errors.E(op, ErrIsAlreadyUpgraded)\n\t\t}\n\t}\n\n\tif err = c.StoreManifest(plugin, c.Paths.PluginInstallReceiptPath(plugin.Name)); err != nil {\n\t\treturn plugin, errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"installation receipt could not be stored, uninstall may fail: %w\", err),\n\t\t)\n\t}\n\n\t// Re-Install\n\tif err := c.installPlugin(plugin, platform); err != nil {\n\t\treturn plugin, errors.E(op, fmt.Errorf(\"failed to install new version: %w\", err))\n\t}\n\n\t// Clean old installations\n\terr = os.RemoveAll(c.Paths.PluginVersionInstallPath(plugin.Name, installReceipt.Version))\n\tif err != nil {\n\t\treturn plugin, errors.E(op, err)\n\t}\n\n\treturn plugin, nil\n}\n\nfunc (c *Config) LoadManifest(path string) (Plugin, error) {\n\tvar op errors.Op = \"plugins.Config.LoadManifest\"\n\n\tplugin, err := c.ReadPluginFromFile(path)\n\tif err != nil {\n\t\treturn plugin, errors.E(op, err)\n\t}","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/plugins.go#L430-L466","documentation":"This error is thrown by the plugin Upgrade flow when the newly downloaded plugin version fails to install after the old version was already uninstalled. It wraps the underlying error from installPlugin, which typically covers copying the plugin binary into the versioned install directory. Because it occurs mid-upgrade, the plugin may be left uninstalled.","triggerScenarios":"Calling Config.Upgrade (via the CLI plugin upgrade command / Run) when the old version was removed but reinstalling the new platform-specific plugin artifact fails: download artifact missing for the platform, disk full, or the versioned install path is not writable.","commonSituations":"Upgrading a plugin whose remote index entry lacks an artifact for linux/arm64 or another uncommon platform; permissions changed on the plugins directory; running as a different user than the one who installed the plugins; disk exhaustion during copy.","solutions":["Check that the plugin's index manifest actually publishes an artifact for your GOOS/GOARCH platform and version","Verify write permissions and free disk space on the plugin install path (Paths.PluginVersionInstallPath)","Retry the upgrade after a failed partial install; if it still fails, reinstall the plugin from scratch with Install to restore a working state","Inspect the wrapped error chain (errors.Unwrap / %w) to see the exact installPlugin failure"],"exampleFix":"# before\nmycli plugin upgrade grafana-dashboard\n# Error: plugins.Config.Upgrade: failed to install new version: ...\n\n# after: verify platform artifact exists in the plugin index, then\nmycli plugin install grafana-dashboard --version 1.2.3","handlingStrategy":"fallback","validationCode":"if _, err := cfg.LoadPluginByName(name); err != nil { /* don't attempt upgrade */ }\nif runtime.GOOS+\"/\"+runtime.GOARCH != plugin.SupportedPlatform { /* skip upgrade */ }","typeGuard":null,"tryCatchPattern":"plugin, err := cfg.Upgrade(name, platform)\nif err != nil {\n\tvar target *plugins.Plugin // if typed errors available; otherwise inspect message\n\tif strings.Contains(err.Error(), \"failed to install new version\") {\n\t\t// plugin may be uninstalled now: reinstall last known good version\n\t\t_, _ = cfg.Install(name, lastGoodVersion, platform)\n\t}\n\treturn err\n}","preventionTips":["Pin a known-good plugin version before upgrading so you can reinstall it on failure","Verify the plugin index publishes an artifact for your platform before upgrading","Keep the plugins directory writable by the running user"],"tags":["plugins","upgrade","install","filesystem"],"backgroundTag":"plugin-install-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}