{"record":{"id":"0bb04fbe0b7c68a3","repo":"hashicorp/nomad","slug":"server-join-and-start-join-cannot-both-be-defined-0bb04f","errorCode":null,"errorMessage":"server_join and start_join cannot both be defined; prefer setting the server_join block","messagePattern":"server_join and start_join cannot both be defined; prefer setting the server_join block","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/agent/retry_join.go","lineNumber":132,"sourceCode":"\t// on the agent mode.\n\tjoinFunc func([]string) (int, error)\n\n\t// logger is the retry joiners logger\n\tlogger log.Logger\n}\n\n// Validate ensures that the configuration passes validity checks for the\n// retry_join block. If the configuration is not valid, returns an error that\n// will be displayed to the operator, otherwise nil.\nfunc (r *retryJoiner) Validate(config *Config) error {\n\t// If retry_join is defined for the server, ensure that deprecated\n\t// fields and the server_join block are not both set\n\tif config.Server != nil && config.Server.ServerJoin != nil && len(config.Server.ServerJoin.RetryJoin) != 0 {\n\t\tif len(config.Server.RetryJoin) != 0 {\n\t\t\treturn fmt.Errorf(\"server_join and retry_join cannot both be defined; prefer setting the server_join block\")\n\t\t}\n\t\tif len(config.Server.StartJoin) != 0 {\n\t\t\treturn fmt.Errorf(\"server_join and start_join cannot both be defined; prefer setting the server_join block\")\n\t\t}\n\t\tif config.Server.RetryMaxAttempts != 0 {\n\t\t\treturn fmt.Errorf(\"server_join and retry_max cannot both be defined; prefer setting the server_join block\")\n\t\t}\n\n\t\tif config.Server.RetryInterval != 0 {\n\t\t\treturn fmt.Errorf(\"server_join and retry_interval cannot both be defined; prefer setting the server_join block\")\n\t\t}\n\n\t\tif len(config.Server.ServerJoin.StartJoin) != 0 {\n\t\t\treturn fmt.Errorf(\"retry_join and start_join cannot both be defined\")\n\t\t}\n\t}\n\n\t// if retry_join is defined for the client, ensure that start_join is not\n\t// set as this configuration is only defined for servers.\n\tif config.Client != nil && config.Client.ServerJoin != nil {\n\t\tif config.Client.ServerJoin.StartJoin != nil {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/retry_join.go#L114-L150","documentation":"Same retryJoiner.Validate consistency check: the server_join block's retry_join is defined alongside the deprecated top-level start_join field. Nomad rejects the ambiguous configuration in favor of the server_join block.","triggerScenarios":"Config where server.server_join.retry_join is non-empty AND server.start_join is non-empty; Validate fails at agent startup.","commonSituations":"Mixing legacy start_join (manual bootstrap join list) with the newer server_join retry_join during version upgrades; templated configs accumulating both keys over time.","solutions":["Remove server.start_join and use server_join { start_join } or server_join { retry_join } instead","Decide whether joining should be automatic (retry_join) or one-shot manual (start_join) and keep only one mechanism","Run nomad config validate to confirm the conflict is resolved"],"exampleFix":"// before\nserver {\n  start_join = [\"1.2.3.4\"]\n  server_join {\n    retry_join = [\"1.2.3.4\"]\n  }\n}\n// after\nserver {\n  server_join {\n    retry_join = [\"1.2.3.4\"]\n  }\n}","handlingStrategy":"validation","validationCode":"if s := cfg.Server; s != nil && s.ServerJoin != nil && len(s.ServerJoin.RetryJoin) > 0 && len(s.StartJoin) > 0 {\n    return errors.New(\"server_join.retry_join and server.start_join are mutually exclusive\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never mix start_join with retry_join in the same stanza","Prefer server_join block syntax exclusively","Run nomad config validate before agent restarts","Remove commented-out legacy join fields to avoid accidental re-enable"],"tags":["nomad","configuration","validation","deprecated-fields"],"backgroundTag":"config-conflict","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"}