Skip to content
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

netconfd returns "invalid protocol framing characters received" for get-config request #28

Open
anukulverma opened this issue Aug 25, 2016 · 15 comments

Comments

@anukulverma
Copy link

Hi,

I m trying to use openssh commands to get device configuration.

hello message sent :

urn:ietf:params:netconf:base:1.1 ]]>]]>

get-config payload:
#239







Netconfd server (Openyuma) returns following error:
#581



transport
malformed-message
error
data-invalid
invalid protocol framing characters received

378


@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

  1. Please make sure netconf-subsytem running over SSH and sshd is listening to port 830:
    netstat -tulpn | grep :830
  2. Switch to use ncclient to get device running config
    $pip install ncclient or download from https://github.com/ncclient/ncclient

@anukulverma
Copy link
Author

  1. With base 1.0 everything works.
urn:ietf:params:netconf:base:1.0 ]]>]]>








]]>]]>

So , not issue with connection or port.

  1. I m using yangcli, ncclient, netopeer -> these r working fine for me. I m trying to develop my own client app for that i m trying with ssh commands.

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

Yes, netconf server (OpenYuma) is currently support base:1.0 and cause conflict with your client base:1.1.
So, you should get capabilities from server and switch to use appropriate version as same as ncclient.

@anukulverma
Copy link
Author

Netconf server is sending both 1.1 & 1.0 to client in hello message,



urn:ietf:params:netconf:base:1.0
urn:ietf:params:netconf:base:1.1

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

Please turn on debug log (i.e debug4) at netconf server to see a root cause

@anukulverma
Copy link
Author

Server debug log:

ses_accept_input on session 5
ses read OK (173) on session 5
ses: accept base:1.1 buffer (173):
#166

ses: invalid base:1;1 framing (inbetween: expect newline)
agt_ncxserver: input failed for session 5 (invalid protocol framing characters received)
ses_msg send 1.1 buff:591
lity
#581



transport
malformed-message
error
data-invalid
invalid protocol framing characters received

378



agt_sys: generating notification
Queing notification to send (id: 11)
Event Payload:
sys:userName root
sys:sessionId 5
sys:remoteHost 10.12.23.28
sys:terminationReason other
Session 5 closed

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

ses: invalid base:1;1 framing (inbetween: expect newline)
agt_ncxserver: input failed for session 5 (invalid protocol framing characters received)
ses_msg send 1.1 buff:591
Does LF encode as '\n' (wiki: https://tools.ietf.org/html/rfc6242#section-4.2)

@anukulverma
Copy link
Author

I saw this and copied payload from RFC only. Can u please send me the payload, if i m doing something wrong, i will compare and correct.

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

I think you have to follow an payload format:
\n#\n
...\n
...\n
...\n
\n##\n

@anukulverma
Copy link
Author

I have tried this also.

agt_hello: set protocol to base:1.1
Session 11 for [email protected] now active (base:1.1)
ses_accept_input on session 11
ses read OK (132) on session 11
ses: accept base:1.1 buffer (132):
\n#4\n
<rpc
\n#18\n
message-id="102"\n
\n#79\n
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n
\n

ses: invalid base:1;1 framing (inbetween: expect newline)
agt_ncxserver: input failed for session 11 (invalid protocol framing characters received)
ses_msg send 1.1 buff:591
lity
#581



transport
malformed-message
error
data-invalid
invalid protocol framing characters received

378



agt_sys: generating notification
Queing notification to send (id: 23)
Event Payload:
sys:userName root
sys:sessionId 11
sys:remoteHost 10.12.23.28
sys:terminationReason other
Session 11 closed

@anukulverma
Copy link
Author

Is it possible for you to help me, to get it working?

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

Sorry, what am I suggest is to read carefully at https://tools.ietf.org/html/rfc6242#section-4.2 since I never try this before.
Try your best!

@hoangle
Copy link
Member

hoangle commented Aug 25, 2016

Try this:
\n#4\n <rpc \n#18\n message-id="102"\n \n#79\n xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n <close-session/>\n </rpc> \n##\n

@anukulverma
Copy link
Author

same error

@vlutsenko
Copy link

Hello @anukulverma, I understand that issue happened while ago, but would much appreciate if can you share the root cause and how to overcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants