Open daghaian opened 7 months ago
Thanks for the feedback, investigating
I'm also seeing this issue is there any update on a fix?
Likewise, almost any attempt to move an interface to a namespace results in this error:
ndb.interfaces.create(ifname="veth0", kind="veth", target="test-ns").commit()
ndb.interfaces.create(ifname="veth0", kind="veth", net_ns_fd="test-ns").commit()
ndb.interfaces.create(ifname="veth0", kind="veth").set("target", "test-ns").commit()
ndb.interfaces.create(ifname="veth0", kind="veth").set("net_ns_fd", "test-ns").commit()
ndb.interfaces.create(ifname="veth0", kind="veth").commit()
with ndb.interfaces["veth0"] as dev:
dev["target"] = "test-ns"
All give the same error.
A quick bit of bisecting gives this working in pyroute2 0.7.6 but failing in 0.7.7.
And a git bisect
points to 8c6421b63a93b1eea8b9df29e76516107c099929 as the offending commit. For reference, the result was produced like this:
$ cat > test.py <<EOM
import pyroute2
try:
ndb = pyroute2.NDB()
ctx = ndb.begin()
ctx.push(
ns := ndb.netns.create("test-2"),
)
ctx.push(
eth0 := ndb.interfaces.create(ifname="eth0", kind="veth", peer="eth0-1").set("target", "test-2")
)
ctx.commit()
ctx = ndb.begin()
ctx.push(ns.remove())
ctx.commit()
except:
exit(10)
exit(0)
EOM
$ python3 -m venv venv/
$ venv/bin/pip install -e .
$ git bisect start HEAD 0.7.6
$ git bisect run sudo venv/bin/python3 test.py
Currently, when attempting the code below, the interface is moved into the network namespace but an exception is thrown
Do I need to register some messenger prior to making these calls? Any information would be appreciated. Thanks