{"record":{"id":"a83a672c1a644055","repo":"hasura/graphql-engine","slug":"failed-to-look-up-install-receipt-for-plugin-q","errorCode":null,"errorMessage":"failed to look up install receipt for plugin %q: %w","messagePattern":"failed to look up install receipt for plugin %q: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/plugins/plugins.go","lineNumber":247,"sourceCode":"\t\t\tfmt.Errorf(\"installation receipt could not be stored, uninstall may fail: %w\", err),\n\t\t)\n\t}\n\n\treturn nil\n}\n\n// Uninstall will uninstall a plugin.\nfunc (c *Config) Uninstall(name string) error {\n\tvar op errors.Op = \"plugins.Config.Uninstall\"\n\n\tif _, err := c.LoadManifest(c.Paths.PluginInstallReceiptPath(name)); err != nil {\n\t\tif stderrors.Is(err, fs.ErrNotExist) {\n\t\t\treturn errors.E(op, ErrIsNotInstalled)\n\t\t}\n\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"failed to look up install receipt for plugin %q: %w\", name, err),\n\t\t)\n\t}\n\n\tsymlinkPath := filepath.Join(c.Paths.BinPath(), PluginNameToBin(name, IsWindows()))\n\tif err := removeLink(symlinkPath); err != nil {\n\t\treturn errors.E(op, fmt.Errorf(\"could not uninstall symlink of plugin: %w\", err))\n\t}\n\n\tpluginInstallPath := c.Paths.PluginInstallPath(name)\n\tif err := os.RemoveAll(pluginInstallPath); err != nil {\n\t\treturn errors.E(\n\t\t\top,\n\t\t\tfmt.Errorf(\"could not remove plugin directory %q: %w\", pluginInstallPath, err),\n\t\t)\n\t}\n\n\tpluginReceiptPath := c.Paths.PluginInstallReceiptPath(name)\n","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/cli/plugins/plugins.go#L229-L265","documentation":"Uninstall() starts by loading the install receipt for the named plugin. If LoadManifest fails with an error other than fs.ErrNotExist (which maps to ErrIsNotInstalled), this error is returned: the receipt file exists but cannot be read or parsed. The uninstall is aborted before anything is removed.","triggerScenarios":"Calling Config.Uninstall when the receipt JSON file exists but is malformed (truncated by a crash mid-write), unreadable due to permissions, or blocked by file locking; any I/O error other than not-existent from reading the receipt path.","commonSituations":"An interrupted earlier install left a half-written receipt; the plugins data dir was copied between machines with wrong permissions; the receipt was hand-edited and no longer valid JSON; enterprise sync/AV software holds the file.","solutions":["Inspect the receipt file at the reported path and validate it is valid JSON (cat / jq . on it)","If corrupted, delete the receipt file and the plugin install directory manually, then re-run uninstall (it will now report not-installed) or reinstall to regenerate a valid receipt","Fix permissions on the plugins data directory if the read fails with EACCES","Restore the receipt from a known-good install of the same plugin version if you want a clean tracked uninstall"],"exampleFix":"# before: receipt corrupted, uninstall errors\n$ rm \"$DATA/plugins/myplugin.json\"   # or fix its JSON\nrm -rf \"$DATA/plugins/myplugin-1.2.3/\"\n# after: uninstall cleanly reports not installed","handlingStrategy":"try-catch","validationCode":"// verify the receipt is readable, valid JSON before uninstalling\nreceiptPath := cfg.Paths.PluginInstallReceiptPath(name)\nif data, err := os.ReadFile(receiptPath); err == nil {\n\tif !json.Valid(data) {\n\t\t_ = os.Remove(receiptPath) // clear corrupt receipt; Uninstall will report not-installed\n\t}\n}","typeGuard":null,"tryCatchPattern":"if err := cfg.Uninstall(name); err != nil {\n\tif strings.Contains(err.Error(), \"failed to look up install receipt\") {\n\t\t// receipt exists but is unreadable: inspect/repair the JSON, then retry or remove manually\n\t}\n}","preventionTips":["Don't hand-edit receipt JSON files","Keep consistent ownership on the plugins data dir across installs/uninstalls","Back up the plugins data dir before bulk migrations between machines"],"tags":["plugins","receipt","uninstall","json-corruption"],"backgroundTag":"corrupted-receipt-file","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}