netopeer2 icon indicating copy to clipboard operation
netopeer2 copied to clipboard

Out of memory error comes

Open Abrahamma97 opened this issue 3 years ago • 16 comments

Hi @michalvasko can you help out here: I had given the following configuration and got the following error.

> user-rpc


<chg-password xmlns="urn:o-ran:user-mgmt:1.0">
<currentPassword>vaibhav123</currentPassword>
<newPassword>vaibhav1</newPassword>
<newPasswordConfirm>vaibhav1</newPasswordConfirm>
</chg-password>


ERROR
	type:     application
	tag:      operation-failed
	severity: error
	message:  Out of memory

		RU-System Logs

Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Resolving unresolved data nodes and their constraints...
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: All data nodes and constraints resolved.
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Resolving unresolved data nodes and their constraints...
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: All data nodes and constraints resolved.
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Published event "rpc" "/o-ran-usermgmt:chg-password" with ID 2 priority 0 for 1 subs.
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Processing "ietf-netconf-monitoring" "operational" event with ID 2.
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Successful processing of "operational" event with ID 2.
Oct 29 11:47:50 abey user.err USERMGMT[2043]: error in get item list !!
Oct 29 11:47:50 abey daemon.err netopeer2-server[2019]: Out of memory
Oct 29 11:47:50 abey daemon.warn netopeer2-server[2019]: Event "rpc" with ID 2 priority 0 failed (Out of memory).
Oct 29 11:47:50 abey daemon.err netopeer2-server[2019]: Failed to send an RPC (User callback failed).
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Session 1: thread 2 event new RPC.
Oct 29 11:47:50 abey daemon.info netopeer2-server[2019]: Session 1: thread 2 event reply error.`

Please note that this is in root user. Can you tell me how out of memory error is coming

Abrahamma97 avatar Jun 15 '21 06:06 Abrahamma97

I seem to remember fixing something like this some time ago, what netopeer2/sysrepo version are you using?

michalvasko avatar Jun 17 '21 07:06 michalvasko

Hi @michalvasko , I am using Netopeer_server v1.1.70 and Sysrepo v1.4.122. Can you suggest a stable release

Abrahamma97 avatar Jun 21 '21 19:06 Abrahamma97

You can try using the latest v1 release 1.4.140.

michalvasko avatar Jun 22 '21 08:06 michalvasko

Ok thanks

Abrahamma97 avatar Jun 23 '21 09:06 Abrahamma97

Hi @michalvasko , I have used v1 release v1 1.4.140 in server still same issue had come.

Abrahamma97 avatar Aug 10 '21 06:08 Abrahamma97

Please provide the code snippet generating the following message

Oct 29 11:47:50 abey user.err USERMGMT[2043]: error in get item list !!

michalvasko avatar Aug 23 '21 10:08 michalvasko

Hi @michalvasko , I got the same error out of memory did you know how to resolve that, i install the latest version of libyang, libnetconf, sysrepo and netopeer2 but this error is still come.

vaibhav1713109 avatar Sep 28 '21 04:09 vaibhav1713109

What exactly "latest version" means, could you write the exact versions? Also, please provide some details, at least the output of netopeer2 when run with -v2 and the steps leading to the problem.

michalvasko avatar Sep 30 '21 09:09 michalvasko

netopeer2(2.0.30),libyang (v2.0.97), libnetconf2 (v2.0.19) and sysrepo (v2.0.47) these version i am using.

vaibhav1713109 avatar Oct 25 '21 10:10 vaibhav1713109

Okay, then please do the rest I have asked you to.

Also, please provide some details, at least the output of netopeer2 when run with -v2 and the steps leading to the problem.

michalvasko avatar Oct 25 '21 10:10 michalvasko

netopeer2 (2.0.28) , libyang (v2.0.88), libnetconf2 (v2.0.17) and sysrepo (v2.0.41).

netopeer2-server 2.0.28 compile time: Sep 28 2021, 09:52:31

Same steps as @Abrahamma97 follows.

vaibhav1713109 avatar Oct 25 '21 10:10 vaibhav1713109

Okay, then do what I asked before.

Please provide the code snippet generating the following message Oct 29 11:47:50 abey user.err USERMGMT[2043]: error in get item list !!

michalvasko avatar Oct 25 '21 11:10 michalvasko

Hi @michalvasko , please see the code snippet below

char *findUser(sr_session_ctx_t *session, sr_conn_ctx_t *connection, char *username)
{
sr_session_ctx_t *oper_session;
rc = sr_session_start(connection, SR_DS_OPERATIONAL, &oper_session);
    if (rc != SR_ERR_OK) {
        PRINT(ERR, "USERMGMT", "error in start session !!%s", "\n");
        return NULL;`

Abrahamma97 avatar May 04 '22 13:05 Abrahamma97

No, this code prints error in start session !!... and not error in get item list !!.

michalvasko avatar May 04 '22 13:05 michalvasko

Hi @michalvasko , sorry I forgot to add rest of snippet.

user = sr_session_get_nc_id(session);
    asprintf(&username_xpath, "/ietf-netconf-monitoring:netconf-state/sessions/session[session-id=%d]/username", user);
rc = sr_get_item(oper_session, username_xpath , 0, &value);
    if (rc != SR_ERR_OK) {
        PRINT(ERR, "USERMGMT", "error in get item list !!%s", "\n");
        ret = rc;
        goto cleanup;
    }
```

Abrahamma97 avatar May 05 '22 04:05 Abrahamma97

What I do not understand is that why no error is printed by sr_get_item if SR_ERR_NO_MEMORY is returned? In any case, you are using an obsolete sysrepo version and it would be a waste of time for me to try to debug this, especially since the whole problem is so odd.

michalvasko avatar May 05 '22 06:05 michalvasko