{"record":{"id":"51563bbef751e834","repo":"hashicorp/nomad","slug":"reloading-server-config-failed-w","errorCode":null,"errorMessage":"reloading server config failed: %w","messagePattern":"reloading server config failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/command.go","lineNumber":1235,"sourceCode":"\t\t\treturn nil\n\t\t}\n\t}\n\n\tif s := c.agent.Server(); s != nil {\n\t\tc.agent.logger.Debug(\"starting reload of server config\")\n\t\tsconf, err := convertServerConfig(newConf)\n\t\tif err != nil {\n\t\t\tc.agent.logger.Error(\"failed to convert server config\", \"error\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\t// Finalize the config to get the agent objects injected in\n\t\tc.agent.finalizeServerConfig(sconf)\n\n\t\t// Reload the config\n\t\tif err := s.Reload(sconf); err != nil {\n\t\t\tc.agent.logger.Error(\"reloading server config failed\", \"error\", err)\n\t\t\treturn fmt.Errorf(\"reloading server config failed: %w\", err)\n\t\t}\n\t}\n\n\tif client := c.agent.Client(); client != nil {\n\t\tc.agent.logger.Debug(\"starting reload of client config\")\n\t\tclientConfig, err := convertClientConfig(newConf)\n\t\tif err != nil {\n\t\t\tc.agent.logger.Error(\"failed to convert client config\", \"error\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\t// Finalize the config to get the agent objects injected in\n\t\tif err := c.agent.finalizeClientConfig(clientConfig); err != nil {\n\t\t\tc.agent.logger.Error(\"failed to finalize client config\", \"error\", err)\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := client.Reload(clientConfig); err != nil {","sourceCodeStart":1217,"sourceCodeEnd":1253,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/command.go#L1217-L1253","documentation":"Raised in handleReload (command/agent/command.go:1235) when, during a SIGHUP-triggered reload, the rebuilt server configuration fails to apply via server.Reload(sconf). The agent logs the error and returns a wrapped error so handleSignals can report that reloading the server config failed; the agent keeps running with the old server configuration.","triggerScenarios":"Sending SIGHUP to the Nomad agent after editing server-related config when server.Reload rejects the new config — e.g. invalid TLS certificate/key paths or unparseable certs, changing fields that are not reloadable, or an RPC mux/raft reload failure with the new settings.","commonSituations":"Rotating TLS certificates with a wrong path or mismatched key; pointing servers at a new gossip/serf key that is invalid; attempting to change immutable server settings via reload instead of a restart; typo'd server stanza values that only fail at reload time.","solutions":["Read the 'error' detail in the agent log line 'reloading server config failed' to identify the exact failing setting.","Validate the new config (cert/key files exist, paths correct, values allowed for reload) and re-send SIGHUP after fixing.","If the changed setting is not reloadable (e.g. certain raft/serf fields), restart the agent with the new config instead of relying on SIGHUP.","Roll back to the previous known-good config file and reload to restore operation, then apply changes incrementally."],"exampleFix":"// before: reloading with an invalid cert path\nserver { enabled = true; tls_http = 1 } // typo'd value fails on reload\n// after: valid, reloadable settings\ntls {\n  http = true\n  rpc  = true\n  ca_file   = \"/etc/nomad.d/tls/ca.pem\"\n  cert_file = \"/etc/nomad.d/tls/server.pem\"\n  key_file  = \"/etc/nomad.d/tls/server-key.pem\"\n}","handlingStrategy":"try-catch","validationCode":"// before SIGHUP, validate server config inputs:\nfor _, f := range []string{caFile, certFile, keyFile} {\n    if _, err := os.Stat(f); err != nil {\n        return fmt.Errorf(\"missing TLS file %s: %w\", f, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"// agent-side pattern mirrored in callers/handlers:\nif err := server.Reload(sconf); err != nil {\n    logger.Error(\"reloading server config failed\", \"error\", err)\n    // keep old config active; alert and require operator fix before next SIGHUP\n    return fmt.Errorf(\"reloading server config failed: %w\", err)\n}","preventionTips":["Dry-run validate configs (cert paths, key material) before SIGHUP.","Only change reloadable server settings via reload; restart for immutable ones.","Apply config changes incrementally to isolate the failing field.","Keep a known-good config file for immediate rollback."],"tags":["nomad","agent","reload","sighup","server-config","tls"],"backgroundTag":"config-reload-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"}