Runtime Error during commit operation.

15 views
Skip to first unread message

rishi narian

unread,
Feb 20, 2018, 8:47:37 PM2/20/18
to pyroute2-dev
Hi,

    I am trying to create different namespaces (e.g: namespace1, namespace2 etc..) using pyroute2 functionality.  
    Script is crashing during commit operation while adding veth interface of root namespace to bridge (br0).
    Sporadically run time error is seen. May i know what may be the causes for the run time errors during commit operation.

    Also, for every commit operation, it is required to give sleep time of 0.1, how to avoid this sleep time. Any suggestions.
 

Steps:
    • Create  namespaces.
    • Create  virtual ethernet device pairs for all namespaces.
    • Assign one side of the veth pair to the namespace.
    • Assign IP addresses to each side of the veth pair.
    • Set the default route for our namespace.
    • Attach the other side of the veth pair to a bridge.      >>  Crash is seen  sporadically while doing br.commit() operation.
    #issue 1
    ---------------
    if bridge_name is not None:
      br=iproot.interfaces.get(bridge_name)                 
      br.add_port(veth_interface)
      br.commit()  ------> CRASH
      time.sleep(0.1)  

    One more important thing: #issue 2

    interface_link.commit()
    time.sleep(0.1)                                    ----------------> For Every commit i need to give sleep time other wise it is crashing. 

    How to avoid this sleep time for every commit operation               


              ------------------------------------------------------
              Trace is showing as:
              br.commit()
              File "/usr/lib/python2.7/site-packages/pyroute2/ipdb/interface.py", in commit
              raise error
              RuntimeError


              Interface.py
              ------------------
                      # something went wrong: roll the transaction back
                          if commit_phase == 1:
                              if newif:
                                  drop = False
                              try:
                                  self.commit(transaction=init if newif else snapshot,
                                              commit_phase=2,
                                              commit_mask=commit_mask,
                                              newif=newif)
                              except Exception as i_e:
                                  debug['next_stage'] = i_e
                                  error = RuntimeError()

              Peter Saveliev

              unread,
              Feb 21, 2018, 5:25:49 AM2/21/18
              to rishi narian, pyroute2-dev
              Thanks for the report, I'm investigating the issue.

              --
              You received this message because you are subscribed to the Google Groups "pyroute2-dev" group.
              To unsubscribe from this group and stop receiving emails from it, send an email to pyroute2-dev+unsubscribe@googlegroups.com.
              For more options, visit https://groups.google.com/d/optout.

              Peter Saveliev

              unread,
              Mar 14, 2018, 9:59:03 AM3/14/18
              to rishi narian, pyroute2-dev
              Sorry for delays in answers, was a bit overloaded.

              So far I couldn't reproduce the issues — it just runs ok without errors.

              Could you please send me the kernel / python / pyroute2 versions and the hardware specs so I could try to reproduce the whole environment?

              If it will not help, we could run a debug session together.

              2018-02-21 2:47 GMT+01:00 rishi narian <rishi....@gmail.com>:
              Reply all
              Reply to author
              Forward
              0 new messages