hasura/graphql-engine · error
failed to look up install receipt for plugin %q: %w
Error message
failed to look up install receipt for plugin %q: %w
What it means
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.
Source
Thrown at cli/plugins/plugins.go:247
fmt.Errorf("installation receipt could not be stored, uninstall may fail: %w", err),
)
}
return nil
}
// Uninstall will uninstall a plugin.
func (c *Config) Uninstall(name string) error {
var op errors.Op = "plugins.Config.Uninstall"
if _, err := c.LoadManifest(c.Paths.PluginInstallReceiptPath(name)); err != nil {
if stderrors.Is(err, fs.ErrNotExist) {
return errors.E(op, ErrIsNotInstalled)
}
return errors.E(
op,
fmt.Errorf("failed to look up install receipt for plugin %q: %w", name, err),
)
}
symlinkPath := filepath.Join(c.Paths.BinPath(), PluginNameToBin(name, IsWindows()))
if err := removeLink(symlinkPath); err != nil {
return errors.E(op, fmt.Errorf("could not uninstall symlink of plugin: %w", err))
}
pluginInstallPath := c.Paths.PluginInstallPath(name)
if err := os.RemoveAll(pluginInstallPath); err != nil {
return errors.E(
op,
fmt.Errorf("could not remove plugin directory %q: %w", pluginInstallPath, err),
)
}
pluginReceiptPath := c.Paths.PluginInstallReceiptPath(name)
View on GitHub (pinned to 724551b9ae)
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
Example fix
# before: receipt corrupted, uninstall errors $ rm "$DATA/plugins/myplugin.json" # or fix its JSON rm -rf "$DATA/plugins/myplugin-1.2.3/" # after: uninstall cleanly reports not installed
Defensive patterns
Strategy: try-catch
Validate before calling
// verify the receipt is readable, valid JSON before uninstalling
receiptPath := cfg.Paths.PluginInstallReceiptPath(name)
if data, err := os.ReadFile(receiptPath); err == nil {
if !json.Valid(data) {
_ = os.Remove(receiptPath) // clear corrupt receipt; Uninstall will report not-installed
}
} Try / catch
if err := cfg.Uninstall(name); err != nil {
if strings.Contains(err.Error(), "failed to look up install receipt") {
// receipt exists but is unreadable: inspect/repair the JSON, then retry or remove manually
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- could not remove plugin receipt %q: %w
- installation receipt could not be stored, uninstall may fail
- could not uninstall symlink of plugin: %w
- could not remove plugin directory %q: %w
- write plugin receipt %q: %w
AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28).
Data as JSON: /api/errors/a83a672c1a644055.
Report an issue: GitHub.