Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-1264

Cannot create new list resource with instance identifier key

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 7.0.4
    • 7.0.0, 7.0.1, 7.0.2, 7.0.3
    • restconf-nb

      We cannot create a new instance of list item for lists which key's type is instance identifier.

      Steps to reproduce:

      You can modify the car-purchase model in your device by adding:

      container persons {
        list person {
          key name;    leaf name {
            type person:person-ref;
          }
        }
      }

      Then you can try to invoke the following request:

      POST http://192.168.56.25:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=17830-sim-device/yang-ext:mount/car-purchase:persons

      With payload:

      {
          "person": [
              {
                  "name": "/people:people/people:person[id=\"0\"]"
              }
          ]
      }

      You can see in logs an error which we need to fix:

      15:02:50.900 ERROR [odl-netconf-client-4] RuntimeException while executing runnable CallbackListener{org.opendaylight.restconf.nb.jaxrs.JaxRsRestconf$6@9d372bc} with executor MoreExecutors.directExecutor()
      java.lang.IllegalArgumentException: Illegal character "%" at position 197 is not allowed as a start of a name in a path template "/rests/data/car-purchase:persons/person=%2F%28urn%3Aopendaylight%3Aparams%3Axml%3Ans%3Ayang%3Acontroller%3Aconfig%3Asal-clustering-it%3Apeople%3Frevision%3D2014-08-18%29people%2Fperson%2Fperson%5B{%28urn%3Aopendaylight%3Aparams%3Axml%3Ans%3Ayang%3Acontroller%3Aconfig%3Asal-clustering-it%3Apeople%3Frevision%3D2014-08-18%29id%3D0}%5D".
              at org.glassfish.jersey.uri.internal.UriTemplateParser$Variables.parse(UriTemplateParser.java:568) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.UriTemplateParser$Variables.access$100(UriTemplateParser.java:500) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.UriTemplateParser.parseName(UriTemplateParser.java:308) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.UriTemplateParser.parse(UriTemplateParser.java:246) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.UriTemplateParser.<init>(UriTemplateParser.java:94) ~[bundleFile:?]
              at org.glassfish.jersey.uri.UriTemplate.createUriComponent(UriTemplate.java:926) ~[bundleFile:?]
              at org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:880) ~[bundleFile:?]
              at org.glassfish.jersey.uri.UriTemplate.createURI(UriTemplate.java:787) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.JerseyUriBuilder._build(JerseyUriBuilder.java:972) ~[bundleFile:?]
              at org.glassfish.jersey.uri.internal.JerseyUriBuilder.build(JerseyUriBuilder.java:886) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.jaxrs.JaxRsRestconf$6.transform(JaxRsRestconf.java:518) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.jaxrs.JaxRsRestconf$6.transform(JaxRsRestconf.java:511) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.jaxrs.JaxRsRestconfCallback.onSuccess(JaxRsRestconfCallback.java:33) ~[bundleFile:?]
              at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
              at org.opendaylight.restconf.common.errors.SettableRestconfFuture.set(SettableRestconfFuture.java:21) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy$3.onSuccess(RestconfStrategy.java:518) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.rfc8040.rests.transactions.RestconfStrategy$3.onSuccess(RestconfStrategy.java:515) ~[bundleFile:?]
              at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
              at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49) ~[bundleFile:?]
              at org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfTransaction$2$1.lambda$onSuccess$0(NetconfRestconfTransaction.java:156) ~[bundleFile:?]
              at com.google.common.util.concurrent.Futures$FutureCombiner$1.call(Futures.java:769) ~[bundleFile:?]
              at com.google.common.util.concurrent.Futures$FutureCombiner$1.call(Futures.java:765) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.runInterruptibly(CombinedFuture.java:196) ~[bundleFile:?]
              at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:76) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture$CombinedFutureInterruptibleTask.execute(CombinedFuture.java:108) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture.handleAllCompleted(CombinedFuture.java:65) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.processCompleted(AggregateFuture.java:301) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.decrementCountAndMaybeComplete(AggregateFuture.java:283) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.lambda$init$1(AggregateFuture.java:181) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture$CallableInterruptibleTask.setValue(CombinedFuture.java:201) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture$CombinedFutureInterruptibleTask.afterRanInterruptiblySuccess(CombinedFuture.java:129) ~[bundleFile:?]
              at com.google.common.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:89) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture$CombinedFutureInterruptibleTask.execute(CombinedFuture.java:108) ~[bundleFile:?]
              at com.google.common.util.concurrent.CombinedFuture.handleAllCompleted(CombinedFuture.java:65) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.processCompleted(AggregateFuture.java:301) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.decrementCountAndMaybeComplete(AggregateFuture.java:283) ~[bundleFile:?]
              at com.google.common.util.concurrent.AggregateFuture.lambda$init$1(AggregateFuture.java:181) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
              at com.google.common.util.concurrent.SettableFuture.set(SettableFuture.java:49) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.spi.NetconfDeviceDOMRpcService$1.onSuccess(NetconfDeviceDOMRpcService.java:59) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.spi.NetconfDeviceDOMRpcService$1.onSuccess(NetconfDeviceDOMRpcService.java:47) ~[bundleFile:?]
              at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1133) ~[bundleFile:?]
              at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
              at com.google.common.util.concurrent.AbstractFuture.set(AbstractFuture.java:782) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.UncancellableFuture.set(UncancellableFuture.java:42) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.processMessage(NetconfDeviceCommunicator.java:326) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:242) ~[bundleFile:?]
              at org.opendaylight.netconf.client.mdsal.NetconfDeviceCommunicator.onMessage(NetconfDeviceCommunicator.java:52) ~[bundleFile:?]
              at org.opendaylight.netconf.nettyutil.AbstractNetconfSession.handleMessage(AbstractNetconfSession.java:67) ~[bundleFile:?]
              at org.opendaylight.netconf.nettyutil.AbstractNetconfSession.channelRead0(AbstractNetconfSession.java:194) ~[bundleFile:?]
              at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[bundleFile:4.1.104.Final]
              at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[bundleFile:4.1.104.Final]
              at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[bundleFile:4.1.104.Final]
              at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[bundleFile:4.1.104.Final]
              at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[bundleFile:4.1.104.Final]
              at org.opendaylight.netconf.transport.ssh.TransportClientSubsystem.doWriteData(TransportClientSubsystem.java:69) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.channel.AbstractChannel.handleData(AbstractChannel.java:839) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractConnectionService.channelData(AbstractConnectionService.java:584) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractConnectionService.process(AbstractConnectionService.java:465) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.CurrentService.process(CurrentService.java:109) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:624) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSession.lambda$handleMessage$0(AbstractSession.java:545) ~[bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.util.threads.ThreadUtils.runAsInternal(ThreadUtils.java:68) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:544) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1688) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:505) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.netty.NettyIoSession.channelRead(NettyIoSession.java:293) [bundleFile:?]
              at org.opendaylight.netconf.shaded.sshd.netty.NettyIoSession$Adapter.channelReadComplete(NettyIoSession.java:400) [bundleFile:?]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelReadComplete(AbstractChannelHandlerContext.java:486) [bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelReadComplete(AbstractChannelHandlerContext.java:463) [bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.fireChannelReadComplete(AbstractChannelHandlerContext.java:456) [bundleFile:4.1.104.Final]
              at io.netty.channel.DefaultChannelPipeline$HeadContext.channelReadComplete(DefaultChannelPipeline.java:1415) [bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelReadComplete(AbstractChannelHandlerContext.java:482) [bundleFile:4.1.104.Final]
              at io.netty.channel.AbstractChannelHandlerContext.invokeChannelReadComplete(AbstractChannelHandlerContext.java:463) [bundleFile:4.1.104.Final]
              at io.netty.channel.DefaultChannelPipeline.fireChannelReadComplete(DefaultChannelPipeline.java:925) [bundleFile:4.1.104.Final]
              at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:820) [bundleFile:4.1.104.Final]
              at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) [bundleFile:4.1.104.Final]
              at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) [bundleFile:4.1.104.Final]
              at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) [bundleFile:4.1.104.Final]
              at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [bundleFile:4.1.104.Final]
              at java.lang.Thread.run(Thread.java:840) [?:?]

            cicut Ľuboš Čičut
            ivanhrasko Ivan Hrasko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: