ConfD User Community

Subscriber can`t receive the notification

Hi,

While I want to send a notification with its content contains white space via “confd_notification_send()” api, It seems this sending failed and subscriber receives nothing after this behavior.
The notification contents are as follows:
<target …>…[.=‘aa bb’]
If I remove this texts,the api works.

Thanks very much if you can give me help!

Best Regards,
Wanmiao

Hi,

You notification content doesn’t even show up in the correct form in this forum, so begin with reading this post:

Seems to work with the examples.confd/netconf_notifications example
Terminal window 1

$ pwd
/Users/tailf/confd-7.4.1/examples.confd/netconf_notifications
$ diff -u notifier_builtin_replay_store.c.bak notifier_builtin_replay_store.c
--- notifier_builtin_replay_store.c.bak	2021-03-02 10:16:05.000000000 +0100
+++ notifier_builtin_replay_store.c	2021-03-02 10:10:27.000000000 +0100
@@ -83,11 +83,12 @@
 
 static void send_notifup_1(int index, int flags1, int flags2)
 {
-    confd_tag_value_t vals[9];
+    confd_tag_value_t vals[10];
     int i = 0;
 
     CONFD_SET_TAG_XMLBEGIN(&vals[i], notif_link_up,       notif__ns);  i++;
     CONFD_SET_TAG_UINT32(&vals[i],   notif_if_index,      index);      i++;
+    CONFD_SET_TAG_STR(&vals[i],   notif_extra_id,      "[.='aa bb']");      i++;
     CONFD_SET_TAG_XMLBEGIN(&vals[i], notif_link_property, notif__ns);  i++;
     CONFD_SET_TAG_UINT32(&vals[i],   notif_flags,        flags1);     i++;
     CONFD_SET_TAG_XMLEND(&vals[i],   notif_link_property, notif__ns);  i++;

$ make stop clean all start-builtin
...
notifier started

Terminal window 2

$ netconf-console --create-subscription=interface

Terminal window 1

u

Terminal window 2

<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
  <ok/>
</rpc-reply>
<?xml version="1.0" encoding="UTF-8"?>
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-03-02T09:18:31.662995+00:00</eventTime>
  <link-up xmlns="http://tail-f.com/ns/test/notif">
    <if-index>1</if-index>
    <extra-id>[.='aa bb']</extra-id>
    <link-property>
      <flags>2112</flags>
    </link-property>
    <link-property>
      <flags>32</flags>
    </link-property>
  </link-up>
</notification>

Best regards

Hi,

Sorry for the incorrect show up of my notification content, I will describe my trouble more detailed.

The situation is, I try to add or modify a string type leaflist entry, if the changed value is without white space, notification can be sent successfully, but if the value contains white space, it seems the subscriber cannot receive the change.

The notififaction sent failed is like follows:

<?xml version="1.0" encoding="UTF-8"?>
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-03-03T07:18:55.335362+00:00</eventTime>
  <push-change-update xmlns="urn:rdns:com:test:oammodel:test-notifications">
    <sequence-number>4</sequence-number>
    <changed-by>
      <username>user1</username>
      <session-id>38</session-id>
      <source-host>192.168.52.134</source-host>
    </changed-by>
    <change>
      <target xmlns:complete="urn:rdns:com:test:oammodel:test-complete">/complete:container-dt/complete:sll[.="aa bb"]</target>
      <operation>create</operation>
    </change>
  </push-change-update>
</notification>

and if I send following content, it succeed.

<?xml version="1.0" encoding="UTF-8"?>
<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
  <eventTime>2021-03-03T07:18:55.335362+00:00</eventTime>
  <push-change-update xmlns="urn:rdns:com:test:oammodel:test-notifications">
    <sequence-number>4</sequence-number>
    <changed-by>
      <username>user1</username>
      <session-id>38</session-id>
      <source-host>192.168.52.134</source-host>
    </changed-by>
    <change>
      <target xmlns:complete="urn:rdns:com:test:oammodel:test-complete">/complete:container-dt/complete:sll[.="aabb"]</target>
      <operation>create</operation>
    </change>
  </push-change-update>
</notification>

And the yang definition is:

leaf-list "sll" {
    type string;
}

Thanks again for your help!
Best Regards

If you use netconf-console as a client I am guessing that the notification is successfully received.
So perhaps there is a problem with interpreting instance-identifier XPath expressions in the client you use?

Hi,

The client I use is the netconf-subsys provided by ConfD, and I subscribe notification throw the SSH way.
I try to trace the network behaviour of both the sender and receiver, using tcpdump, and the result is, if I send the content with white sapce as mentioned above, via the confd api, the receiver cannot receive anything,since the tcpdump shows no data be transported, but if I try to send normal content, it works.
If there any message I might ignored?
Thanks very much!

Best Regards

Hi cohult,

I try to open the confd developerLog and reprodece my problem, then the logs shows as follows:

<INFO> 19-Mar-2021::04:05:46.351 yp-5c6c97866b-g9zhq confd[56]: devel-c Worker closed daemon id: 2, worker id: 21, socket: {socket,<0.664.0>}
<ERR> 19-Mar-2021::04:05:46.403 yp-5c6c97866b-g9zhq confd[56]: devel-c Failed to send notification for stream DATA-CHANGE: /push-change-update/change/target: {34,
                                    [{<<"aa bb">>},
                                     1668052929,
                                     [252269338|51936138]]}: [{<<"aa bb">>},1668052929,[252269338|51936138]] is not a valid value.
<INFO> 19-Mar-2021::04:05:46.408 yp-5c6c97866b-g9zhq confd[56]: devel-c Worker closed daemon id: 2, worker id: 15, socket: {socket,<0.651.0>}

Seems an error occured? or I did something wrong?
Is there any other infos I can provide?
Thanks very much for you help me!

Best Regards

Looks like a bug. File a ticket through RT if you are subscribing to Tail-f support.