{"record":{"id":"f9a11190f527bc6b","repo":"netbirdio/netbird","slug":"json-socket-requires-enable-json-socket-to-con","errorCode":null,"errorMessage":"--json-socket requires --enable-json-socket to configure the daemon JSON gateway","messagePattern":"--json-socket requires --enable-json-socket to configure the daemon JSON gateway","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/cmd/service_controller.go","lineNumber":27,"sourceCode":"\t\"time\"\n\n\t\"github.com/kardianos/service\"\n\tlog \"github.com/sirupsen/logrus\"\n\n\t\"github.com/spf13/cobra\"\n\t\"google.golang.org/grpc\"\n\n\t\"github.com/netbirdio/netbird/client/internal/daemonaddr\"\n\t\"github.com/netbirdio/netbird/client/internal/ipcauth\"\n\t\"github.com/netbirdio/netbird/client/proto\"\n\t\"github.com/netbirdio/netbird/client/server\"\n\t\"github.com/netbirdio/netbird/client/system\"\n\t\"github.com/netbirdio/netbird/util\"\n)\n\nfunc validateJSONSocketFlags() error {\n\tif serviceCmd.PersistentFlags().Changed(\"json-socket\") && !enableJSONSocket {\n\t\treturn fmt.Errorf(\"--json-socket requires --enable-json-socket to configure the daemon JSON gateway\")\n\t}\n\treturn nil\n}\n\n// daemonServerOptions installs the transport credentials that expose each\n// caller's kernel-authenticated identity to the handlers, which is what lets\n// the daemon require root/administrator for privileged operations.\n//\n// The handshake exchanges no bytes, so older CLI and UI binaries still\n// interoperate. Callers on a TCP socket carry no identity at all: the daemon\n// keeps serving them, and the privileged operations deny them, so a warning is\n// logged to make the loss of functionality visible.\nfunc daemonServerOptions(network string) []grpc.ServerOption {\n\tif network == \"tcp\" {\n\t\tlog.Warnf(\"daemon is listening on TCP (%s): callers carry no verifiable identity over TCP, \"+\n\t\t\t\"so privileged operations (SSH root login, SSH auth, enabling the SSH server, management URL changes, \"+\n\t\t\t\"deregistration) will be denied. Use a unix socket, or npipe:// on Windows\", daemonAddr)\n\t\treturn nil","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/netbirdio/netbird/blob/93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c/client/cmd/service_controller.go#L9-L45","documentation":"Error \"--json-socket requires --enable-json-socket to configure the daemon JSON gateway\" thrown in netbirdio/netbird.","triggerScenarios":"Thrown at client/cmd/service_controller.go:27 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93e97f4bf1ad715072dcb3fb6cdb1763431b5a9c","analyzedAt":"2026-08-16T03:09:19.136Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}