libnetconf2 icon indicating copy to clipboard operation
libnetconf2 copied to clipboard

issue connecting to confd-7.5.1 using netopeer2-cli (devel)

Open kp1dell opened this issue 4 years ago • 4 comments

Hello CESNET team.

I'm hitting the following issue when trying to connect to confd-7.5.1 using netopeer2 and also from a simple client that uses libnetconf2. Any help is deeply appreciated.

> connect --ssh --host 172.17.0.2 --port 2022 --login admin
nc DEBUG: nc_sock_connect(172.17.0.2, 2022, -1, -1)
nc VERBOSE: Trying to connect via IPv4 to 172.17.0.2:2022.
nc VERBOSE: Successfully connected to 172.17.0.2:2022 over IPv4.
[2021/08/16 04:06:11.411172, 2] ssh_connect:  libssh 0.8.90 (c) 2003-2021 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading threads_pthread
[2021/08/16 04:06:11.411277, 2] ssh_connect:  Socket connecting, now waiting for the callbacks to work
[2021/08/16 04:06:11.411322, 3] ssh_socket_pollcallback:  Received POLLOUT in connecting state
[2021/08/16 04:06:11.411399, 1] socket_callback_connected:  Socket connection callback: 1 (0)
[2021/08/16 04:06:11.411513, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2021/08/16 04:06:11.411526, 3] ssh_connect:  current state : 2
[2021/08/16 04:06:11.411749, 3] ssh_connect:  current state : 2
[2021/08/16 04:06:11.411966, 3] ssh_connect:  current state : 2

//////// bunch of intermediate output here

ly VERBOSE: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
ly ERROR: Loading "ietf-netconf-acm" module failed.
ly ERROR: Parsing module "ietf-netconf" failed.
nc ERROR: Loading base NETCONF schema failed.
nc WARNING: Missing ietf-netconf schema in context, unable to send <close-session>.
[2021/08/16 04:06:14.333452, 3] ssh_packet_need_rekey:  rekey: [data_rekey_needed=0, out_blocks=41, in_blocks=1961]
[2021/08/16 04:06:14.333527, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2021/08/16 04:06:14.333551, 3] packet_send2:  packet: wrote [type=96, len=12, padding_size=6, comp=5, payload=5]
[2021/08/16 04:06:14.333573, 3] ssh_channel_send_eof:  Sent a EOF on client channel (43:0)
[2021/08/16 04:06:14.333595, 3] ssh_packet_need_rekey:  rekey: [data_rekey_needed=0, out_blocks=41, in_blocks=1961]
[2021/08/16 04:06:14.333617, 3] packet_send2:  packet: wrote [type=97, len=12, padding_size=6, comp=5, payload=5]
[2021/08/16 04:06:14.333638, 3] ssh_channel_close:  Sent a close on client channel (43:0)
[2021/08/16 04:06:14.333672, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2021/08/16 04:06:14.333699, 3] ssh_packet_need_rekey:  rekey: [data_rekey_needed=0, out_blocks=42, in_blocks=1962]
[2021/08/16 04:06:14.333719, 3] packet_send2:  packet: wrote [type=1, len=28, padding_size=7, comp=20, payload=20]
ly ERROR: Value "admin" was not found in the dictionary.
ly ERROR: Value "172.17.0.2" was not found in the dictionary.
cmd_connect: Connecting to the 172.17.0.2:2022 as user "admin" failed.

kp1dell avatar Aug 16 '21 04:08 kp1dell

With some further investigation of the source and errors. It seems netopeer2 (libnetconf2) only supports parsing [email protected] where is confd-7.5.1 comes with ietf-netconf.yang revision 2013-09-29

kp1dell avatar Aug 17 '21 00:08 kp1dell

Are you sure about that? Have you, for example, tried to set the search directory of the client using searchpath <dir> to the directory with the specific ietf-netconf (and ietf-netconf-acm) revision?

michalvasko avatar Aug 23 '21 11:08 michalvasko

Thanks for the response Michal. So, setting search path worked just fine. However, even after providing all yang schemas in a searchpath, why does the client need to retrieve schemas from the server. Once a searchpath has been set, shouldn't it be always be looking in the search path for all schemas. In my test the client is requesting modules even though they are present in the search path.

I'm specifically talking about and issue where the client is requesting for the notifications.yang file that specifies the create-subscription rpc from the server even though I have the notifications.yang file in the searchpath.

Why is the client expecting notifications.yang to be sent from the server. Exactly similar issue is mentioned here https://discuss.tail-f.com/t/create-subscription-for-integration-with-opendaylight/3727/3 where opendaylight netconf client also required confd server to send notifications.yang.

kp1dell avatar Sep 01 '21 18:09 kp1dell

Not sure why notifications.yang are not loaded locally in particular. You can try increasing the client verbosity and it should tell you exactly. This is the output for me, stripped of libssh and libyang messages:

> verb verbose
> connect
nc VERBOSE: Trying to connect via IPv6 to ::1:830.
nc VERBOSE: getsockopt() error (Connection refused).
nc VERBOSE: Trying to connect via IPv4 to 127.0.0.1:830.
nc VERBOSE: Successfully connected to localhost:830 over IPv4.
nc VERBOSE: Publickey athentication.
nc VERBOSE: Trying to authenticate using pair "/home/vasko/.ssh/id_rsa" "/home/vasko/.ssh/id_rsa.pub".
nc VERBOSE: Authentication successful.
nc VERBOSE: Capability for <get-schema> support found.
nc VERBOSE: Capability for yang-library support found.
ly VERBOSE: Newer revision than "ietf-yang-types@2013-07-15" not found, using this as the latest revision.
ly VERBOSE: Newer revision than "ietf-inet-types@2013-07-15" not found, using this as the latest revision.
nc VERBOSE: Retrieving data for schema "ietf-netconf", revision "2013-09-29".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-netconf-acm", revision "2018-02-14".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-metadata", revision "2016-08-05".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-metadata.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-library", revision "2019-01-04".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-library.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Unable to identify revision of the schema "ietf-datastores" from the available server side information.
nc VERBOSE: Retrieving data for schema "ietf-datastores", revision "<latest>".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Unable to identify revision of the schema "ietf-datastores" from the available server side information.
nc VERBOSE: Retrieving data for schema "ietf-datastores", revision "<latest>".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Unable to identify revision of the schema "ietf-netconf-nmda" from the available server side information.
nc VERBOSE: Retrieving data for schema "ietf-netconf-nmda", revision "<latest>".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Unable to identify revision of the schema "ietf-origin" from the available server side information.
nc VERBOSE: Retrieving data for schema "ietf-origin", revision "<latest>".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Retrieving data for schema "ietf-yang-metadata", revision "2016-08-05".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-metadata.yang".
nc VERBOSE: Retrieving data for schema "ietf-netconf-with-defaults", revision "2011-06-01".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-netconf-with-defaults.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-metadata", revision "2016-08-05".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-metadata.yang".
nc VERBOSE: Retrieving data for schema "sysrepo", revision "2021-03-31".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "sysrepo-monitoring", revision "2021-07-29".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "sysrepo-plugind", revision "2020-12-10".
nc VERBOSE: Reading schema from server via get-schema.
nc VERBOSE: Retrieving data for schema "ietf-netconf-notifications", revision "2012-02-06".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-netconf-notifications.yang".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "nc-notifications", revision "2008-07-14".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "notifications", revision "2008-07-14".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-x509-cert-to-name", revision "2014-12-10".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-crypto-types", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-keystore", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-truststore", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-tcp-common", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-ssh-server", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-ssh-common", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "iana-crypt-hash", revision "2014-08-06".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-tls-server", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-tls-common", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-netconf-server", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-tcp-client", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-tcp-server", revision "2019-07-02".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-subscribed-notifications", revision "2019-09-09".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-interfaces", revision "2018-02-20".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-network-instance", revision "2019-01-21".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-interfaces", revision "2018-02-20".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-ip", revision "2018-02-22".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-interfaces", revision "2018-02-20".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-schema-mount", revision "2019-01-14".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-inet-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-inet-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-restconf", revision "2017-01-26".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-yang-push", revision "2019-09-09".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-types", revision "2013-07-15".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/ietf/ietf-yang-types.yang".
nc VERBOSE: Retrieving data for schema "ietf-restconf", revision "2017-01-26".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-yang-patch", revision "2017-02-22".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".
nc VERBOSE: Retrieving data for schema "ietf-restconf", revision "2017-01-26".
nc VERBOSE: Reading schema from localfile "/usr/local/share/yang/modules/netopeer2/[email protected]".

As can be seen, only base modules for executing get-data RPC and a few not found locally are retrieved from the server, none other.

michalvasko avatar Sep 02 '21 06:09 michalvasko