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

  1. Only call `cloudflared service uninstall` on platforms that support service installation (Windows, macOS, Linux with systemd/SysV).
  2. On unsupported platforms, kill the process and remove your own supervisor unit/script instead.
  3. Guard cleanup scripts by checking the OS/init system before invoking the service subcommand.
  4. 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

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


AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06). Data as JSON: /api/errors/7ba4f45104ef1991. Report an issue: GitHub.