# Confdc error: No must statements conditions annotations are not reflecting in schema

**URL:** https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338
**Category:** YANG
**Created:** [February 12, 2023, 4:11pm UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338 "2023-02-12T16:11:42Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![vasubabu](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vasubabu](https://dmap-community.ductus.global/u/vasubabu)
#### Post date: [February 12, 2023, 4:11pm UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338/1 "2023-02-12T16:11:42Z")

</div>

My yang file as follows below.

```
    must "current() = 1 or
              current() = 2 or
              current() = 3 or
              current() = 6 or
              current() = 7 or
              current() = 8" {

            }

```

MY annotate file

must “(current() = ‘1’)” +  
“or (current() = ‘2’)” +  
“or (current() = ‘3’)” +  
“or (current() = ‘4’)” +  
“or (current() = ‘5’)” +  
“or (current() = ‘6’)” +  
“or (current() = ‘7’)” +  
“or (current() = ‘8’)” +  
“or (current() = ‘9’)”{

In my case compilation is successful, but my annotations are not reflecting. Plz help here

---

<div class="post-metadata">

### Author: ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)
#### Post date: [February 12, 2023, 9:04pm UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338/2 "2023-02-12T21:04:39Z")

</div>

It is a bit unclear what you are trying to do - as we don’t know structure of your node that has `must` statement (leaf type etc.).

Can you try to edit some existing example, e.g. “`examples.confd/intro/1-2-3-start-query-model`” (and just paste diff)? With your extra item & must statement so people here can try reproducing and give hints. Plus an example of commands that you try to run & that are against your expected result…

---

<div class="post-metadata">

### Author: ![vasubabu](https://avatars.discourse-cdn.com/v4/letter/v/e0b2c6/32.png) [@vasubabu](https://dmap-community.ductus.global/u/vasubabu)
#### Post date: [February 13, 2023, 2:30am UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338/3 "2023-02-13T02:30:44Z")

</div>

Here are additional details.

**my Yang file.**

```plaintext
typedef port-number {
        tailf:info "1, 2, 3, 7, 8, 9";
        type uint16;
    }
    grouping port-config {
        leaf port {
            description "port number";
            tailf:info "port number";
            type port-number;
            must "current() = 1 or
                  current() = 2 or
                  current() = 3 or
                  current() = 7 or
                  current() = 8 or
                  current() = 9" {
                error-message "Invalid port configuration. Allowed
                               ports are 1, 2, 3, 7, 8, 9";
            } 
        }

```

**MY Annotate file**

```plaintext
tailf:annotate-module "f5-allowed-ips" {
        tailf:annotate-statement "typedef[name='port-number']" {
            tailf:info "1, 2, 3, 4, 5, 6, 7, 8, 9";
        }
        
    }
    tailf:annotate "/oc-sys:system/f5-allowed-ips:allowed-ips/f5-allowed-ips:allowed-ip/f5-allowed-ips:config/f5-allowed-ips:ip-config/f5-allowed-ips:ipv4/f5-allowed-ips:ipv4/f5-allowed-ips:port" {
        must "(current() = '1')" +
             "or (current() = '2')" +
             "or (current() = '3')" +
             "or (current() = '4')" +
             "or (current() = '5')" +
             "or (current() = '6')" +
             "or (current() = '7')" +
             "or (current() = '8')" +
             "or (current() = '9')" "{
              error-message "Invalid port configuration. Allowed
                        ports are 1, 2, 3, 4, 5, 6, 7, 8, 9";
            }
    }
}

```

Here I add additional ports to the list. When I am trying to configure the ports, 4, 5, 6, It showing invalid ports, actually it supposed to be accept it, In case my annotate schema is reflected.

```plaintext
$ default-1(config)# system allowed-ips allowed-ip ts config ipv4 address 1.2.3.4 port 4 prefix-length 24
$ default-1(config-allowed-ip-ts)# commit
Aborted: 'system allowed-ips allowed-ip ts config ipv4 port' (value "4"): Invalid port configuration. Allowed
ports are 1, 2, 3, 7, 8, 9
default-1(config-allowed-ip-ts)#

```

Plz help here

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [February 13, 2023, 8:50am UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338/4 "2023-02-13T08:50:18Z")

</div>

Instead of a “must” statement try using a “range” statement. Example:

```auto
typedef port-number {
  type uint16 {
    range "1..9" {
      error-message "Invalid port configuration. Allowed ports are 1, 2, 3, 4, 5, 6, 7, 8, 9";
    }
  }
}

```

---

<div class="post-metadata">

### Author: ![josephm](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@josephm](https://dmap-community.ductus.global/u/josephm)
#### Post date: [February 13, 2023, 11:59am UTC](https://dmap-community.ductus.global/t/confdc-error-no-must-statements-conditions-annotations-are-not-reflecting-in-schema/4338/5 "2023-02-13T11:59:49Z")

</div>

My guess is that your current solution with `tailf:annotate` works in a way that it added second must statement next to the original one. So even though new must conditions are OK, the “old” one still blocks your attempt to use value 4/5/6.

Best solution would be like @cohult suggests.  
If you keep `must` restriction approach, you may need to update/remove original `must` using `deviate` (instead of `tailf:annotate`) YANG statement, and either remove it, or replace with updated version…
