{"record":{"id":"7319f863822d8a21","repo":"hashicorp/nomad","slug":"reloading-client-config-failed-w","errorCode":null,"errorMessage":"reloading client config failed: %w","messagePattern":"reloading client config failed: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/command.go","lineNumber":1255,"sourceCode":"\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 {\n\t\t\tc.agent.logger.Error(\"reloading client config failed\", \"error\", err)\n\t\t\treturn fmt.Errorf(\"reloading client config failed: %w\", err)\n\t\t}\n\t}\n\n\t// reload HTTP server after we have reloaded both client and server, in case\n\t// we error in either of the above cases. For example, reloading the http\n\t// server to a TLS connection could succeed, while reloading the server's rpc\n\t// connections could fail.\n\tif shouldReloadHTTP {\n\t\terr := c.reloadHTTPServer()\n\t\tif err != nil {\n\t\t\tc.agent.httpLogger.Error(\"reloading config failed\", \"error\", err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\n// checkNewConfigFiles is used to compare the previous and current config files","sourceCodeStart":1237,"sourceCodeEnd":1273,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/command.go#L1237-L1273","documentation":"Raised in handleReload (command/agent/command.go:1255) when the client-side portion of a SIGHUP reload fails: client.Reload(clientConfig) returns an error after the new client config was converted and finalized. The agent logs the error and wraps it so handleSignals reports 'reloading client config failed'; the agent continues running with its previous client configuration.","triggerScenarios":"Sending SIGHUP after editing client-related config when client.Reload rejects it — e.g. invalid datacenter/region values, bad plugin or fingerprint configuration, unreachable servers in the new servers list, or failures re-registering the client with updated settings.","commonSituations":"Changing client stanza options that require re-registration (datacenter, node class) and hitting validation errors; pointing to servers over TLS with mismatched certs; malformed chroot/plugin paths in the client config; network issues preventing the client from rejoining the new server list.","solutions":["Inspect the 'error' field in the agent log line 'reloading client config failed' for the concrete cause.","Fix the client stanza (validate datacenter, servers list, plugin dirs, TLS files) and re-send SIGHUP.","Verify the agent can reach the servers with the new settings (TLS handshake, gossip) before reloading.","If the changed field is not reloadable, restart the Nomad client agent with the new configuration."],"exampleFix":"// before: client config with unreachable/mistyped servers\nclient { enabled = true; servers = [\"10.0.0:4647\"] } // missing host:port digits\n// after\nclient {\n  enabled    = true\n  servers    = [\"10.0.0.10:4647\", \"10.0.0.11:4647\"]\n  node_class = \"compute\"\n}","handlingStrategy":"try-catch","validationCode":"// before SIGHUP, check client inputs:\nfor _, srv := range servers {\n    if _, _, err := net.SplitHostPort(srv); err != nil {\n        return fmt.Errorf(\"bad server address %q: %w\", srv, err)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := client.Reload(clientConfig); err != nil {\n    logger.Error(\"reloading client config failed\", \"error\", err)\n    // retain previous client config; surface error to operator\n    return fmt.Errorf(\"reloading client config failed: %w\", err)\n}","preventionTips":["Verify server addresses (host:port) and reachability before reloading the client.","Ensure TLS cert/key/CA files exist and match the server's CA before enabling TLS via reload.","Restart instead of reload when changing non-reloadable fields like datacenter or node ID.","Tail agent logs during SIGHUP and fix the logged error before the next reload attempt."],"tags":["nomad","agent","reload","sighup","client-config"],"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"}