hashicorp/nomad · warning
could not remove eventlog configuration - %w
Error message
could not remove eventlog configuration - %w
What it means
performUninstall wraps the error from srvc.DisableEventlog(), which removes the Nomad service's event-log registration so stale entries do not remain after deletion. Failure means the event-log registry configuration could not be updated, though the service itself has already been stopped.
Source
Thrown at command/windows_service_uninstall.go:112
if !exists {
return nil
}
// Grab the service and ensure the service is stopped
srvc, err := m.GetService(winsvc.WINDOWS_SERVICE_NAME)
if err != nil {
return fmt.Errorf("could not get existing service - %w", err)
}
defer srvc.Close()
if err := srvc.Stop(); err != nil {
return fmt.Errorf("unable to stop service - %w", err)
}
// Remove the service from the event log
if err := srvc.DisableEventlog(); err != nil {
return fmt.Errorf("could not remove eventlog configuration - %w", err)
}
// Finally, delete the service
if err := srvc.Delete(); err != nil {
return fmt.Errorf("could not delete service - %w", err)
}
return nil
}
View on GitHub (pinned to 482b49bf1a)
Solutions
- Run the uninstall from an elevated Administrator prompt
- Check the wrapped error for a registry access-denied code and inspect the EventLog key ACLs
- Delete the eventlog registry key manually (reg delete) and re-run uninstall
- Restart the Windows Event Log service if it holds the key
Example fix
// manual cleanup alternative reg delete HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\nomad /f
Defensive patterns
Strategy: fallback
Try / catch
if err := uninstallCmd.Run(); err != nil {
if strings.Contains(err.Error(), "eventlog configuration") {
// fall back to manual registry cleanup:
exec.Command("reg", "delete", `HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\nomad`, "/f")
}
} Prevention
- Run uninstalls elevated so registry EventLog keys are writable
- Check ACLs on HKLM\...\EventLog keys in locked-down environments
- Avoid monitoring software that holds eventlog registry keys open
When it happens
Trigger: DisableEventlog fails because the HKLM\SYSTEM\CurrentControlSet\Services\...\EventLog registry key is locked or access is denied, or the process is not elevated while performUninstall cleans up the eventlog entry.
Common situations: Registry ACLs restrict the uninstaller's account; eventlog key held by Event Log service or monitoring software; non-admin run.
Related errors
- could not configure eventlog - %w
- eventlog.level must be one of INFO, WARN, or ERROR
- EventLogger is not supported on this platform
- Windows path expansion not supported on this platform
- Windows directory creation not supported on this platform
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/8cbbc286f82c0ebf.
Report an issue: GitHub.