-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gnmi set request error #20
Comments
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, |
Hi @ganglyu i am also facing some issues withe set request as well the error is Logs for the server when i startup the server 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 |
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 |
@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 |
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 |
fa8d498 (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 |
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 |
@sachinholla 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 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 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 -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) { int lyd_data_validate(struct lyd_node **node, int options, struct ly_ctx *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 Can you share the set request details you attempted? I think you also need to set the following environment variable before running the export CVL_SCHEMA_PATH=/src/sonic-mgmt-common/build/cvl/schema Also, are you using the master branch?? |
Hi @sachinholla update: <
val: < 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 i have one more doubt regarding this is that when i do get on this 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 |
|
hi @sachinholla i am facing issues with make for sonic telemetry github.com/Azure/sonic-telemetry/sonic_data_clientsonic_data_client/transl_data_client.go:164:37: cannot use stringPaths (type []string) as type []translib.IsSubscribePath in field value |
It looks like you are using latest sonic-mgmt-common but an old version of sonic-gnmi. |
@sachinholla if I use the latest sonic-gnmi branch i am getting this |
@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 |
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 |
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 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? |
Hi @sachinholla i was trying to work with set request again and tried the path you suggested but got the same issue update: < val: < 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 update: < elem: < elem: < elem: < val: < 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 |
hi @ganglyu i am using this request update: < val: < == setResponse: response: < 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[]]] |
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.
|
@kwangsuk @sachinholla @ganglyu @vishwas-palc |
@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 |
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
The text was updated successfully, but these errors were encountered: