# Constraint "${attr.consul.version} semver \>= 1.8.0"

**URL:** <https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272>\
**Category:** Nomad\
**Created:** [February 29, 2024, 10:34am UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272 "2024-02-29T10:34:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![aliegrsp](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/aliegrsp/32/40611_2.png) [@aliegrsp](https://discuss.hashicorp.com/u/aliegrsp)\
**Post date:** [February 29, 2024, 10:34am UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/1 "2024-02-29T10:34:32Z")

</div>

- Constraint “${attr.consul.version} semver \>= 1.8.0”: 1 nodes excluded by filter.
- (Nomad 1.7.5 & Consul 1.18.0).
- I have this problem and my version of consul is 1.18.0.
- I have followed the tutorial.
- [Consul ACL with Nomad Workload Identities | Nomad | HashiCorp Developer](https://developer.hashicorp.com/nomad/tutorials/integrate-consul/consul-acl)

---

<div class="post-metadata">

**Author:** ![jrasell](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jrasell/32/5500_2.png) [@jrasell](https://discuss.hashicorp.com/u/jrasell)\
**Post date:** [March 11, 2024, 11:08am UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/2 "2024-03-11T11:08:47Z")

</div>

Hi @aliegrsp,

The error indicates Nomad is not correctly fingerprinting Consul or that it cannot find the Consul API. Do you have any logs available from the Nomad agent?

Thanks,  
jrasell and the Nomad team

---

<div class="post-metadata">

**Author:** ![yevhenii.kurtov](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yevhenii.kurtov](https://discuss.hashicorp.com/u/yevhenii.kurtov)\
**Post date:** [June 27, 2024, 9:08pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/3 "2024-06-27T21:08:51Z")

</div>

Hey @jrasell ,

I have the same error, but I’m not using Consul. My setup is very simpl/straightforward I know Nomad server IP address beforehand:

```auto

cat /etc/nomad.d/nomad.hcl
data_dir = "/var/nomad"
bind_addr = "0.0.0.0"

# Enable the client
client {
  enabled = true
  servers = ["192.168.100.254"]
}

# Disable the server
server {
  enabled = false
}

# Match the datacenter and region of the server
datacenter = "dc1"
region = "global"

```

---

<div class="post-metadata">

**Author:** ![andrius.putna](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/andrius.putna/32/43318_2.png) [@andrius.putna](https://discuss.hashicorp.com/u/andrius.putna)\
**Post date:** [October 7, 2024, 6:02pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/4 "2024-10-07T18:02:04Z")

</div>

I have the same error, and I’m not using Consul also.

---

<div class="post-metadata">

**Author:** ![andrius.putna](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/andrius.putna/32/43318_2.png) [@andrius.putna](https://discuss.hashicorp.com/u/andrius.putna)\
**Post date:** [October 7, 2024, 6:15pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/5 "2024-10-07T18:15:43Z")

</div>

For future, if anyone is having this issue, just add provider to service:

```auto
service {
     provider = "nomad"
     ...
}

```

---

<div class="post-metadata">

**Author:** ![will](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/will/32/43612_2.png) [@will](https://discuss.hashicorp.com/u/will)\
**Post date:** [October 28, 2024, 3:13pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/6 "2024-10-28T15:13:12Z")

</div>

I’m having a very similar issue. I’m trying avoid installing/utilizing `consul` at this stage of development and running a pure-`nomad` environment.

Where does this block go? Job definition? Client definition? Server definition?

```auto
service {
     provider = "nomad"
     ...
}

```

---

<div class="post-metadata">

**Author:** ![chickenandpork](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/chickenandpork/32/44820_2.png) [@chickenandpork](https://discuss.hashicorp.com/u/chickenandpork)\
**Post date:** [March 4, 2025, 8:16pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/7 "2025-03-04T20:16:58Z")

</div>

Hey @will this would go into your job definition:

```auto
job "name" {
    group "name" {
        service {
            ...
            provider = "nomad"

```

thing is, if you’re using consul for service-discovery, this service won’t be discoverable that way IIUC.

I think this `service` block can also be in the `task` block if you have it.

---

<div class="post-metadata">

**Author:** ![jmunsch](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jmunsch/32/44977_2.png) [@jmunsch](https://discuss.hashicorp.com/u/jmunsch)\
**Post date:** [March 31, 2025, 5:46pm UTC](https://discuss.hashicorp.com/t/constraint-attr-consul-version-semver-1-8-0/63272/8 "2025-03-31T17:46:17Z")

</div>

I was curious about the service.provider and llm described it as:

In Nomad, the `provider` block within a `service` definition allows you to specify which service discovery provider Nomad should use to register the service with. The `provider` defines the service registration mechanism for the service, and by default, it will use the appropriate service discovery backend based on your Nomad setup.

### The `provider` block:

- **`provider`** specifies which service discovery system to use.

- For Nomad, this can be either **Consul** or **Nomad’s internal service discovery system**.

In this example, `provider = "nomad"` tells Nomad to register the service with Nomad’s own service discovery system. If you wanted to use **Consul** as the service discovery system instead, you would set `provider = "consul"`.

### Default behavior:

- If you do not specify the `provider` block, Nomad will default to **Consul** for service discovery if Consul is integrated into your Nomad setup (which is the most common setup).
- In other words, **if Consul is available** , Nomad will automatically use it as the provider to register the service.

### Key points to remember:

- **`provider = "nomad"`** uses Nomad’s built-in service discovery system.
- **`provider = "consul"`** uses Consul for service discovery and registration.
- The **`provider`** is useful when you want to explicitly control or override which service discovery system Nomad should use for a specific service.

In short, the `provider` block specifies which service registry (Consul or Nomad’s internal registry) should be used to register and manage the service’s lifecycle. If you don’t provide it explicitly, Nomad will default to using Consul if Consul is enabled in the environment.

I did find this as well:

> **[Parameters - service block in the job specification | Nomad | HashiCorp...](https://developer.hashicorp.com/nomad/docs/job-specification/service#provider)**
>
> The \`service\` block instructs Nomad to register the task as a service using
> the Nomad or Consul service discovery integration.
