project-arlo / sonic-mgmt-framework

SONiC Management Framework
Other
5 stars 16 forks source link

OPENCONFIG-gNMI - gnmi_get of IPV4/IPV6 address on interface fails #115

Open sachin-brm opened 5 years ago

sachin-brm commented 5 years ago

Problem Description/Summary :

OPENCONFIG-gNMI - gnmi_get of IPV4/IPV6 address on interface fails

Expected Behavior :

gnmi_get operation for IPV4/IPV6 address on interface should be successful

Topology :

DUT

Steps to Repro :

  1. Configure IPV4/IPV6 address on an interface manually.
  2. Go to telemetry docker docker exec -it telemetry bash
  3. Perform gNMI get operation on interface as below and observe ipv4 and ipv6 addresses configured.
root@sonic:/# gnmi_get -xpath /openconfig-interfaces:interfaces/interface[name=Etthernet0] -target_addr 127.0.0.1:8080 -insecure
== getRequest:
prefix: <
>
path: <
elem: <
name: "openconfig-interfaces:interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "Ethernet0"
>
>
>
encoding: JSON_IETF

== getResponse:
notification: <
timestamp: 1483964991182862301
prefix: <
>
update: <
path: <
elem: <
name: "openconfig-interfaces:interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "Ethernet0"
>
>
>
val: <
json_ietf_val: "{\"openconfig-interfaces:interface\":[{\"config\":{\"description\":\"\",\"mtu\":9100,\"name\":\"Ethernet0\"},\"name\":\"Ethernet0\",\"openconfig-if-ethernet:ethernet\":{\"config\":{\"port-speed\":\"openconfig-if-ethernet:SPEED_25GB\"},\"state\":{\"port-speed\":\"openconfig-if-ethernet:SPEED_25GB\"}},\"state\":{\"admin-status\":\"UP\",\"counters\":{\"in-broadcast-pkts\":\"0\",\"in-discards\":\"1610\",\"in-errors\":\"0\",\"in-multicast-pkts\":\"1759\",\"in-octets\":\"418225\",\"in-pkts\":\"1763\",\"in-unicast-pkts\":\"4\",\"out-broadcast-pkts\":\"6\",\"out-discards\":\"0\",\"out-errors\":\"0\",\"out-multicast-pkts\":\"1765\",\"out-octets\":\"422165\",\"out-pkts\":\"1815\",\"out-unicast-pkts\":\"44\"},\"description\":\"\",\"ifindex\":0,\"mtu\":9100,\"name\":\"Ethernet0\",\"oper-status\":\"UP\"},\"subinterfaces\":{\"subinterface\":[{\"index\":0,\"openconfig-if-ip:ipv4\":{\"addresses\":{\"address\":[\{\"config\":\{\"ip\":\"172.168.1.1\",\"prefix-length\":24},\"ip\":\"172.168.1.1\",\"state\":\{\"ip\":\"172.168.1.1\",\"prefix-length\":24}}]}},\"openconfig-if-ip:ipv6\":{\"addresses\":{\"address\":[\{\"config\":\{\"ip\":\"1001::1\",\"prefix-length\":64},\"ip\":\"1001::1\",\"state\":\{\"ip\":\"1001::1\",\"prefix-length\":64}}]}}}]}}]}"
>
>
>
  1. through gNMI get operation get ipv4/ipv6 address on a interface on which ipv4/ipv6 address configured.
root@sonic:/# gnmi_get -xpath /openconfig-interfaces:interfaces/interface[name=Etthernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip:ipv4/addresses/adddress -target_addr 127.0.0.1:8080 -insecure
== getRequest:
prefix: <
>
path: <
elem: <
name: "openconfig-interfaces:interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "Ethernet0"
>
>
elem: <
name: "subinterfaces"
>
elem: <
name: "subinterface"
key: <
key: "index"
value: "0"
>
>
elem: <
name: "openconfig-if-ip:ipv4"
>
elem: <
name: "addresses"
>
elem: <
name: "address"
>
>
encoding: JSON_IETF

F0109 12:19:40.785655 353 gnmi_get.go:137] Get failed: rpc error: code = NotFound desc = GET failed for this message

5.Same issue is observed with IPV6 address

root@sonic:/# gnmi_get -xpath /openconfig-interfaces:interfaces/interface[name=Etthernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip:ipv6/addresses/adddress -target_addr 127.0.0.1:8080 -insecure
== getRequest:
prefix: <
>
path: <
elem: <
name: "openconfig-interfaces:interfaces"
>
elem: <
name: "interface"
key: <
key: "name"
value: "Ethernet0"
>
>
elem: <
name: "subinterfaces"
>
elem: <
name: "subinterface"
key: <
key: "index"
value: "0"
>
>
elem: <
name: "openconfig-if-ip:ipv6"
>
elem: <
name: "addresses"
>
elem: <
name: "address"
>
>
encoding: JSON_IETF

F0109 12:29:13.057339 361 gnmi_get.go:137] Get failed: rpc error: code = NotFound desc = GET failed for this message

Reproducibility ( Ex:- 3 out of 3 attempts ) Please also update "Reproducible" field :

3

jeff-yin commented 5 years ago

Duplicate of issue #86. Without a fix for #86, this will also not work.

PrabhuSreenivasan commented 5 years ago

Observing the issue even with #86 fixed. Please find the logs below

bserving the issue in build "sonic_2.0_daily_190912_1808_328" too.re-opening this issue.

=======================================================

root@sonic:/#gnmi_get -xpath /openconfig-interfaces:interfaces/interface[name=Ethernet28] -target_addr 127.0.0.1:8080 -insecure == getRequest: prefix: <

path: < elem: < name: "openconfig-interfaces:interfaces"

elem: < name: "interface" key: < key: "name" value: "Ethernet28"

encoding: JSON_IETF

== getResponse: notification: < timestamp: 1568367877877052220 prefix: <

update: < path: < elem: < name: "openconfig-interfaces:interfaces"

elem: < name: "interface" key: < key: "name" value: "Ethernet28"

val: < json_ietf_val: "{\"openconfig-interfaces:interface\":[{\"config\":{\"description\":\"\",\"mtu\":9100,\"name\":\"Ethernet28\"},\"name\":\"Ethernet28\",\"openconfig-if-ethernet:ethernet\":{\"config\":{\"port-speed\":\"openconfig-if-ethernet:SPEED_100GB\"},\"state\":{\"port-speed\":\"openconfig-if-ethernet:SPEED_100GB\"}},\"state\":{\"admin-status\":\"UP\",\"counters\":{\"in-broadcast-pkts\":\"0\",\"in-discards\":\"290\",\"in-errors\":\"0\",\"in-multicast-pkts\":\"341\",\"in-octets\":\"74362\",\"in-pkts\":\"347\",\"in-unicast-pkts\":\"6\",\"out-broadcast-pkts\":\"0\",\"out-discards\":\"0\",\"out-errors\":\"0\",\"out-multicast-pkts\":\"358\",\"out-octets\":\"79512\",\"out-pkts\":\"364\",\"out-unicast-pkts\":\"6\"},\"description\":\"\",\"ifindex\":7,\"mtu\":9100,\"name\":\"Ethernet28\",\"oper-status\":\"UP\"},\"subinterfaces\":{\"subinterface\":[{\"index\":0,\"openconfig-if-ip:ipv4\":{\"addresses\":{\"address\":[{\"config\":{\"ip\":\"192.168.1.1\",\"prefix-length\":24},\"ip\":\"192.168.1.1\",\"state\":{\"ip\":\"192.168.1.1\",\"prefix-length\":24}}]}}}]}}]}"

root@sonic:/# root@sonic:/#gnmi_get -xpath /openconfig-interfaces:interfaces/interface[name=Etthernet28]/subinterfaces/subinterface[index=0]/openconfig-if-ip:ipv4/addresses/adddress -target_addr 127.0.0.1:8080 -insecure == getRequest: prefix: <

path: < elem: < name: "openconfig-interfaces:interfaces"

elem: < name: "interface" key: < key: "name" value: "Etthernet28"

elem: < name: "subinterfaces"

elem: < name: "subinterface" key: < key: "index" value: "0"

elem: < name: "openconfig-if-ip:ipv4"

elem: < name: "addresses"

elem: < name: "adddress"

encoding: JSON_IETF

F0913 09:45:20.588199 246 gnmi_get.go:137] Get failed: rpc error: code = NotFound desc = GET failed for this message root@sonic:/# exit exit

root@sonic:/home/admin# show platform summary Platform: x86_64-accton_as7712_32x-r0 HwSKU: Accton-AS7712-32X ASIC: broadcom

=============================================================

dutta-partha commented 5 years ago

There are two operations done in this defect. One is configuring IPV4/IPv6 address and then getting the IP address through gNMI. Configuration is related to #86, not exact duplicate of it.

CVL fix for configuration is available in master branch (PR #118). Please test configuration and update the result. If gnmi_get is not working as expected, we need to fix them separately (which is not related to CVL).

asha-behera commented 5 years ago

There is issue seen with gnmi_set for interfaces:

gnmi_set -update /openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip:ipv4/addresses/address[ip=1.2.3.4]/config -target_addr 127.0.0.1:8080 -insecure == setRequest: update: < path: < elem: < name: "openconfig-interfaces:interfaces"

elem: < name: "interface" key: < key: "name" value: "Ethernet0"

elem: < name: "subinterfaces"

elem: < name: "subinterface" key: < key: "index" value: "0"

elem: < name: "openconfig-if-ip"

val: < string_val: "ipv4/addresses/address[ip=1.2.3.4]/config"

F0103 21:41:06.583427 313 gnmi_set.go:164] Set failed: rpc error: code = Unknown desc = UPDATE failed for this message

asha-behera commented 5 years ago

Logs for the same oot@sonic:/home/admin# tail -f /var/log/telemetry.log Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266335 38 translib.go:726] Error in request binding: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266378 38 translib.go:182] Update request received with path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266393 38 translib.go:183] Update request received with payload = Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266409 38 app_interface.go:116] getAppModule called for path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266426 38 app_interface.go:123] found the entry in the map for path =/openconfig-interfaces:interfaces Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266442 38 app_interface.go:154] cast to appInterface worked&{ [] [] map[] map[] {0 {map[]}} map[] } Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry E0103 21:40:58.266793 38 request_binder.go:221] Error in creating the target object: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry E0103 21:40:58.266819 38 request_binder.go:128] Error in creating the target object : rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266844 38 translib.go:726] Error in request binding: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:40:58.268150 sonic INFO telemetry#supervisord: telemetry I0103 21:40:58.266881 38 transl_utils.go:159] UPDATE operation failed with error =1 Jan 3 21:41:06.581275 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580146 38 server.go:253] Update path: path:<elem:<name:"openconfig-interfaces:interfaces" > elem:<name:"interface" key:<key:"name" value:"Ethernet0" > > elem:<name:"subinterfaces" > elem:<name:"subinterface" key:<key:"index" value:"0" > > elem:<name:"openconfig-if-ip" > > val:<string_val:"ipv4/addresses/address[ip=1.2.3.4]/config" > Jan 3 21:41:06.581275 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580310 38 transl_utils.go:148] Incoming JSON body is%!(EXTRA string=) Jan 3 21:41:06.581275 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580332 38 translib.go:114] Create request received with path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:41:06.581275 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580349 38 translib.go:115] Create request received with payload = Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580364 38 app_interface.go:116] getAppModule called for path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580382 38 app_interface.go:123] found the entry in the map for path =/openconfig-interfaces:interfaces Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.580399 38 app_interface.go:154] cast to appInterface worked&{ [] [] map[] map[] {0 {map[]}} map[] } Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry E0103 21:41:06.581288 38 request_binder.go:221] Error in creating the target object: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry E0103 21:41:06.581327 38 request_binder.go:128] Error in creating the target object : rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581362 38 translib.go:726] Error in request binding: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581404 38 translib.go:182] Update request received with path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581419 38 translib.go:183] Update request received with payload = Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581435 38 app_interface.go:116] getAppModule called for path =/openconfig-interfaces:interfaces/interface[name=Ethernet0]/subinterfaces/subinterface[index=0]/openconfig-if-ip Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581452 38 app_interface.go:123] found the entry in the map for path =/openconfig-interfaces:interfaces Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581469 38 app_interface.go:154] cast to appInterface worked&{ [] [] map[] map[] {0 {map[]}} map[] } Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry E0103 21:41:06.581878 38 request_binder.go:221] Error in creating the target object: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry E0103 21:41:06.581909 38 request_binder.go:128] Error in creating the target object : rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581933 38 translib.go:726] Error in request binding: rpc error: code = InvalidArgument desc = no match found in ocbinds.OpenconfigInterfaces_Interfaces_Interface_Subinterfaces_Subinterface, for path elem:<name:"openconfig-if-ip" > Jan 3 21:41:06.582653 sonic INFO telemetry#supervisord: telemetry I0103 21:41:06.581970 38 transl_utils.go:159] UPDATE operation failed with error =1

justinejose91 commented 5 years ago

GNMI get for address container or sub interfaces is not supported for this release. Please do a get on Interface list with Interface name as key.

justinejose91 commented 5 years ago

As @asha-behera mentioned, set will work fine. But GET is not supported for subInterfaces level or address level. Still, need to use interfaces/interface[name] for the info.

jeff-yin commented 5 years ago

@sachin-brm @PrabhuSreenivasan @dutta-partha @asha-behera -- I will leave it up to you to evaluate Justin's response and close the issue if you agree. From the repro logs, it looks like you're doing a GET/SET on the sub-interface, whereas the operation should be performed on the interface itself.

asha-behera commented 5 years ago

@justinejose91 , SET for the above case is not working for me, is it working for you? Could you please dump the result?

justinejose91 commented 5 years ago

@asha-behera , I have tried it with the latest build. Its working fine for me. Please have a look at the screenshots attached, which mentions the build as well.

gnmi_get_cli_3 gnmi_get_2 gnmi_set_1