{"record":{"id":"73957142263bb16d","repo":"hashicorp/nomad","slug":"node-setup-failed-v","errorCode":null,"errorMessage":"node setup failed: %v","messagePattern":"node setup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"client/client.go","lineNumber":455,"sourceCode":"\tc.dynamicRegistry =\n\t\tdynamicplugins.NewRegistry(c.stateDB, map[string]dynamicplugins.PluginDispenser{\n\t\t\tdynamicplugins.PluginTypeCSIController: func(info *dynamicplugins.PluginInfo) (any, error) {\n\t\t\t\treturn csi.NewClient(info.ConnectionInfo.SocketPath, logger.Named(\"csi_client\").With(\"plugin.name\", info.Name, \"plugin.type\", \"controller\")), nil\n\t\t\t},\n\t\t\tdynamicplugins.PluginTypeCSINode: func(info *dynamicplugins.PluginInfo) (any, error) {\n\t\t\t\treturn csi.NewClient(info.ConnectionInfo.SocketPath, logger.Named(\"csi_client\").With(\"plugin.name\", info.Name, \"plugin.type\", \"client\")), nil\n\t\t\t},\n\t\t})\n\n\t// Setup the clients RPC server\n\tc.setupClientRpc(rpcs)\n\n\t// Initialize the ACL state\n\tc.clientACLResolver.init()\n\n\t// Setup the node\n\tif err := c.setupNode(); err != nil {\n\t\treturn nil, fmt.Errorf(\"node setup failed: %v\", err)\n\t}\n\n\t// Add workload identity signer after node secret has been generated/loaded\n\tc.widsigner = widmgr.NewSigner(widmgr.SignerConfig{\n\t\tNodeSecret: c.secretNodeID(),\n\t\tRegion:     cfg.Region,\n\t\tRPC:        c,\n\t})\n\n\tc.fingerprintManager = NewFingerprintManager(\n\t\tcfg.PluginSingletonLoader,\n\t\tc.GetConfig,\n\t\tcfg.Node,\n\t\tc.shutdownCh,\n\t\tc.updateNodeFromFingerprint,\n\t\tc.logger,\n\t)\n\tc.pluginManagers = pluginmanager.New(c.logger)","sourceCodeStart":437,"sourceCodeEnd":473,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/client.go#L437-L473","documentation":"NewClient returns this when c.setupNode() fails — the step that loads or generates the node ID/secret, builds the node registration object, and persists initial node state. setupNode errors (e.g. from state store writes or ID resolution) are wrapped here.","triggerScenarios":"Node ID/secret cannot be generated or loaded from the state store; writing the initial node snapshot to the boltdb state DB fails; an explicitly configured node_id is malformed.","commonSituations":"Unwritable or corrupt state_dir so the node secret cannot be persisted; invalid node_id in the client config; running two clients sharing the same data dir causing ID conflicts.","solutions":["Inspect the wrapped inner error for the actual cause (state store write vs ID parse).","Ensure state_dir is writable and not corrupt; move/delete state if corruption is confirmed (allocs reschedule).","If a custom node_id is set, verify its format and uniqueness.","Check for another client process using the same data directory."],"exampleFix":"// before\nclient { node_id = \"not a valid id!\" }\n// after\nclient { node_id = \"9f1e0d2c-3b4a-5f6e-8d7c-1a2b3c4d5e6f\" }","handlingStrategy":"validation","validationCode":"// verify state dir is writable and node_id (if set) looks like a UUID before startup\nif cfg.NodeID != \"\" {\n    if _, err := uuid.Parse(cfg.NodeID); err != nil {\n        return fmt.Errorf(\"invalid node_id %q: %w\", cfg.NodeID, err)\n    }\n}\nif err := checkWritable(cfg.StateDir); err != nil {\n    return fmt.Errorf(\"state dir unwritable, node setup would fail: %w\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run two Nomad clients against the same state_dir","Generate and persist node_id explicitly in config for stable node identity","Ensure state_dir is writable before agent start (systemd ExecStartPre can precheck)","Keep the node secret file backed up — losing it triggers regeneration and node replacement"],"tags":["client","node","state-store"],"backgroundTag":"client-initialization-failed","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}