Open piyeng opened 2 years ago
Hi,
Wondering if someone can confirm if this is an actual issue. Any feedback or suggestion to further troubleshoot or fix this issue would be helpful.
Thanks, Prashanth
Hi @ganglyu i am also facing some issues withe set request as well the error is
I0705 07:16:15.245444 9953 db.go:901] setEntry: DoCVL for UPDATE
I0705 07:16:15.245530 9953 db.go:479] key2redis: Begin: PORT|Ethernet0
I0705 07:16:15.245549 9953 db.go:722] doCVL: calling ValidateEditConfig: [{3 2 PORT|Ethernet0 map[admin_status:up alias:fortyGigE0/0 index:0 lanes:25,26,27,28 mtu:9000 speed:40000]}]
I0705 07:16:15.245609 9953 util.go:313] [CVL] : ValidateEditConfig() called from () : [{3 2 PORT|Ethernet0 map[admin_status:up alias:fortyGigE0/0 index:0 lanes:25,26,27,28 mtu:9000 speed:40000]}]
W0705 07:16:15.245639 9953 util.go:303] [CVL] : Could not find any of key delimeter map[] in key 'PORT|Ethernet0'
W0705 07:16:15.245690 9953 util.go:303] [CVL] : ValidateEditConfig() failed: {TableName: ErrCode:1001 CVLErrDetails:Config Validation Syntax Error Keys:[] Value: Field: Msg:Invalid table or key for PORT|Ethernet0 ConstraintErrMsg: ErrAppTag:}
W0705 07:16:15.245719 9953 db.go:728] doCVL: CVL Failure: 1001
I0705 07:16:15.245737 9953 db.go:732] doCVL: 1 1
I0705 07:16:15.245900 9953 db.go:743] doCVL: End: e: Translib Redis Error: CVL Failure: 1,001: { 1,001 Config Validation Syntax Error [] Invalid table or key for PORT|Ethernet0 }
I0705 07:16:15.245950 9953 db.go:1540] AbortTx: Begin:
I0705 07:16:15.246093 9953 db.go:1552] AbortTx: No SET|DEL done, txState: txStateWatch
I0705 07:16:15.246218 9953 db.go:1588] AbortTx: End: e:
Logs for the server when i startup the server
I0705 07:18:35.068274 9962 util.go:301] [CVL] : Could not read platform schema location or no platform specific schema exists.
can you please give some guidance why might cause this
Hi @piyeng i am also facing issues with the set functionality you can see the above msg
@vishwas-palc Translib is disabled by default, and its readiness status is unknown to me.
Hi @ganglyu thanks for the response by translib you mean READ_WRITE_MODE which is by default false which I changed to true so i can perform set operations can you please clear this doubt Best Regards Vishwas
@ganglyu also can you please suggest whom shuld i connect with on this issue ?
@ganglyu also can you please suggest whom shuld i connect with on this issue ?
Please use git blame to check transl_utils/transl_utils.go
@ganglyu i got this after git blame and it shows nothing regarding translib aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 1) package transl_utils aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 2) aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 3) import ( aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 4) "bytes" aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 5) "encoding/json" aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 6) "strings" aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 7) "fmt" aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 8) log "github.com/golang/glog" aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 9) gnmipb "github.com/openconfig/gnmi/proto/gnmi" fa8d4987 (Sachin Holla 2020-06-14 06:33:38 +0530 10) "github.com/Azure/sonic-mgmt-common/translib" 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 11) "github.com/Azure/sonic-telemetry/common_utils" 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 12) "context" 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 13) "log/syslog" 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 14) "github.com/Azure/sonic-mgmt-common/translib/tlerr" 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 15) 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 16) ) 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 17) 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 18) var ( 4fcd5b6d (Eric Seifert 2021-02-04 11:57:53 -0800 19) Writer *syslog.Writer aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 20) ) aaa9188f (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 21) best regards Vishwas
Please contact them, maybe they know something about translib
Hi @FengPan-Frank I need some guidance on the above issue can please clarify on this ? Best regards Vishwas
@ganglyu i got this after git blame and it shows nothing regarding translib aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 1) package transl_utils aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 2) aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 3) import ( aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 4) "bytes" aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 5) "encoding/json" aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 6) "strings" aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 7) "fmt" aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 8) log "github.com/golang/glog" aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 9) gnmipb "github.com/openconfig/gnmi/proto/gnmi" fa8d498 (Sachin Holla 2020-06-14 06:33:38 +0530 10) "github.com/Azure/sonic-mgmt-common/translib" 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 11) "github.com/Azure/sonic-telemetry/common_utils" 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 12) "context" 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 13) "log/syslog" 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 14) "github.com/Azure/sonic-mgmt-common/translib/tlerr" 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 15) 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 16) ) 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 17) 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 18) var ( 4fcd5b6 (Eric Seifert 2021-02-04 11:57:53 -0800 19) Writer *syslog.Writer aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 20) ) aaa9188 (Prabhu Sreenivasan 2019-12-24 01:52:03 +0530 21) best regards Vishwas
https://github.com/sonic-net/sonic-gnmi/commit/fa8d49878c7c37e93f7aa7c982b67f0aea8ff440 (Sachin Holla 2020-06-14 06:33:38 +0530 10) "github.com/Azure/sonic-mgmt-common/translib"
I guess you might need to check with Sachin on this translib issue, @sachinholla could you pls help on this?
@vishwas-palc, please share branch details and how you are you bringing up the telemetry server. By any chance are you running the telemetry
program directly?
cc: @anand-kumar-subramanian
hi @sachinholla Thanls for the response i followed the instruction given in docs to create the docker and run telemetry in docker by doing make Best Regards Vishwas Sharma
@sachinholla the get and subscribe request are working fine only the set request is causing issues Also these are the commands i used
To run the docker after it is created in this am mounting my docker on the folder of redis which is running outside the docker and src directory which will have both sonic-telemetry and sonic-mgmt directories are stored
sudo docker run -it -v /var/run/redis:/var/run/redis -v ~/src:/src --net=host --name telemetry-dev-env telemetry-dev
once inside the docker I followed the instruction given in the docs as follows
cd /src/sonic-mgmt-common && make cd /src/sonic-telemetry && make all
before these commands i had comment out some functions with a patch as follows
diff --git a/cvl/internal/yparser/yparser.go b/cvl/internal/yparser/yparser.go index 92343bc..6bb34f3 100644 --- a/cvl/internal/yparser/yparser.go +++ b/cvl/internal/yparser/yparser.go @@ -38,7 +38,6 @@ import (
-extern int lyd_check_mandatory_tree(struct lyd_node root, struct ly_ctx ctx, const struct lys_module **modules, int mod_count, int options);
struct lyd_node lyd_parse_data_path(struct ly_ctx ctx, const char path, LYD_FORMAT format, int options) { return lyd_parse_path(ctx, path, format, options); @@ -51,16 +50,6 @@ struct lyd_node lyd_parse_data_mem(struct ly_ctx ctx, const char data, LYD_FO
int lyd_data_validate(struct lyd_node *node, int options, struct ly_ctx ctx) {
return lyd_validate(node, options, ctx);
}
The reason i used this patch due to incompatible with libyang version used in docker creation and was causing the make to fail
after the make was done i ran the telemetry binary in build/bin directory
./build/bin/telemetry --port 8080 -insecure --allow_no_client_auth --logtostderr -v 10
I did the get and subscribe request and where correctly handled but when I sent a set request i found that telemetry was in readonly mode so I enabled the READ_WRITE_ONLY flag and did set again and got this issue as response
I0705 07:16:15.246795 9953 transl_utils.go:238] UPDATE operation failed with error =1, Translib Redis Error: CVL Failure: 1,001: { 1,001 Config Validation Syntax Error [] Invalid table or key for PORT|Ethernet0 }
Hi @sachinholla any update on above I have provided the steps i followed to run the telemetery
Hi @vishwas-palc,
Some of the cvl checks may fail if you disable lyd_check_mandatory_tree()
call. How did you install the libyang in your development docker? Better to install the libyang 1.0.73 debs from the build artifacts. You can refer to the "install dependency" step in the pipeline.
Can you share the set request details you attempted? I think you also need to set the following environment variable before running the telemetry
program:
export CVL_SCHEMA_PATH=/src/sonic-mgmt-common/build/cvl/schema
Also, are you using the master branch??
Hi @sachinholla I did not install libyang saperately i installed the one mentioned in the docker file also i am using the master brach to build also i did set the environment variable in telemetry program the set request i am using is sudo ./gnmi_set -insecure -username admin -password sonicadmin -update /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu:@./mtu.json -target_addr 172.26.1.74:8080 -xpath_target OC-YANG /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu @./mtu.json == setRequest: prefix: < target: "OC-YANG"
update: < path: < elem: < name: "openconfig-interfaces:interfaces"
elem: < name: "interface" key: < key: "name" value: "Ethernet0"
elem: < name: "config"
elem: < name: "mtu"
val: < json_ietf_val: "{\"mtu\": 9108}"
F0621 23:50:46.456628 8881 gnmi_set.go:190] Set failed: rpc error: code = Unknown desc = Translib Redis Error: CVL Failure: 1,001: { 1,001 Config Validation Syntax Error [] Invalid table or key for PORT|Ethernet0 }
What was the CVL_SCHEMA_PATH environment variable value? The "Invalid table or key" error typically indicates that the cvl could not read the schema files. Can you share the full telemetry logs from the startup?
Hi @sachinholla i tried the schema file path you suggested now it is working it is able to handle the set request
sudo ./gnmi_set -insecure -username admin -password sonicadmin -update /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu:@./mtu.json -target_addr 172.26.1.74:8080 -xpath_target OC-YANG /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu @./mtu.json
i have one more doubt regarding this is that when i do get on this ./gnmi_get -xpath_target APPL_DB -xpath PORT_TABLE/Ethernet32/mtu -target_addr 172.27.1.113:8080 -alsologtostderr -insecure true the commands works fine
but if i do a set on the same path by using this command
sudo ./gnmi_set -insecure -username admin -password sonicadmin -xpath_target APPL_DB -update /PORT_TABLE/Ethernet32/mtu:@./mtu.json -target_addr 172.27.1.113:8080
i get this error
F0719 15:18:27.381105 15244 gnmi_set.go:190] Set failed: rpc error: code = Unknown desc = rpc error: code = InvalidArgument desc = no match found in *ocbinds.Device, for path element:"PORT_TABLE" element:"Ethernet32" element:"mtu" elem:{name:"PORT_TABLE"} elem:{name:"Ethernet32"} elem:{name:"mtu"}
can you please guide me why this command is not working for the same path at which get is working Best Regards Vishwas Sharma
/PORT_TABLE/Ethernet32/mtu
is not a openconfig yang or sonic yang path -- hence that error. Did you try the native write feature as described here). I think you do not have to send a path target, instead origin "sonic-db" should be used. Path will look something like /sonic-db:APPL_DB/PORT_TABLE/Ethernet32/mtu
hi @sachinholla i am facing issues with make for sonic telemetry
sonic_data_client/transl_data_client.go:164:37: cannot use stringPaths (type []string) as type []translib.IsSubscribePath in field value sonic_data_client/transl_data_client.go:372:23: v.Payload undefined (type *translib.SubscribeResponse has no field or method Payload) Makefile:60: recipe for target 'sonic-telemetry' failed when i did this step in the docker container cd /src/sonic-telemetry && make all
It looks like you are using latest sonic-mgmt-common but an old version of sonic-gnmi. If you are on any old release branch, you need to checkout corresponding version of sonic-mgmt-common as well. You can find correct version from the submodule file (sonic-buildimage/src/sonic-mgmt-common)
@sachinholla if I use the latest sonic-gnmi branch i am getting this make -C swsscommon make[1]: Entering directory '/src/sonic-gnmi/swsscommon' cp -f /usr/share/swss/swsscommon.i . cp: cannot stat '/usr/share/swss/swsscommon.i': No such file or directory Makefile:17: recipe for target 'all' failed make[1]: [all] Error 1 make[1]: Leaving directory '/src/sonic-gnmi/swsscommon' Makefile:88: recipe for target 'swsscommon_wrap' failed make: [swsscommon_wrap] Error 2
@ganglyu, @zbud-msft -- can you help with this swsscommon error?
@vishwas-palc, if you really want to go ahead with the old code, you can try resetting sonic-mgmt-common to 29be3000d83d8435ce43ef95556fa7e2ecb99ddd or a previous commit. But there may be other failures.
@sachinholla actually I want to use the latest version
hi @ganglyu and @zbud-msft any update on the issue
hi @ganglyu and @zbud-msft any update on the issue
The latest sonic-gnmi branch has dependency on src/sonic-swss-common, please use latest sonic-swss-common.
@ganglyu so before doing the build for sonic-gnmi I should clone the sonic-swss-common build and sonic-mgmt-common ?
@ganglyu I have the sonic-swiss-common in the same directory as the sonic gnmi but facing the same issue when i do build
@ganglyu I have the sonic-swiss-common in the same directory as the sonic gnmi but facing the same issue when i do build
https://github.com/sonic-net/sonic-gnmi/blob/master/azure-pipelines.yml#L135-L137
@ganglyu i am not able to find where can i find these files
please build sonic-swss-common to generate these files
@ganglyu i am facing issues building the swss common locally is there a older version of sonic gnmi that does not require swss common dependencies
hi @sachinholla i am able to build using older verion of mgmt and telemetryi am facing this issue
I1019 06:49:12.728682 79 util.go:301] [CVL] : 'unix_socket_path' is not a valid field in /var/run/redis/sonic-db/database_config.json !
I1019 06:49:12.744312 79 util.go:301] [CVL] : Could not read platform schema location or no platform specific schema exists.
while running the telemetry server binary
@vishwas-palc, I am not aware of these error messages. I need to check the code. What sonic-mgmt-common and sonic-gnmi commit ids are you using? Also share the steps you followed to start the telemetry server. Are you directly trying to run from your development docker? If yes, give me the full command line you used and the environment variables.
/PORT_TABLE/Ethernet32/mtu
is not a openconfig yang or sonic yang path -- hence that error. Did you try the native write feature as described here). I think you do not have to send a path target, instead origin "sonic-db" should be used. Path will look something like/sonic-db:APPL_DB/PORT_TABLE/Ethernet32/mtu
Hi @sachinholla i was trying to work with set request again and tried the path you suggested but got the same issue ./gnmi_set -insecure -username admin -password sonicadmin -update /sonic_db:APPL_DB/PORT_TABLE/Ethernet0/mtu:@./mtu.json -target_addr 127.0.0.1:8080 /sonic_db:APPL_DB/PORT_TABLE/Ethernet0/mtu @./mtu.json == setRequest: prefix: <
update: < path: < elem: < name: "sonic_db:APPL_DB"
elem: < name: "PORT_TABLE"
elem: < name: "Ethernet0"
elem: < name: "mtu"
val: < json_ietf_val: "{\"mtu\":9000}"
F1030 13:43:32.327202 11850 gnmi_set.go:190] Set failed: rpc error: code = Unknown desc = rpc error: code = InvalidArgument desc = no match found in *ocbinds.Device, for path element:"sonic_db:APPL_DB" element:"PORT_TABLE" element:"Ethernet0" element:"mtu" elem:{name:"APPL_DB"} elem:{name:"PORT_TABLE"} elem:{name:"Ethernet0"} elem:{name:"mtu"}
I went through the doc link you provided but there is no example given for set request
hi @sachinholla any update on above
@vishwas-palc, I have not used the native write feature.. Please check with the HLD authors
Hi @sachinholla can you please tag any one of the HLD authors in this conversation I am not able to find there accounts
hi @ganglyu, @zbud-msft, can you help Vishwas with correct sonic_db path syntax to be used in the gnmi_set command?
@vishwas-palc -- did you try "sonic-db" origin (i.e, "/sonic-db:APPL_DB/...")?? Even though the HLD mentions expected origin as "sonic_db", code seems to be expecting "sonic-db" (see here).
It should be sonic-db.
hi @sachinholla and @ganglyu this is the request I gave and its response ./gnmi_set -insecure -username admin -password sonicadmin -update /sonic_db:APPL_DB/PORT_TABLE/Ethernet0/mtu:@./mtu.json -target_addr 127.0.0.1:8080 /sonic_db:APPL_DB/PORT_TABLE/Ethernet0/mtu @./mtu.json == setRequest: prefix: <
update: < path: < elem: < name: "sonic_db:APPL_DB"
elem: < name: "PORT_TABLE"
elem: < name: "Ethernet0"
elem: < name: "mtu"
val: < json_ietf_val: "{"mtu":9000}"
F1030 13:43:32.327202 11850 gnmi_set.go:190] Set failed: rpc error: code = Unknown desc = rpc error: code = InvalidArgument desc = no match found in *ocbinds.Device, for path element:"sonic_db:APPL_DB" element:"PORT_TABLE" element:"Ethernet0" element:"mtu" elem:{name:"APPL_DB"} elem:{name:"PORT_TABLE"} elem:{name:"Ethernet0"} elem:{name:"mtu"}
Hey @vishwas-palc, you are still using origin = "sonic_db". Try "sonic-db" instead.
Hi @sachinholla and @ganglyu its the same error when i tried sonic-db also can you please tell me when I use this path ./gnmi_set -insecure -username admin -password sonicadmin -update /openconfig-interfaces:interfaces/interface[name=Ethernet0]/config/mtu:@./mtu.json -target_addr 172.27.1.113:8080 -xpath_target OC-YANG where is it reflected in redis
hi @ganglyu i am using this request ./gnmi_set -insecure -username admin -password sonicadmin -update /sonic-port:sonic-port/PORT/PORT_LIST[ifname='Ethernet0']/mtu/:@./ipaddress.json -target_addr 127.0.0.1:8080 -xpath_target OC-YANG /sonic-port:sonic-port/PORT/PORT_LIST[ifname=Ethernet0]/mtu/ @./ipaddress.json == setRequest: prefix: < target: "OC-YANG"
update: < path: < elem: < name: "sonic-port:sonic-port"
elem: < name: "PORT"
elem: < name: "PORT_LIST" key: < key: "ifname" value: "Ethernet0"
elem: < name: "mtu"
val: < json_ietf_val: "{\"mtu\":9000}"
== setResponse: prefix: < target: "OC-YANG"
response: < path: < elem: < name: "sonic-port:sonic-port"
elem: < name: "PORT"
elem: < name: "PORT_LIST" key: < key: "ifname" value: "Ethernet0"
elem: < name: "mtu"
op: UPDATE
according to this my request was succefull but in my redis db it is not refelected these are the server logs
I0110 09:53:39.446834 51 common_app.go:547] transformer.XlateToDb() returned result DB map - map[UPDATE:map[4:map[]]]
Default value DB Map - map[]
Aux DB Map - map[]
I0110 09:53:39.447262 51 xlate_utils.go:1035] [xlate.go:532]GetModuleNmFromPath received URI /sonic-port:sonic-port/PORT/PORT_LIST[ifname=Ethernet0]/mtu to extract module name from
I0110 09:53:39.447940 51 xlate_utils.go:1035] [xlate_utils.go:503]uriModuleNameGet module name = sonic-port
I0110 09:53:39.447961 51 common_app.go:582] Result Tables List[]
I0110 09:53:39.447982 51 db.go:1284] StartTx: Begin: w: [] tss: []
W0110 09:53:39.448018 51 db.go:1375] performWatch: Empty WatchKeys. Skipping WATCH
I0110 09:53:39.448035 51 db.go:1308] StartTx: End: e:
target OC-YANG is used for translib, but I'm not familiar with this translib.
@kwangsuk - can you check this mtu update issue? Request did not translate into any db operation.
I0110 09:53:39.446834 51 common_app.go:547] transformer.XlateToDb() returned result DB map - map[UPDATE:map[4:map[]]] ... I0110 09:53:39.448303 51 db.go:1410] CommitTx: No SET|DEL done, txState: txStateWatch
@kwangsuk @sachinholla @ganglyu @vishwas-palc Any update on this issue, even I am seeing similar issue
@Verma-Anukul have you seen the same issue on 202405 release? It would be already resolved by a newer code merged in the last release.
@kwangsuk I have used previous releases, will check on 202405
Hello,
I am trying to understand the gNMI interface implementation in SONiC. I built a private SONiC image based of the 202012 branch with TELEMETRY_WRITABLE=y.
Noticed the following error seen in the logs when the telemetry docker is started. libyang[0]: Failed to find "autoneg" as a sibling to "sonic-port:ifname".
Next, an attempt to issue a gnmi set request to update mtu value failed with the same error - libyang[0]: Failed to find "autoneg" as a sibling to "sonic-port:ifname".
Just as an experiment, I removed "autoneg" attribute for Ethernet11 from the config_sb.json file, reloaded the config, and attempted to issue the gnmi set request again. The set request failed with the error - libyang[0]: Failed to find "fec" as a sibling to "sonic-port:ifname"
Then I removed, "fec" parameter for Ethernet11, reloaded the config, and issue the set request again. This time the set request succeeded.
Any advice on how to further debug or fix this issue would be really helpful.
Thanks, Prashanth