CESNET / libnetconf2

C NETCONF library
BSD 3-Clause "New" or "Revised" License
202 stars 145 forks source link

poll error (Success) #479

Open wudyw opened 5 months ago

wudyw commented 5 months ago

I created a session using libssh, but sometimes it print this log, I SET the timeout is 100ms, the timeout is too small to lead this issue?

//log

Apr 11 16:05:21 localhost mefd[1919462]: [337:04.38809] DBG MEFD.APP: (dbg_msg_callback:92) NETCONF:nc_sock_connect(10.4.2.64, 830, -1, -1)
Apr 11 16:05:21 localhost mefd[1919462]: [337:04.38809] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Trying to connect via IPv4 to 10.4.2.64:830.
Apr 11 16:05:21 localhost mefd[1919462]: [337:04.38810] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Successfully connected to 10.4.2.64:830 over IPv4.
Apr 11 16:05:22 localhost mefd[1919462]: [337:04.38856] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Interactive SSH authentication method was disabled.
Apr 11 16:05:22 localhost mefd[1919462]: [337:04.38856] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Publickey SSH authentication method was disabled.
Apr 11 16:05:22 localhost mefd[1919462]: [337:04.38856] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Password authentication (host "10.4.2.64", user "admin").
Apr 11 16:05:22 localhost mefd[1919462]: [337:04.39044] NOTE MEFD.APP: (dbg_msg_callback:89) NETCONF:Authentication successful.

Apr 11 16:05:24 localhost mefd[1919462]: [337:04.41821] WARNING MEFD.APP: (dbg_msg_callback:86) NETCONF:Unexpected reply without data to a <get> RPC.
Apr 11 16:05:25 localhost mefd[1919462]: [337:04.41922] ERROR MEFD.APP: (dbg_msg_callback:83) NETCONF:poll error (Success).
wudyw commented 5 months ago

I think this issue is caused by timeout in nc_recv_reply() is too small, I modified it to 10ms, it is much easier to trigger, then I modified it to 1s, didn't see any error. I wonder if timeout, why the ret is not NC_MSG_WOULDBLOCK /waiting for another message timed out /, is it not timeout?

michalvasko commented 5 months ago

What libnetconf2 version are you using? What NETCONF client and server are you using? I do not understand that from waht you wrote. And what nc_recv_reply() timeout are you talking about, can you mention the project/source file?

wudyw commented 4 months ago

What libnetconf2 version are you using? What NETCONF client and server are you using? I do not understand that from waht you wrote. And what nc_recv_reply() timeout are you talking about, can you mention the project/source file?

libnetconf2 I used is 3.0.8, I just used libnetconf2 as a client, the server is Nokia router.

r = nc_recv_reply(session, rpc, msgid, 100, &envp, &op);

The time out is 100, the 4th para in nc_recv_reply

michalvasko commented 4 months ago

What libssh version are you using? Based on what you said, it seems ssh_channel_poll_timeout() is returning something it is not supposed to and there was a bug a long time ago that SSH_AGAIN was returned even though it should not have been.