Jump to content
kevin

sync_fetch on bmhier fails when querying parent.family and child

Recommended Posts

I'm doing a customisation and I'm getting a very odd error, I have to query a specific parent CI from the cr object with the condition that the child is the cr affected resource and the family of the parent is a specific one, this is my code:

bmq = format("parent.family = %d and child = U'%s'", ci_family, (uuid)affrcuuid);
send_wait(0, top_object(), "call_attr", "bmhier", "sync_fetch", "MLIST_STATIC", bmq, -1,0);

I get the following error:

Unable to forward the message to attribute parent

Spell interp failed at z.spl:46:cr::z: get_attr on parent failed: Unknown name. parent

But if I query only the parent.family or the child, or the parent and the child, it works, it appears that the error only appears when I try to do a query mixing dot notation and a base field.

Have anyone encountered this problem, any solutions/workaround?

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi, is that code part from line 46?

you can try to add:

int msg_i;
if (msg_error()) {
	for (msg_i = 0; msg_i < msg_length(); msg_i++) {
		logf(ERROR, "%s > msg[%d]: %s", persistnet_id, msg_i, (string)msg[msg_i]);
	}
} else {
	for (msg_i = 0; msg_i < msg_length(); msg_i++) {
		logf(SIGNIFICANT, "%s > msg[%d]: %s", persistnet_id, msg_i, (string)msg[msg_i]);
	}
}

after send_wait call to get more detailed log.

Regards.

Share this post


Link to post
Share on other sites

Thank you cdtj, your answer made me realise I was looking at the wrong line ?‍♂️

The problem was that after the send_wait I was trying to get the parent column directly from the msg[0], adding this line solved it.

send_wait(0, bm_list, "dob_by_index", "DEFAULT", 0, 0);

where bm_list is a variable where I've stored the result of the list (that msg[0]).

After this now I can get the column from msg[0] without problems.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...