Maapi start_user_session error

Hello Experts,

I am intergrating external encryption key to confd getting the encrypted value from confd and save it on text file these all working fine. and am also replace the encryption key on confd.conf. While am trying to insert the plain value to CDB it showing some error.

Am using these lines of code to set the value to confd

As per confd doc i trigger the function after phase 1. I got this error.

when i trigger the function after phase 2. I got this error

Please share your suggestions on this.
Thanks

The maapi.start_user_session looks fine. Can you compare it with examples.confd/intro/python/12-maapi/maapi_example.py (around line 526) if you have all params correct?

The issue I can see is that you are passing _confd.PORT, byt the last param is not port, but prot
( the protocol used by the client for connecting). Please try _confd.PROTO_TCP like in the example.

Hi @mnovak,

You are right i used port instead of protocol now that works fine.

but when i set the value I was getting the below error first line which I printed is path and second line is the value.

Another doubt, when I need to set these value into cdb means after whish phase after the key has updated in confd.config

In path the key should be placed into curly brackets, not into square brackets. E.g.:

maapi.get_elem(maapisock, th, "/hosts{%s}/%s" % (key, elem))

Is this the problem? Unfortunately I do not see path value for your case.