libyang icon indicating copy to clipboard operation
libyang copied to clipboard

Missing mandatory prefix for XML metadata "type"

Open siprab opened this issue 8 months ago • 5 comments

Hi,

libyang is throwing below error while creating subscription:

Tag: operation-failed Type: application Severity: error Message: Missing mandatory prefix for XML metadata "type".

The RPC sent is <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="42"> <create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <filter type="xpath" xmlns:o-ran-supervision="urn:o-ran:supervision:1.0" select="/o-ran-supervision:*"/> </create-subscription> </rpc>

this is similar to issue https://github.com/CESNET/libyang/issues/1959

we are using libyang v3.5.0

Please suggest. Thank you.

siprab avatar Apr 08 '25 09:04 siprab

As you correctly noticed, exactly the same issue was fixed in the past. I have also tried it with the current libyang version and it also worked so my advice is to update libyang, in case there was a regression.

michalvasko avatar Apr 08 '25 11:04 michalvasko

Hi Michal,

Are you suggesting to upgrade libyang on server side?

siprab avatar Apr 08 '25 12:04 siprab

Yes, that is the only advice I can give you.

michalvasko avatar Apr 08 '25 12:04 michalvasko

Hi Michal,

our server uses the 3rd party code, can anything be done at client to send the subscription RPC with xml prefix for 'type' attribute?

the current RPC which is sent by client now is as below: <create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <filter type="xpath" xmlns:o-ran-supervision="urn:o-ran:supervision:1.0" select="/o-ran-supervision:*"/> </create-subscription>

and the RPC which we expect the client to send: <create-subscription xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"> <filter xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:type="xpath" xmlns:o-ran-supervision="urn:o-ran:supervision:1.0" nc:select="/o-ran-supervision:*"/> </create-subscription>

could you please suggest on this?

siprab avatar Apr 08 '25 13:04 siprab

Yes, you can try sending such an RPC.

michalvasko avatar Apr 08 '25 13:04 michalvasko