# "msg": "error connecting to the device: Unexpected session close" -While connecting to cisco ios-xr router with netconf

**URL:** <https://forum.ansible.com/t/msg-error-connecting-to-the-device-unexpected-session-close-while-connecting-to-cisco-ios-xr-router-with-netconf/25069>\
**Category:** Ansible Project\
**Created:** [July 24, 2017, 4:02pm UTC](https://forum.ansible.com/t/msg-error-connecting-to-the-device-unexpected-session-close-while-connecting-to-cisco-ios-xr-router-with-netconf/25069 "2017-07-24T16:02:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaychandran\_subraman](https://avatars.discourse-cdn.com/v4/letter/j/cdc98d/32.png) [@jaychandran\_subraman](https://forum.ansible.com/u/jaychandran_subraman)\
**Post date:** [July 24, 2017, 4:02pm UTC](https://forum.ansible.com/t/msg-error-connecting-to-the-device-unexpected-session-close-while-connecting-to-cisco-ios-xr-router-with-netconf/25069/1 "2017-07-24T16:02:26Z")

</div>

Hi ,

I tried using netconf/XML rpc with ansible for netconf\_config to cisco ios\_xr router and we got the below error

“msg”: “error connecting to the device: Unexpected session close”

Ansible version we are using is 2.4

kinly let us know if any inputs.

Thanks  
Jay

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [July 24, 2017, 5:24pm UTC](https://forum.ansible.com/t/msg-error-connecting-to-the-device-unexpected-session-close-while-connecting-to-cisco-ios-xr-router-with-netconf/25069/2 "2017-07-24T17:24:02Z")

</div>

\* What does your playbook look like?  
\* What is the output with extra verbosity?
