{"record":{"id":"364478eddcc0f920","repo":"hashicorp/nomad","slug":"server-join-and-retry-interval-cannot-both-be-defi","errorCode":null,"errorMessage":"server_join and retry_interval cannot both be defined; prefer setting the server_join block","messagePattern":"server_join and retry_interval 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":139,"sourceCode":"// 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 {\n\t\t\treturn fmt.Errorf(\"start_join is not supported for Nomad clients\")\n\t\t}\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/agent/retry_join.go#L121-L157","documentation":"retryJoiner.Validate rejects configurations where the server_join block's retry_join and the top-level retry_interval are both set. retry_interval (delay between join retries) belongs inside the server_join block now.","triggerScenarios":"Config where server.server_join.retry_join is set AND server.retry_interval != 0; Validate fails at agent startup.","commonSituations":"Legacy configs with retry_interval plus newly added server_join block; infrastructure-as-code templates not updated after a Nomad upgrade.","solutions":["Move retry_interval into the server_join block (server_join { retry_interval }) and remove the top-level key","Check for and remove any other deprecated server keys flagged by the same Validate path","Run nomad config validate after edits"],"exampleFix":"// before\nserver {\n  retry_interval = \"15s\"\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    retry_interval = \"15s\"\n  }\n}","handlingStrategy":"validation","validationCode":"if s := cfg.Server; s != nil && s.ServerJoin != nil && len(s.ServerJoin.RetryJoin) > 0 && s.RetryInterval != 0 {\n    return errors.New(\"move retry_interval into server_join\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set retry_interval inside the server_join block only","Run nomad config validate after config changes","Search IaC templates for deprecated top-level retry_interval","Migrate deprecated fields during planned upgrade windows"],"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"}