CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
296 stars 187 forks source link

subscribe notification with xpath-filter is throwing error at netopeer-server #1447

Closed kavk7 closed 11 months ago

kavk7 commented 1 year ago

Hi Team,

On netopeer2-cli, subscribing for notifications with following xpath filter is throwing error at netopeer-server. Though netopeer2-cli outputs "OK" but no notification comes on edit-config. unable to find where "instance-identifier" type is defined and its supported pattern. Please help in how to subscribe for specific xpath edit-config notifications.

sysrepo : 2.2.7 netopeer2 : 2.1.41 libyang : 2.0.263 libnetconf2 : 2.1.25

subscribe --filter-xpath /ietf-netconf-notifications:netconf-config-change/edit[target="/urn:hb-mgmt:1.0:hb"] OK

server side logs: 2023-07-27T11:52:20.186501793Z netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Published event "rpc" "/notifications:create-subscription" with ID 1 priority 0 for 1 subscribers. 2023-07-27T11:52:20.186521542Z netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Processing "/notifications:create-subscription" "rpc" event with ID 1 priority 0 (remaining 1 subscribers). 2023-07-27T11:52:20.186526198Z netopeer2-server|ERROR "netopeer2-server-log" [ERR]: LY: Invalid character ':'[13] of expression '/urn:hb-mgmt:1.0:hb'. (Schema location "/ietf-netconf-notifications:netconf-config-change/edit/target".) 2023-07-27T11:52:20.186530416Z netopeer2-server|WARNING "netopeer2-server-log" [WRN]: LY: Invalid value "/urn:hb-mgmt:1.0:hb" which does not fit the type (Invalid instance-identifier "/urn:hb-mgmt:1.0:hb" value - syntax error.). 2023-07-27T11:52:20.186534670Z netopeer2-server|WARNING "netopeer2-server-log" [WRN]: LY: Previous warning generated by XPath subexpression[55] "target="/urn:hb-mgmt:1.0:hb"" with context node "/".

Tried below as well but same error.

subscribe --filter-xpath /ietf-netconf-notifications:netconf-config-change/edit[target="hb-mgmt:hb"]

Server side log: 2023-07-27T12:06:12.444928449Z netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Published event "rpc" "/notifications:create-subscription" with ID 4 priority 0 for 1 subscribers. 2023-07-27T12:06:12.444943313Z netopeer2-server|INFO "netopeer2-server-log" [INF]: SR: Processing "/notifications:create-subscription" "rpc" event with ID 4 priority 0 (remaining 1 subscribers). 2023-07-27T12:06:12.444947634Z netopeer2-server|ERROR "netopeer2-server-log" [ERR]: LY: Unexpected XPath token "NameTest" ("hb-mgmt:hb"), expected "Operator(Path)". (Schema location "/ietf-netconf-notifications:netconf-config-change/edit/target".) 2023-07-27T12:06:12.444957681Z netopeer2-server|WARNING "netopeer2-server-log" [WRN]: LY: Invalid value "hb-mgmt:hb" which does not fit the type (Invalid instance-identifier "hb-mgmt:hb" value - syntax error.).2023-07-27T12:06:12.444962887Z netopeer2-server|WARNING "netopeer2-server-log" [WRN]: LY: Previous warning generated by XPath subexpression[55] "target="hb-mgmt:hb"" with context node "/".

sample edit-xml `

15

`

Attached yang for reference: hb-mgmt.zip

michalvasko commented 11 months ago

Use the module name instead of the namespace or prefix.

kavk7 commented 11 months ago

Thank you. it worked. you can close the ticket.