# maapi\_get\_elem is causing error and stopping the confd client and reconnecting

**URL:** <https://dmap-community.ductus.global/t/maapi-get-elem-is-causing-error-and-stopping-the-confd-client-and-reconnecting/219>\
**Category:** Core Engine and APIs\
**Created:** [September 18, 2015, 11:31pm UTC](https://dmap-community.ductus.global/t/maapi-get-elem-is-causing-error-and-stopping-the-confd-client-and-reconnecting/219 "2015-09-18T23:31:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phani](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@phani](https://dmap-community.ductus.global/u/phani)\
**Post date:** [September 18, 2015, 11:31pm UTC](https://dmap-community.ductus.global/t/maapi-get-elem-is-causing-error-and-stopping-the-confd-client-and-reconnecting/219/1 "2015-09-18T23:31:52Z")

</div>

Hi,  
Using MAAPI interface for show commands. While executing one of the show command which takes VRF name, Keypath is coming properly. Passing the VRF-1 to get\_vrf\_rtm\_index. Using this in the maapi\_get\_elem, api, which shows vrf name as some garbage and does not exists and CONFD\_ERR is getting returned and the application is getting close. Can you please suggest what could have caused this .

kp: keypath == /filter-views/rib/instance{VRF-1 ipv4 unicast}/routeRibTemplateList  
get\_vrf\_rtm\_index  
TRACE MAAPI\_GET\_ELEM /vrf-config/stringTOindex{ év\<85\>³}/rtmIndexDEBUG item does not exist - /routing-vrf:vrf-config/stringTOindex{év\<85\>³} does not exist  
–\> CONFD\_ERR

Thanks  
Phani

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [September 20, 2015, 6:21am UTC](https://dmap-community.ductus.global/t/maapi-get-elem-is-causing-error-and-stopping-the-confd-client-and-reconnecting/219/2 "2015-09-20T06:21:21Z")

</div>

When calling maapi\_get\_elem() you need to input a path, i.e. a string.

From the confd\_lib\_maapi man page:

> int maapi\_get\_elem(int sock, int thandle, confd\_value\_t \*v, const char \*fmt, …);  
> This reads a value from the path in fmt and writes the result into the result parameter confd\_value\_t. The path must lead to a leaf node in the data tree.  
> …

Can you explain what “get\_vrf\_rtm\_index” does?  
How does the “/vrf-config/stringTOindex{ év\<85\>³}/rtmIndex” path get created?
