[OPNFLWPLUG-18] Pre-configuration of flows causes exception Created: 11/Jan/14  Updated: 27/Sep/21  Resolved: 18/Aug/14

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Jan Medved Assignee: Vaclav Demcak
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac OS
Platform: Macintosh


Issue Links:
Blocks
blocks OPNFLWPLUG-115 Milestone: Implement proper runtime b... Resolved
External issue ID: 282
Priority: Normal

 Description   

When trying to add a flow to a node which is not connected (i.e. trying to pre-configure a node), the following exception is thrown:

<html>
<head>
<title>Apache Tomcat/7.0.32 - Error report</title>
<style>
<!--H1

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}

H2

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}

H3

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}

BODY

{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}

B

{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}

P

{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}

A

{color : black;}

A.name

{color : black;}

HR

{color : #525D76;}

-->
</style>
</head>
<body>
<h1>HTTP Status 500 - Internal Server Error</h1>
<HR size="1" noshade="noshade">
<p>
<b>type</b> Status report
</p>
<p>
<b>message</b>
<u>Internal Server Error</u>
</p>
<p>
<b>description</b>
<u>The server encountered an internal error that prevented it from fulfilling this request.</u>
</p>
<HR size="1" noshade="noshade">
<h3>Apache Tomcat/7.0.32</h3>
</body>
</html>

Use, for example:

PUT http://192.168.4.1:8080/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/2/flow/135

Accept: application/xml
Content-type: application/xml

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<flow xmlns="urn:opendaylight:flow:inventory">
<strict>false</strict>
<flow-name>FooXf20</flow-name>
<id>135</id>
<cookie_mask>255</cookie_mask>
<cookie>20</cookie>
<table_id>2</table_id>
<priority>2</priority>
<hard-timeout>1200</hard-timeout>
<idle-timeout>3400</idle-timeout>
<installHw>false</installHw>
<instructions>
<instruction>
<order>0</order>
<apply-actions>
<action>
<order>0</order>
<dec-nw-ttl/>
</action>
</apply-actions>
</instruction>
</instructions>
<match>
<metadata>
<metadata>12345</metadata>
</metadata>
</match>
</flow>



 Comments   
Comment by Martin Sunal [ 14/Jan/14 ]

RESTCONF returns status code 500 because transaction status is FAILED. Restconf has not information why transaction was failed. Bug is moved to mdsal

This is log of exception from console:

2014-01-14 16:18:56.528 CET [pool-23-thread-2] INFO o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: BA-2 Started.
2014-01-14 16:18:56.538 CET [pool-23-thread-2] ERROR o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: BA-2 Finish Commit failed
java.lang.IllegalStateException: No routable provider is processing routed message for InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.open
daylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:1]]]]]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$Router.addFlow(SalFlowService$$Broker$Router.java) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$DirectProxy.addFlow(SalFlowService$$Broker$DirectProxy.java) ~[na:na]
at org.opendaylight.controller.frm.flow.FlowTransaction.add(FlowTransaction.java:101) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.callRpcs(AbstractTransaction.java:56) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.finish(AbstractTransaction.java:28) ~[na:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:94) [bundlefile:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:31) [bundlefile:na]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
2014-01-14 16:18:56.553 CET [pool-22-thread-2] ERROR o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: DOM-1 Finish Commit failed
java.lang.IllegalStateException:
at org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector$DomToBindingTransaction.finish(BindingIndependentConnector.java:326) ~[na:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:94) [bundlefile:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:31) [bundlefile:na]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) ~[na:1.7.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) ~[na:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) ~[na:1.7.0_25]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) ~[na:1.7.0_25]
at java.lang.Thread.run(Thread.java:724) ~[na:1.7.0_25]
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: No routable provider is processing routed message for InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:1]]]]]
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:252) ~[na:1.7.0_25]
at java.util.concurrent.FutureTask.get(FutureTask.java:111) ~[na:1.7.0_25]
at org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector$DomToBindingTransaction.finish(BindingIndependentConnector.java:321) ~[na:na]
... 7 common frames omitted
Caused by: java.lang.IllegalStateException: No routable provider is processing routed message for InstanceIdentifier [path=[org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes, org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node[key=NodeKey [_id=Uri [_value=openflow:1]]]]]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$Router.removeFlow(SalFlowService$$Broker$Router.java) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$DirectProxy.removeFlow(SalFlowService$$Broker$DirectProxy.java) ~[na:na]
at org.opendaylight.controller.frm.flow.FlowTransaction.remove(FlowTransaction.java:53) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.rollbackRpcs(AbstractTransaction.java:96) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.rollback(AbstractTransaction.java:38) ~[na:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.rollback(TwoPhaseCommit.java:147) [bundlefile:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:104) [bundlefile:na]
... 6 common frames omitted

Comment by Tony Tkacik [ 24/Jan/14 ]

This functionality is in the scope of new FRM, not MD-SAL.

Comment by Abhijit Kumbhare [ 30/Jan/14 ]

Should be fixed when "mark and sweep" gets implemented.

Comment by Basheeruddin Ahmed [ 26/Mar/14 ]

Per last meeting we wanted to see if this is still an issue.

Conclusion:
Seems still an issue-- when tried configuring flow without any switch connected get the following exception


014-03-26 15:12:16.311 PDT [md-sal-binding-commit-0] ERROR o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: BA-171 Finish Commit failed
java.lang.IllegalArgumentException: Session for the cookie is invalid. Reason: the switch has been recently disconnected OR inventory provides outdated information.
at org.opendaylight.openflowplugin.openflow.md.core.session.MessageDispatchServiceImpl.getConnectionAdapter(MessageDispatchServiceImpl.java:92) ~[na:na]
at org.opendaylight.openflowplugin.openflow.md.core.session.MessageDispatchServiceImpl.flowMod(MessageDispatchServiceImpl.java:124) ~[na:na]
at org.opendaylight.openflowplugin.openflow.md.core.sal.ModelDrivenSwitchImpl.addFlow(ModelDrivenSwitchImpl.java:242) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$Router.addFlow(SalFlowService$$Broker$Router.java) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$DirectProxy.addFlow(SalFlowService$$Broker$DirectProxy.java) ~[na:na]
at org.opendaylight.controller.frm.flow.FlowTransaction.add(FlowTransaction.java:121) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.callRpcs(AbstractTransaction.java:63) ~[na:na]
at org.opendaylight.controller.frm.AbstractTransaction.finish(AbstractTransaction.java:35) ~[na:na]
at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:110) [bundlefile:na]
at
-----------------------

Doesn't the ability to support pre-configured flows require the ability to support pre-configure Node – didn't find any API that helps in doing the same.

Comment by Moiz Raja [ 26/Mar/14 ]

Basheer,

I believe in this case adding a node is not required and also it would be wrong to add a node I believe because it is operational data which should not be set by a client (It is ok for it to be set by the controller code but not the client that is the distinction in my mind).

I think the proper way to handle this may be to not add the flow to the open flow plugin when the node is not present in the operational data when addFow is called. Then in the onNodeAdded listener in FRM you must check if flows exist for that node in the configuration and if they do then you must add those flows to the openflowplugin.

Other folks can chime in on this if my assessment is incorrect.

Comment by Michal Rehak [ 27/Mar/14 ]

Hi,
this is more of enhancement than bug. Currently transaction is used in order to write stuff into config context of dataStorage. Then md-sal invokes twoPhaseCommit which involves transaction handlers and here we have FRM.

Here is a simple scenario of preconfiguration functionality:

  • if FRM finds out there is no corresponding node in operational context, it can still add the flow to config (there might be added "force" flag to addFlow model to better controll that), but application/user should get notified of that
  • NodeUpdated notification later will invoke FRM to check preconfigured stuff and push it to announced device
Comment by Anil Vishnoi [ 27/Mar/14 ]

Wanted to understand the use case here. We are trying to configure the node which is not yet connected to the controller. So how user actually will determine the flow construct without knowing the switch details? Can you please share the use case for doing this?

Comment by Abhijit Kumbhare [ 22/May/14 ]

Michal thinks this should be partially working now.

Comment by Abhijit Kumbhare [ 22/May/14 ]

Michal thinks this should be partially working now.

Comment by Vaclav Demcak [ 20/Jun/14 ]

java.lang.IllegalStateException: Address not found for route [RouteIdentifierImpl{context=null, type=(urn:opendaylight:flow:service?revision=2013-08-19)add-flow, route=(urn:opendaylight:inventory?revision=2013-08-19)nodes/(urn:opendaylight:inventory?revision=2013-08-19)node[

{(urn:opendaylight:inventory?revision=2013-08-19)id=openflow:1}

]}]
at com.google.common.base.Preconditions.checkState(Preconditions.java:176) ~[na:na]
at org.opendaylight.controller.sal.connector.remoterpc.ClientImpl.lookupRemoteAddressForRpc(ClientImpl.java:211) ~[na:na]
at org.opendaylight.controller.sal.connector.remoterpc.ClientImpl.invokeRpc(ClientImpl.java:126) ~[na:na]
at org.opendaylight.controller.sal.connector.remoterpc.RemoteRpcProvider.invokeRpc(RemoteRpcProvider.java:107) ~[na:na]
at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker.invokeRpc(SchemaAwareRpcBroker.java:244) ~[na:na]
at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker$RoutedRpcSelector.invokeRpc(SchemaAwareRpcBroker.java:342) ~[na:na]
at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareRpcBroker.invokeRpc(SchemaAwareRpcBroker.java:168) ~[na:na]
at org.opendaylight.controller.sal.dom.broker.osgi.RpcProvisionRegistryProxy.invokeRpc(RpcProvisionRegistryProxy.java:67) ~[na:na]
at org.opendaylight.controller.sal.binding.impl.connect.dom.RpcInvocationStrategy.forwardToDomBroker(RpcInvocationStrategy.java:121) ~[na:na]
at org.opendaylight.controller.sal.binding.impl.connect.dom.BindingIndependentConnector$DomToBindingRpcForwarder.invoke(BindingIndependentConnector.java:665) ~[na:na]
at com.sun.proxy.$Proxy97.addFlow(Unknown Source) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$Router.addFlow(SalFlowService$$Broker$Router.java) ~[na:na]
at org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService$$Broker$DirectProxy.addFlow(SalFlowService$$Broker$DirectProxy.java) ~[na:na]
at org.opendaylight.controller.frm.flow.FlowChangeListener.add(FlowChangeListener.java:116) ~[na:na]
at org.opendaylight.controller.frm.AbstractChangeListener.onDataChanged(AbstractChangeListener.java:51) ~[na:na]
at org.opendaylight.controller.md.sal.binding.impl.ForwardedBackwardsCompatibleDataBroker$BackwardsCompatibleConfigurationDataChangeInvoker.onDataChanged(ForwardedBackwardsCompatibleDataBroker.java:458) ~[na:na]
at org.opendaylight.controller.md.sal.binding.impl.AbstractForwardedDataBroker$TranslatingDataChangeInvoker.onDataChanged(AbstractForwardedDataBroker.java:158) ~[na:na]
at org.opendaylight.controller.md.sal.dom.store.impl.ChangeListenerNotifyTask.run(ChangeListenerNotifyTask.java:33) ~[na:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]

Comment by Vaclav Demcak [ 20/Jun/14 ]

https://git.opendaylight.org/gerrit/#/c/8174/
https://git.opendaylight.org/gerrit/#/c/8175/

https://wiki.opendaylight.org/view/OpenDaylight_OpenFlow_Plugin:Backlog:Node_Status_Reconciliation#Prepared_Status

Comment by Abhijit Kumbhare [ 12/Aug/14 ]

About Vaclav's last comments:

So why is this not merged yet (controller)? What's the status of the merges? The OF plugin gerrit seems to be abandoned as no longer needed. Is the fix no god?

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