frr icon indicating copy to clipboard operation
frr copied to clipboard

mgmtd: problem with commits

Open ak503 opened this issue 2 years ago • 0 comments

Description

I have simple config:

ip route 1.2.3.4/32 192.168.1.1

After # mgmt save-config running /tmp/frr.rc I getting file frr.rc:

{
  "frr-routing:routing": {
    "control-plane-protocols": {
      "control-plane-protocol": [
        {
          "type": "frr-staticd:staticd",
          "name": "staticd",
          "vrf": "default",
          "frr-staticd:staticd": {
            "route-list": [
              {
                "prefix": "1.2.3.4/32",
                "afi-safi": "frr-routing:ipv4-unicast",
                "path-list": [
                  {
                    "table-id": 0,
                    "distance": 1,
                    "frr-nexthops": {
                      "nexthop": [
                        {
                          "nh-type": "ip4",
                          "vrf": "default",
                          "gateway": "192.168.1.1",
                          "interface": "(null)"
                        }
                      ]
                    }
                  }
                ]
              }
            ]
          }
        }
      ]
    }
  },
  "frr-vrf:lib": {
    "vrf": [
      {
        "name": "default"
      }
    ]
  }
}

But after loading this conf-file on empty configuration I have problems:

# configure terminal file-lock 
(config)# mgmt load-config /tmp/frr.rc replace
(config)# mgmt commit check
ERROR: COMMIT_CONFIG request failed, Error: YANG error(s):
 Path: Data location "/ietf-yang-schema-mount:schema-mounts".
 Error: Unexpected data state node "schema-mounts" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/state".
 Error: Unexpected data state node "state" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/state/active".
 Error: Unexpected data state node "active" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/frr-zebra:zebra/ribs".
 Error: Unexpected data state node "ribs" found.
 Path: Data location "/frr-zebra:zebra/state".
 Error: Unexpected data state node "state" found.

On frr-9.1 in is not reproduced

Version

FRRouting 10.0 (host) on Linux(5.10.208).
Copyright 1996-2005 Kunihiro Ishiguro, et al.
configured with:
    '--target=x86_64-buildroot-linux-gnu' '--host=x86_64-buildroot-linux-gnu' '--build=x86_64-pc-linux-gnu' '--prefix=/usr' '--exec-prefix=/usr' '--sysconfdir=/etc' '--localstatedir=/var' '--program-prefix=' '--disable-gtk-doc' '--disable-gtk-doc-html' '--disable-docs' '--disable-documentation' '--with-xmlto=no' '--with-fop=no' '--disable-dependency-tracking' '--enable-ipv6' '--enable-nls' '--disable-static' '--enable-shared' '--with-clippy=/br/output/host.d/host/bin/clippy' '--sysconfdir=/rw/config/frr' '--localstatedir=/var/run/frr' '--with-moduledir=/usr/lib/frr/modules' '--enable-configfile-mask=0640' '--enable-logfile-mask=0640' '--enable-multipath=256' '--disable-config-rollbacks' '--disable-ospfclient' '--enable-shell-access' '--enable-user=frr' '--enable-group=frr' '--enable-vty-group=frrvty' '--enable-fpm' '--enable-snmp=agentx' '--disable-doc' '--disable-babeld' '--disable-fabricd' '--disable-eigrpd' '--disable-pbrd' '--disable-vrrpd' '--disable-pimd' '--disable-pathd' '--disable-bgp-bmp' '--disable-nhrpd' '--enable-capabilities' '--disable-zeromq' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-buildroot-linux-gnu' 'target_alias=x86_64-buildroot-linux-gnu' 'AR=/br/output/host.d/host/bin/x86_64-linux-gcc-ar' 'LD=/br/output/host.d/host/bin/x86_64-linux-ld' 'OBJCOPY=/br/output/host.d/host/bin/x86_64-linux-objcopy' 'OBJDUMP=/br/output/host.d/host/bin/x86_64-linux-objdump' 'RANLIB=/br/output/host.d/host/bin/x86_64-linux-gcc-ranlib' 'STRIP=/br/output/host.d/host/bin/x86_64-linux-strip' 'PKG_CONFIG=/br/output/host.d/host/bin/pkg-config' 'CC=/br/output/host.d/host/bin/x86_64-linux-gcc' 'LDFLAGS=' 'LIBS=-latomic' 'CPP=/br/output/host.d/host/bin/x86_64-linux-cpp' 'CXX=/br/output/host.d/host/bin/x86_64-linux-g++'

How to reproduce

  1. create config:
ip route 1.2.3.4/32 192.168.1.1
  1. save to file via mgmtd:
# mgmt save-config running /tmp/frr.rc
  1. run frr with empty config
  2. load config from file /tmp/frr.rc via mgmtd:
# configure terminal file-lock
(config)# mgmt load-config /tmp/frr.rc replace
  1. check commit (or apply):
(config)# mgmt commit check

Expected behavior

no error

Actual behavior

# configure terminal file-lock 
(config)# mgmt load-config /tmp/frr.rc replace
(config)# mgmt commit check
ERROR: COMMIT_CONFIG request failed, Error: YANG error(s):
 Path: Data location "/ietf-yang-schema-mount:schema-mounts".
 Error: Unexpected data state node "schema-mounts" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/state".
 Error: Unexpected data state node "state" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/state/active".
 Error: Unexpected data state node "active" found.
 Path: Data location "/frr-vrf:lib/vrf[name='default']/frr-zebra:zebra/ribs".
 Error: Unexpected data state node "ribs" found.
 Path: Data location "/frr-zebra:zebra/state".
 Error: Unexpected data state node "state" found.

Additional context

on frr 9.1 after this steps i can apply config without problems

Checklist

  • [X] I have searched the open issues for this bug.
  • [X] I have not included sensitive information in this report.

ak503 avatar Apr 22 '24 13:04 ak503