cloudflare/cloudflared · error
service uninstallation is not supported on this operating sy
Error message
service uninstallation is not supported on this operating system
What it means
The uninstall counterpart of the generic service stub: `cloudflared service uninstall` on an OS without native service support returns this error from uninstallGenericService. There is nothing to uninstall because installation was never possible on this platform.
Source
Thrown at cmd/cloudflared/generic_service.go:39
Usage: "Install cloudflared as a system service (not supported on this operating system)",
Action: cliutil.ConfiguredAction(installGenericService),
},
{
Name: "uninstall",
Usage: "Uninstall the cloudflared service (not supported on this operating system)",
Action: cliutil.ConfiguredAction(uninstallGenericService),
},
},
})
app.Run(os.Args)
}
func installGenericService(c *cli.Context) error {
return fmt.Errorf("service installation is not supported on this operating system")
}
func uninstallGenericService(c *cli.Context) error {
return fmt.Errorf("service uninstallation is not supported on this operating system")
}
View on GitHub (pinned to 2253eeeb25)
Solutions
- Only call `cloudflared service uninstall` on platforms that support service installation (Windows, macOS, Linux with systemd/SysV).
- On unsupported platforms, kill the process and remove your own supervisor unit/script instead.
- Guard cleanup scripts by checking the OS/init system before invoking the service subcommand.
- Ignore/handle this error in scripts as expected output on unsupported platforms (exit code reflects the unsupported operation).
Example fix
// before: unconditional uninstall in cleanup.sh cloudflared service uninstall // after: guard on init system if [ -d /run/systemd/system ]; then cloudflared service uninstall; fi
Defensive patterns
Strategy: validation
Validate before calling
// only uninstall where services can exist if [ -d /run/systemd/system ] || uname -s | grep -Eq 'Linux|Darwin' || uname -s | grep -q CYGWIN; then cloudflared service uninstall fi
Type guard
func canUninstallService() bool { return runtime.GOOS == "windows" || runtime.GOOS == "darwin" || runtime.GOOS == "linux" } Try / catch
if err := uninstallService(); err != nil {
if strings.Contains(err.Error(), "not supported on this operating system") {
log.Info().Msg("no service support on this platform; skipping uninstall")
return nil
}
return err
} Prevention
- Make cleanup scripts platform-aware before calling service uninstall.
- Treat this error as expected no-op output on unsupported platforms.
- Standardize on supported platforms (Windows/macOS/Linux) for service-mode deployments.
When it happens
Trigger: Running `cloudflared service uninstall <name>` on a platform mapped to generic_service.go (BSDs, unsupported init systems, non-Windows/macOS/Linux builds).
Common situations: Cleanup scripts that unconditionally run service uninstall across heterogeneous fleets; CI jobs trying to remove a service that was never registered on the platform.
Understand the failure class
Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.
Related errors
- service installation is not supported on this operating syst
- You must supply at least 2 arguments, first the network you
- You must supply exactly one argument, an IP whose route will
- You must supply at least 1 argument, the name of the virtual
- You must supply exactly one argument, either the ID or name
AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06).
Data as JSON: /api/errors/7ba4f45104ef1991.
Report an issue: GitHub.