[YANGTOOLS-883] YANG parser fails to detect duplicate nodes in cases Created: 22/May/18  Updated: 08/Oct/19  Resolved: 13/Jun/18

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 2.0.7

Type: Bug Priority: Medium
Reporter: Tomas Markovic Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File conf_app_peer.py     Text File error.txt     File json_add_mvpn_route.py     File mvpn_add_route.py    
Issue Links:
Duplicate
is duplicated by MDSAL-194 exception while configuring bgp peer ... Resolved
Relates
relates to YANGTOOLS-857 YANG parser should honor RFC7950 sect... Resolved
relates to YANGTOOLS-1026 Choice/Case children conflict does no... Resolved
relates to YANGTOOLS-853 Fix EffectiveStatement namespace impl... Confirmed

 Description   

Overview: When trying to add mvpn route to application peer, I get SchemaValidationFailedException. This route is copied from bgp loc-rib, so when sending this route from testtool directly, it appears correctly in bgp rib.

Steps to reproduce.

  • Start latest karaf with odl-restconf odl-bgpcep-bgp and odl-bgpcep-bgp-config-example
  • configure app peer with provided script ./conf_app_peer.py
  • add route with script ./mvpn_add_route.py

basically from error I gather that <intra-as-i-pmsi-a-d> cannot be child of <mvpn-route> which is invalid.

ERROR from restconf: (also errors from karaf log in error.txt in attachements)

<Response [500]>
{"errors":{"error":[{"error-type":"application","error-tag":"operation-failed","error-message":"canCommit encountered an unexpected failure","error-info":"org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaValidationFailedException: Node (urn:opendaylight:params:xml:ns:yang:bgp:mvpn:ipv4?revision=2018-04-17)mvpn-choice is not a valid child of (urn:opendaylight:params:xml:ns:yang:bgp:mvpn:ipv4?revision=2018-04-17)mvpn-route[{(urn:opendaylight:params:xml:ns:yang:bgp:mvpn:ipv4?revision=2018-04-17)route-key=AQwAAAAFAAAAAwoKCgo=, (urn:opendaylight:params:xml:ns:yang:bgp:mvpn:ipv4?revision=2018-04-17)path-id=0}] according to the schema.\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.verifyStructure(AbstractNodeContainerModificationStrategy.java:57)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.ListEntryModificationStrategy.verifyStructure(ListEntryModificationStrategy.java:32)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.ModifiedNode.seal(ModifiedNode.java:283)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractReadyIterator.process(AbstractReadyIterator.java:47)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeModification.ready(InMemoryDataTreeModification.java:285)\n\tat org.opendaylight.mdsal.dom.spi.store.SnapshotBackedWriteTransaction.ready(SnapshotBackedWriteTransaction.java:151)\n\tat org.opendaylight.controller.cluster.datastore.LocalTransactionFactoryImpl.onTransactionReady(LocalTransactionFactoryImpl.java:86)\n\tat org.opendaylight.controller.cluster.datastore.LocalTransactionContext.ready(LocalTransactionContext.java:77)\n\tat org.opendaylight.controller.cluster.datastore.LocalTransactionContext.directCommit(LocalTransactionContext.java:88)\n\tat org.opendaylight.controller.cluster.datastore.TransactionProxy.getDirectCommitFuture(TransactionProxy.java:277)\n\tat org.opendaylight.controller.cluster.datastore.TransactionProxy.createSingleCommitCohort(TransactionProxy.java:264)\n\tat org.opendaylight.controller.cluster.datastore.TransactionProxy.ready(TransactionProxy.java:229)\n\tat org.opendaylight.controller.cluster.datastore.TransactionProxy.ready(TransactionProxy.java:54)\n\tat org.opendaylight.controller.cluster.databroker.AbstractDOMBrokerWriteTransaction.commit(AbstractDOMBrokerWriteTransaction.java:149)\n\tat org.opendaylight.controller.cluster.databroker.compat.LegacyDOMDataBrokerAdapter$DOMDataTransactionAdapter.commit(LegacyDOMDataBrokerAdapter.java:307)\n\tat org.opendaylight.controller.md.sal.common.api.data.AsyncWriteTransaction.submit(AsyncWriteTransaction.java:345)\n\tat org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.postDataViaTransaction(BrokerFacade.java:679)\n\tat org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.commitConfigurationDataPost(BrokerFacade.java:455)\n\tat org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:968)\n\tat org.opendaylight.netconf.sal.restconf.impl.RestconfImpl.createConfigurationData(RestconfImpl.java:913)\n\tat org.opendaylight.netconf.sal.restconf.impl.StatisticsRestconfServiceWrapper.createConfigurationData(StatisticsRestconfServiceWrapper.java:157)\n\tat org.opendaylight.netconf.sal.rest.impl.RestconfCompositeWrapper.createConfigurationData(RestconfCompositeWrapper.java:92)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n\tat java.lang.reflect.Method.invoke(Method.java:498)\n\tat com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)\n\tat com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)\n\tat com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)\n\tat com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.ResourceObjectRule.accept(ResourceObjectRule.java:100)\n\tat com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)\n\tat com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)\n\tat com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)\n\tat com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)\n\tat com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)\n\tat javax.servlet.http.HttpServlet.service(HttpServlet.java:790)\n\tat org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:848)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1772)\n\tat org.eclipse.jetty.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:308)\n\tat org.eclipse.jetty.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:262)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)\n\tat org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)\n\tat org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)\n\tat org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)\n\tat org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\n\tat org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)\n\tat org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)\n\tat org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)\n\tat org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\n\tat org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)\n\tat org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)\n\tat org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)\n\tat org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)\n\tat org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)\n\tat org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)\n\tat org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)\n\tat org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)\n\tat org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:51)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)\n\tat org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:205)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)\n\tat org.opendaylight.aaa.filterchain.filters.CustomFilterAdapter.doFilter(CustomFilterAdapter.java:102)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)\n\tat org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)\n\tat org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:534)\n\tat org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:333)\n\tat org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)\n\tat org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:283)\n\tat org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:108)\n\tat org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)\n\tat org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)\n\tat java.lang.Thread.run(Thread.java:748)\n"}]}}


 Comments   
Comment by Robert Varga [ 22/May/18 ]

Does the same happen with JSON encoding?

Comment by Tomas Markovic [ 22/May/18 ]

I didn't try that one, only multiple types of xml and paths.

Comment by Claudio David Gasparini [ 23/May/18 ]

Preparing debugTest[0] for MDSAL-342, I'm hitting same issue.

Steps:

Run DebugBugTest->testUseCase2.

When using put, this scenario test works, when using merge we hit SchemaValidationFailedException.

[0] https://git.opendaylight.org/gerrit/#/c/72160/

Comment by Robert Varga [ 23/May/18 ]

This is a problem with model:

 

grouping mvpn {

  [...]
  case shared-tree-join-case {
    uses c-multicast-grouping;
  }
  case source-tree-join-case {
    uses c-multicast-grouping;
  }
}

Which results in same node being defined in two cases (c-multicast), which is detected in cache loader and suppressed. Granted, the YANG parser should have uncovered this treason.

Comment by Robert Varga [ 23/May/18 ]

Previous work in this area: https://git.opendaylight.org/gerrit/#/c/68134/ . Needs to be revisited/adjusted for minimal breakage.

Comment by Robert Varga [ 12/Jun/18 ]

Duplicate of YANGTOOLS-857.

Comment by Robert Varga [ 13/Jun/18 ]

This is actually a subset of YANGTOOLS-857, let's address these separately.

Generated at Wed Feb 07 20:54:34 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.