Details
-
Bug
-
Status: Resolved
-
Resolution: Done
-
None
-
None
-
None
-
Operating System: All
Platform: All
-
7176
Description
Logic in EditConfig is imposing requirements not defined by RFC (or at least I can't find such restriction).
It is required for rpc element (or its children) to NOT have XML prefix.
There are tools (eg. python ncclient) and devices (eg. https://www.juniper.net/documentation/en_US/junos15.1/topics/concept/netconf-session-rfc-compliant.html#jd0e89) which allows to use prefixed rpc elements and thus rendering connector-netconf-mdsal incompatible with them.
This is message as received by ODL:
<nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:2fd6f8c7-b266-429c-97cb-3887c8cab01e">
<nc:edit-config>
<nc:target>
<nc:candidate/>
</nc:target>
<nc:default-operation>merge</nc:default-operation>
<config>
<network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
<topology>
<topology-id>11</topology-id>
</topology>
</network-topology>
</config>
</nc:edit-config>
</nc:rpc>
Note "nc" prefix on root element.
This is error :
Error occurred while processing message
NetconfDocumentedException{message=Missing target element, errorType=rpc, errorTag=missing_attribute, errorSeverity=error, errorInfo={}}
at org.opendaylight.netconf.mdsal.connector.ops.EditConfig.extractTargetParameter(EditConfig.java:196)[291:org.opendaylight.netconf.mdsal-netconf-connector:1.1.1.Boron-SR1]
at org.opendaylight.netconf.mdsal.connector.ops.EditConfig.handleWithNoSubsequentOperations(EditConfig.java:67)[291:org.opendaylight.netconf.mdsal-netconf-connector:1.1.1.Boron-SR1]
at org.opendaylight.netconf.util.mapping.AbstractSingletonNetconfOperation.handle(AbstractSingletonNetconfOperation.java:26)[149:org.opendaylight.netconf.util:1.1.1.Boron-SR1]
at org.opendaylight.netconf.util.mapping.AbstractNetconfOperation.handle(AbstractNetconfOperation.java:101)[149:org.opendaylight.netconf.util:1.1.1.Boron-SR1]
at org.opendaylight.netconf.impl.osgi.NetconfOperationRouterImpl$NetconfOperationExecution.execute(NetconfOperationRouterImpl.java:182)[155:org.opendaylight.netconf.impl:1.1.1.Boron-SR1]
I think problem is here:
https://github.com/opendaylight/netconf/blob/stable/boron/netconf/mdsal-netconf-connector/src/main/java/org/opendaylight/netconf/mdsal/connector/ops/EditConfig.java#L193
Element#getElementsByTagName() returns empty NodeList, because "target" element is in non-empty namespace.