[YANGTOOLS-273] Provided node value Flags [_inPlace=false, _notGuilty=false] did not have type BitsType Created: 19/Aug/14  Updated: 10/Apr/22  Resolved: 26/Aug/14

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

Type: Bug
Reporter: Valentin Mayamsin Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


Attachments: Java Source File SimplePutLspTest.java    
External issue ID: 1584

 Description   

I'm using sal-remote-broker to create PCEP tunnel. After a while I run into a funny state when it doesn't respond to remote SAL client requests, however I can use browser to read the data. Restarting ODL doesn't resolve the issue, however it has gone after some time (and restart).

osgi> 2014-08-19 16:02:10.322 PDT [http-bio-8080-exec-5] ERROR o.o.y.y.d.i.codec.xml.XmlStreamUtils - Provided node value Flags [_inPlace=false, _notGuilty=false] did not have type BitsType [name=(urn:ietf:params:xml:ns:yang:1)bits, path=AbsoluteSchemaPath

{path=[(urn:opendaylight:params:xml:ns:yang:rsvp?revision=2013-08-20)error-spec, (urn:opendaylight:params:xml:ns:yang:rsvp?revision=2013-08-20)flags, (urn:ietf:params:xml:ns:yang:1)bits]}

, description=The bits built-in type represents a bit set. That is, a bits value is a set of flags identified by small integer position numbers starting at 0. Each bit number has an assigned name., reference=https://tools.ietf.org/html/rfc6020#section-9.7, bits=[Bit[name=in-place, position=7], Bit[name=not-guilty, position=6]], units=] required by mapping. Using stream instead.
java.lang.ClassCastException: org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.ErrorSpec$Flags cannot be cast to java.util.Set
at org.opendaylight.yangtools.yang.data.impl.codec.TypeDefinitionAwareCodec$BitsCodecStringImpl.serialize(TypeDefinitionAwareCodec.java:481) ~[bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:237) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:178) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeValue(XmlStreamUtils.java:198) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeElement(XmlStreamUtils.java:152) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlStreamUtils.writeDocument(XmlStreamUtils.java:114) [bundlefile:na]
at org.opendaylight.yangtools.yang.data.impl.codec.xml.XmlDocumentUtils.toDocument(XmlDocumentUtils.java:101) [bundlefile:na]
at org.opendaylight.controller.sal.rest.impl.XmlMapper.write(XmlMapper.java:63) [bundlefile:na]
at org.opendaylight.controller.sal.rest.impl.StructuredDataToXmlProvider.writeTo(StructuredDataToXmlProvider.java:104) [bundlefile:na]
at org.opendaylight.controller.sal.rest.impl.StructuredDataToXmlProvider.writeTo(StructuredDataToXmlProvider.java:40) [bundlefile:na]
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:306) [jersey-server-1.17.jar:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1479) [jersey-server-1.17.jar:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1391) [jersey-server-1.17.jar:1.17]
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1381) [jersey-server-1.17.jar:1.17]
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:416) [bundlefile:na]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:538) [bundlefile:na]
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:716) [bundlefile:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848) [bundlefile:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [bundlefile:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [bundlefile:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [bundlefile:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [bundlefile:na]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581) [bundlefile:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168) [bundlefile:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) [bundlefile:na]
at org.opendaylight.controller.filtervalve.cors.FilterValve$1.doFilter(FilterValve.java:53) [bundlefile:na]
at org.apache.catalina.filters.CorsFilter.handleNonCORS(CorsFilter.java:440) [bundlefile:na]
at org.apache.catalina.filters.CorsFilter.doFilter(CorsFilter.java:179) [bundlefile:na]
at org.opendaylight.controller.filtervalve.cors.model.FilterProcessor$1.doFilter(FilterProcessor.java:61) [bundlefile:na]
at org.opendaylight.controller.filtervalve.cors.model.FilterProcessor.process(FilterProcessor.java:66) [bundlefile:na]
at org.opendaylight.controller.filtervalve.cors.FilterValve.invoke(FilterValve.java:56) [bundlefile:na]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) [bundlefile:na]
at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:309) [bundlefile:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [bundlefile:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [bundlefile:na]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002) [bundlefile:na]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585) [bundlefile:na]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310) [bundlefile:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.7.0_60]
at java.lang.Thread.run(Unknown Source) [na:1.7.0_60]

Here is remote SAL exception in this case:
Exception in thread "main" java.lang.IllegalStateException: No data to return.
at org.opendaylight.controller.sal.restconf.broker.impl.DataBrokerServiceImpl.readOperationalData(DataBrokerServiceImpl.java:83)



 Comments   
Comment by Valentin Mayamsin [ 19/Aug/14 ]

This is a Cisco specific (CDL) build:

org.opendaylight.controller.version = 0.1
org.opendaylight.controller.build.scm.version = 7b5786126d58624c814ed57139d61c8c3e0a4aac
org.opendaylight.controller.build.user = root
org.opendaylight.controller.build.workspace = **********
org.opendaylight.controller.build.timestamp = 1408153593032
org.opendaylight.controller.build.machine = **********

Comment by Valentin Mayamsin [ 19/Aug/14 ]

Request:

AddLspInput [_arguments=Arguments [_ero=Ero [_subobject=[Subobject [_loose=false, _subobjectType=IpPrefixCase [_ipPrefix=IpPrefix [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=196.20.160.41/32], _value=[1, 9, 6, ., 2, 0, ., 1, 6, 0, ., 4, 1, /, 3, 2]], augmentation=[]], augmentation=[]], augmentation=[]], Subobject [_loose=false, _subobjectType=IpPrefixCase [_ipPrefix=IpPrefix [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=200.20.160.43/32], _value=[2, 0, 0, ., 2, 0, ., 1, 6, 0, ., 4, 3, /, 3, 2]], augmentation=[]], augmentation=[]], augmentation=[]]], augmentation=[]], _lspa=Lspa [_holdPriority=0, _setupPriority=7, augmentation=[]], _bandwidth=Bandwidth [_bandwidth=Float32 [_value=[75, 62, -68, 32]], augmentation=[]], _endpointsObj=EndpointsObj [_addressFamily=Ipv4Case [_ipv4=Ipv4 [_sourceIpv4Address=Ipv4Address [_value=39.39.39.39], _destinationIpv4Address=Ipv4Address [_value=43.43.43.43], augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[Arguments2 [_lsp=Lsp [_delegate=true, _administrative=true, augmentation=[]]]]], _node=Uri [_value=pcc://39.39.39.39], _name=depoy-test-lsp, _networkTopologyRef=NetworkTopologyRef [_value=KeyedInstanceIdentifier

{targetType=interface org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology, path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology[key=TopologyKey [_topologyId=Uri [_value=pcep-topology]]]]}

], augmentation=[]]

Comment by Valentin Mayamsin [ 19/Aug/14 ]

The issue is reproducible on my machine with the above request.

Comment by Valentin Mayamsin [ 19/Aug/14 ]

...and this is RPC output from SAL remote client

java.lang.RuntimeException: AddLspOutput [_error=[], augmentation=[]]

Comment by Valentin Mayamsin [ 21/Aug/14 ]

The issue is still there, however I'm not able to reproduce it with RESTCONF. Here is my RESTCONF request which works:

POST http://blah:8080/restconf/operations/network-topology-pcep:add-lsp
Content-Type: application/xml

<input>
<node>pcc://39.39.39.39</node>
<name>depoy-test-lsp</name>
<arguments>
<lsp xmlns:stateful="urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful">
<delegate>true</delegate>
<administrative>true</administrative>
</lsp>
<endpoints-obj>
<ipv4>
<source-ipv4-address>39.39.39.39</source-ipv4-address>
<destination-ipv4-address>43.43.43.43</destination-ipv4-address>
</ipv4>
</endpoints-obj>
<ero>
<subobject>
<loose>false</loose>
<ip-prefix><ip-prefix>196.20.160.41/32</ip-prefix></ip-prefix>
</subobject>
<subobject>
<loose>false</loose>
<ip-prefix><ip-prefix>200.20.160.43/32</ip-prefix></ip-prefix>
</subobject>
</ero>

</arguments>
<network-topology-ref xmlns:topo="urn:TBD:params:xml:ns:yang:network-topology">/topo:network-topology/topo:topology[topo:topology-id="pcep-topology"]</network-topology-ref>
</input>

However if I use SAL remote client, it fails on the following request (stringified):

AddLspInput
[_arguments=Arguments
[_ero=Ero
[_subobject=[Subobject
[_loose=false, _subobjectType=IpPrefixCase
[_ipPrefix=IpPrefix
[_ipPrefix=IpPrefix
[_ipv4Prefix=Ipv4Prefix
[_value=196.20.160.41/32],
_value=[1, 9, 6, ., 2, 0, ., 1, 6, 0, ., 4, 1, /, 3, 2]],
augmentation=[]],
augmentation=[]],
augmentation=[]],
Subobject
[_loose=false, _subobjectType=IpPrefixCase
[_ipPrefix=IpPrefix
[_ipPrefix=IpPrefix
[_ipv4Prefix=Ipv4Prefix
[_value=200.20.160.43/32],
_value=[2, 0, 0, ., 2, 0, ., 1, 6, 0, ., 4, 3, /, 3, 2]],
augmentation=[]],
augmentation=[]],
augmentation=[]]],
augmentation=[]],
_endpointsObj=EndpointsObj
[_addressFamily=Ipv4Case
[_ipv4=Ipv4
[_sourceIpv4Address=Ipv4Address
[_value=39.39.39.39],
_destinationIpv4Address=Ipv4Address
[_value=43.43.43.43],
augmentation=[]],
augmentation=[]],
augmentation=[]],
augmentation=[Arguments2
[_lsp=Lsp
[_delegate=true, _administrative=true, augmentation=[]]]]],
_node=Uri
[_value=pcc://39.39.39.39],
_name=depoy-test-lsp, _networkTopologyRef=NetworkTopologyRef
[_value=KeyedInstanceIdentifier

{targetType=interface org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology, path=[org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology, org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology[key=TopologyKey [_topologyId=Uri [_value=pcep-topology]]]]}

],
augmentation=[]]

Comment by Tony Tkacik [ 26/Aug/14 ]

Testcase used for trying to reproduce this bug,
testcase should be present in project which has following dependencies:

org.opendaylight.controller:sal-restconf-broker
junit:junit
org.opendaylight.bgpcep:pcep-ietf-stateful07

Comment by Tony Tkacik [ 26/Aug/14 ]

Attachment SimplePutLspTest.java has been added with description: Test-case

Comment by Tony Tkacik [ 26/Aug/14 ]

Was unable to reproduce on master with attached test case. See testcase details
for how to integrate it into project.

This test-case which constructs same LSP as you pasted, I was able to add LSP and also read it back via sal-restconf-broker.

Attached test-case contains code for that, returned reported LSP was:

ReportedLsp [_name=simple-test-lsp, _path=[Path [_lspId=LspId [_value=2], _key=PathKey [_lspId=LspId [_value=2]], _metrics=[], _bandwidth=Bandwidth [_bandwidth=Float32 [_value=[0, 0, 0, 0]], _processingRule=false, _ignore=false, augmentation=[]], _lspa=Lspa [_tlvs=Tlvs [augmentation=[]], _holdPriority=7, _setupPriority=7, _localProtectionDesired=false, _includeAny=AttributeFilter [_value=0], _excludeAny=AttributeFilter [_value=0], _includeAll=AttributeFilter [_value=0], _processingRule=false, _ignore=false, augmentation=[]], _ero=Ero [_subobject=[Subobject [_loose=false, _subobjectType=IpPrefixCase [_ipPrefix=IpPrefix [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=196.20.160.41/32], _value=[1, 9, 6, ., 2, 0, ., 1, 6, 0, ., 4, 1, /, 3, 2]], augmentation=[]], augmentation=[]], augmentation=[]], Subobject [_loose=false, _subobjectType=IpPrefixCase [_ipPrefix=IpPrefix [_ipPrefix=IpPrefix [_ipv4Prefix=Ipv4Prefix [_value=200.20.160.43/32], _value=[2, 0, 0, ., 2, 0, ., 1, 6, 0, ., 4, 3, /, 3, 2]], augmentation=[]], augmentation=[]], augmentation=[]]], _processingRule=false, _ignore=false, augmentation=[]], augmentation=[Path1 [_lsp=Lsp [_tlvs=Tlvs [_lspIdentifiers=LspIdentifiers [_lspId=LspId [_value=2], _tunnelId=TunnelId [_value=3], _addressFamily=Ipv4Case [_ipv4=Ipv4 [_ipv4TunnelSenderAddress=Ipv4Address [_value=39.39.39.39], _ipv4ExtendedTunnelId=Ipv4Address [_value=43.43.43.43], _ipv4TunnelEndpointAddress=Ipv4Address [_value=43.43.43.43], augmentation=[]], augmentation=[]], augmentation=[]], _symbolicPathName=SymbolicPathName [_pathName=SymbolicPathName [_value=[115, 105, 109, 112, 108, 101, 45, 116, 101, 115, 116, 45, 108, 115, 112]], augmentation=[]], augmentation=[]], _plspId=PlspId [_value=4], _delegate=true, _sync=false, _remove=false, _administrative=true, _operational=Up, _processingRule=false, _ignore=false, augmentation=[Lsp1 [_create=true]]]]]]], _key=ReportedLspKey [_name=simple-test-lsp], augmentation=[]]

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