hashicorp / hashicorp/nomad

retry_join (inside server_join) does not support go-sockaddr syntax

Open
#8,169 3 comments 0 reactions 0 assignees View on GitHub
theme/jobspec type/enhancement
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

### Nomad version
Nomad v0.11.3 (8918fc804a0c6758b6e3e9960e4eb2e605e38552)

### Operating system and Environment details
CentOS 8/Ubuntu 18.04/et.al

### Issue
Nomad's `retry_join` directive only supports the `go-discover` syntax, but does not support the `go-sockaddr` syntax.
https://www.nomadproject.io/docs/configuration/server_join/#retry_join

Consul's `retry_join` supports both
https://www.consul.io/docs/agent/options#_retry_join

### Reproduction steps
define a `client` section in the server config and define the client section as:

```hcl
client {
enabled = "true"
node_class = "nomad-server"

server_join {
retry_join = ["{{ GetInterfaceIP \"eth0\" }}"]
}
}

```

Upon restarting the service, this will keep emitting error messages in the logs about how the `retry_join` parameter is invalid

```
* Failed to resolve {{ GetInterfaceIP "eth0" }}: lookup {{ GetInterfaceIP "eth0" }}: no such host
```

### Job file (if appropriate)
n/a

### Nomad Client logs (if appropriate)
n/a

### Nomad Server logs (if appropriate)
```
* Failed to resolve {{ GetInterfaceIP "eth0" }}: lookup {{ GetInterfaceIP "eth0" }}: no such host
```

The use case here is of a typical quick one node server/client with minimal tinkering needed to the config file.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Nomad's server_join retry_join configuration handling and compare its accepted syntax with the documented Consul retry_join behavior. Reproduce the client.server_join configuration using {{ GetInterfaceIP "eth0" }} and trace why it is treated as an invalid hostname. Done means go-sockaddr syntax is accepted without the logged resolution error, with regression coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.