faucetsdn / ryu

Ryu component-based software defined networking framework
https://ryu-sdn.org
Apache License 2.0
1.52k stars 1.16k forks source link

ovsdb events not firing. #157

Open raptdwar opened 3 years ago

raptdwar commented 3 years ago

I'm trying to use the qos_rest example in the repo. I cannot manage to create a queue because of this response:

[
    {
        "switch_id": "0000000c298b1415",
        "command_result": {
            "result": "failure",
            "details": "ovs_bridge is not exists"
        }
    }
]

By looking at the code i think there is a problem related to ovsdb I have already tried the simple switch example, without any problem, but the real issue for me is that the handlers for ovsdb related events are never fired.

One thing i know for sure is that it's not a connection problem, my switched can reach the controller/manager.

Using the example written here ( Link from the Ryu docs ), i can clearly see the connection in the log ( using ryu-manager --verbose ) but the following exception occour:

root@controller# ryu-manager test_ovsdb.py --verbose
loading app test_ovsdb.py
loading app ryu.services.protocols.ovsdb.manager
instantiating app test_ovsdb.py of MyApp
instantiating app ryu.services.protocols.ovsdb.manager of OVSDB
BRICK MyApp
  CONSUMES EventNewOVSDBConnection
BRICK OVSDB
  PROVIDES EventNewOVSDBConnection TO {'MyApp': set()}
  PROVIDES EventModifyRequest TO {'OVSDB': set()}
  PROVIDES EventReadRequest TO {'OVSDB': set()}
  CONSUMES EventModifyRequest
  CONSUMES EventReadRequest
Listening on 0.0.0.0:6640 for clients
New connection from 192.168.2.24:58662
hub: uncaught exception: Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/ryu/lib/hub.py", line 60, in _launch
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/ryu/services/protocols/ovsdb/manager.py", line 145, in _start_remote
    app = client.RemoteOvsdb.factory(sock, client_address,
  File "/usr/local/lib/python3.9/dist-packages/ryu/services/protocols/ovsdb/client.py", line 322, in factory
    session = jsonrpc.Session(fsm, connection)
TypeError: __init__() missing 1 required positional argument: 'remotes'
melkael commented 3 years ago

Hello, I have the same problem.

After checking, it seems that the problem comes from a change in the ovs api (in the class constructor of jsonrpc.session). This change occured in version 2.10.0 so you should use the most recent version before that until ryu is updated. This version is 2.9.4 which you can install with pip install ovs==2.9.4 until ryu fixes this bug

yousifalash commented 2 weeks ago

Hello, I have the same problem.

After checking, it seems that the problem comes from a change in the ovs api (in the class constructor of jsonrpc.session). This change occured in version 2.10.0 so you should use the most recent version before that until ryu is updated. This version is 2.9.4 which you can install with pip install ovs==2.9.4 until ryu fixes this bug

I LOVE YOU