{"record":{"id":"f92cdcb4afafe3b0","repo":"k3s-io/k3s","slug":"invalid-flag-use-server-is-required-with-disa","errorCode":null,"errorMessage":"invalid flag use; --server is required with --disable-etcd","messagePattern":"invalid flag use; --server is required with --disable-etcd","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cli/server/server.go","lineNumber":258,"sourceCode":"\t\t}\n\t} else {\n\t\tlogrus.Info(\"ETCD snapshots are disabled\")\n\t}\n\n\tif cfg.ClusterResetRestorePath != \"\" && !cfg.ClusterReset {\n\t\treturn errors.New(\"invalid flag use; --cluster-reset required with --cluster-reset-restore-path\")\n\t}\n\n\tserverConfig.ControlConfig.ClusterReset = cfg.ClusterReset\n\tserverConfig.ControlConfig.ClusterResetRestorePath = cfg.ClusterResetRestorePath\n\tserverConfig.ControlConfig.SystemDefaultRegistry = cfg.SystemDefaultRegistry\n\n\tif serverConfig.ControlConfig.SupervisorPort == 0 {\n\t\tserverConfig.ControlConfig.SupervisorPort = serverConfig.ControlConfig.HTTPSPort\n\t}\n\n\tif serverConfig.ControlConfig.DisableETCD && serverConfig.ControlConfig.JoinURL == \"\" {\n\t\treturn errors.New(\"invalid flag use; --server is required with --disable-etcd\")\n\t}\n\n\tif serverConfig.ControlConfig.Datastore.Endpoint != \"\" && serverConfig.ControlConfig.DisableAPIServer {\n\t\treturn errors.New(\"invalid flag use; cannot use --disable-apiserver with --datastore-endpoint\")\n\t}\n\n\tif serverConfig.ControlConfig.Datastore.Endpoint != \"\" && serverConfig.ControlConfig.DisableETCD {\n\t\treturn errors.New(\"invalid flag use; cannot use --disable-etcd with --datastore-endpoint\")\n\t}\n\n\tif serverConfig.ControlConfig.DisableAPIServer {\n\t\t// Servers without a local apiserver need to connect to the apiserver via the proxy load-balancer.\n\t\tserverConfig.ControlConfig.APIServerPort = cmds.AgentConfig.LBServerPort\n\t\t// If the supervisor and externally-facing apiserver are not on the same port, the proxy will\n\t\t// have a separate load-balancer for the apiserver that we need to use instead.\n\t\tif serverConfig.ControlConfig.SupervisorPort != serverConfig.ControlConfig.HTTPSPort {\n\t\t\tserverConfig.ControlConfig.APIServerPort = cmds.AgentConfig.LBServerPort - 1\n\t\t}","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/k3s-io/k3s/blob/6ba341e396edc16b8dcae978a7c5e3ac7ee5606e/pkg/cli/server/server.go#L240-L276","documentation":"--disable-etcd runs a server as a control-plane member without a local datastore, so it must obtain all cluster state from an existing server via --server (JoinURL). With no JoinURL the node would have neither local etcd nor a peer to sync from, which k3s refuses at startup.","triggerScenarios":"`k3s server --disable-etcd` with no --server flag and no `server:` entry in /etc/rancher/k3s/config.yaml (the server-role config, not the agent one).","commonSituations":"Adding control-plane nodes to an embedded-etcd HA cluster and forgetting --server on the new node; server URL present only in the agent config section so it is not picked up; env var K3S_URL unset in the unit file.","solutions":["Add `--server https://<existing-server>:6443` (or `server:` in config.yaml) so the node joins an existing cluster","If this node should hold datastore itself, remove --disable-etcd and let it run embedded etcd","Verify the flag reached the process: `systemctl cat k3s` and `tr \\0 ' ' /proc/$(pidof k3s)/cmdline`"],"exampleFix":"# before\nk3s server --disable-etcd\n\n# after\nk3s server --disable-etcd --server https://10.0.0.10:6443 --token <cluster-token>","handlingStrategy":"validation","validationCode":"# preflight for disable-etcd nodes\nif grep -qE '^(--)?disable-etcd|disable-etcd: true' /etc/rancher/k3s/config.yaml 2>/dev/null || printf '%s' \"$@\" | grep -q -- '--disable-etcd'; then\n  grep -qE '^server: ' /etc/rancher/k3s/config.yaml || [ -n \"$K3S_URL\" ] || { echo '--server is required with --disable-etcd'; exit 1; }\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Templated node provisioning should assert: disable-etcd implies server URL","Document per-role flag matrices for embedded-etcd HA clusters","Smoke-test new control-plane node configs with `k3s server --help`-driven lint before first boot"],"tags":["etcd","cluster","ha","configuration"],"backgroundTag":null,"analyzedSha":"6ba341e396edc16b8dcae978a7c5e3ac7ee5606e","analyzedAt":"2026-08-15T16:27:54.286Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}