tailscale/tailscale · error

Error: --service flag is only compatible with background mod

Error message

Error: --service flag is only compatible with background mode

What it means

Error "Error: --service flag is only compatible with background mode" thrown in tailscale/tailscale.

Source

Thrown at cmd/tailscale/cli/serve_v2.go:418

		forService := e.service != ""
		if !e.bg.IsSet {
			e.bg.Value = forService
		}

		funnel := subcmd == funnel
		if forService && funnel {
			return errors.New("Error: --service flag is not supported with funnel")
		}

		if funnel {
			// verify node has funnel capabilities
			if err := e.verifyFunnelEnabled(ctx, 443); err != nil {
				return err
			}
		}

		if forService && !e.bg.Value {
			return errors.New("Error: --service flag is only compatible with background mode")
		}

		mount, err := cleanURLPath(e.setPath)
		if err != nil {
			return fmt.Errorf("failed to clean the mount point: %w", err)
		}

		srvType, srvPort, err := srvTypeAndPortFromFlags(e)
		if err != nil {
			fmt.Fprintf(e.stderr(), "error: %v\n\n", err)
			return errHelpFunc(subcmd)
		}

		if (srvType == serveTypeHTTP || srvType == serveTypeHTTPS) && e.proxyProtocol != 0 {
			return fmt.Errorf("PROXY protocol is only supported for TCP forwarding, not HTTP/HTTPS")
		}
		// Validate PROXY protocol version
		if e.proxyProtocol != 0 && e.proxyProtocol != 1 && e.proxyProtocol != 2 {

View on GitHub (pinned to cfe32b8be6)

When it happens

Trigger: Thrown at cmd/tailscale/cli/serve_v2.go:418 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tailscale/tailscale@cfe32b8be6 (2026-08-15). Data as JSON: /api/errors/e3f6af9f279aadd2. Report an issue: GitHub.