p4lang / tutorials

P4 language tutorials
Apache License 2.0
1.33k stars 881 forks source link

../../utils/Makefile:35: recipe for target 'run' failed #500

Closed KY-guokuo closed 9 months ago

KY-guokuo commented 1 year ago

When I tried to make run on the tutorials/exercises/basic, I received the following error: mkdir -p build pcaps logs p4c-bm2-ss --p4v 16 --p4runtime-files build/basic.p4.p4info.txt -o build/basic.json basic.p4 sudo python ../../utils/run_exercise.py -t pod-topo/topology.json -j build/basic.json -b simple_switch_grpc Traceback (most recent call last): File "../../utils/run_exercise.py", line 33, in import p4runtime_lib.simple_controller File "/home/sinet/tutorials/utils/p4runtime_lib/simple_controller.py", line 22, in import bmv2 File "/home/sinet/tutorials/utils/p4runtime_lib/bmv2.py", line 15, in from switch import SwitchConnection File "/home/sinet/tutorials/utils/p4runtime_lib/switch.py", line 148, in class GrpcRequestLogger(grpc.UnaryUnaryClientInterceptor, AttributeError: 'module' object has no attribute 'UnaryUnaryClientInterceptor' ../../utils/Makefile:35: recipe for target 'run' failed make: *** [run] Error 1

is it the wrong version of the tutorials?

jafingerhut commented 1 year ago

There are a nearly unlimited number of ways to try to install the P4 development tools required for the tutorials to work.

Several ways that should lead to working results are described in this part of the README of this repository: https://github.com/p4lang/tutorials#obtaining-required-software

Did you try one of those?

rst0git commented 1 year ago

AttributeError: 'module' object has no attribute 'UnaryUnaryClientInterceptor'

@KY-guokuo It looks like the version of the grpcio Python module you have is too old. You can upgrade it with the following command.

sudo pip install --upgrade grpcio
huge0128 commented 1 year ago

Traceback (most recent call last): File "../../utils/run_exercise.py", line 383, in exercise.run_exercise() File "../../utils/run_exercise.py", line 193, in run_exercise self.create_network() File "../../utils/run_exercise.py", line 258, in create_network controller = None) File "build/bdist.linux-x86_64/egg/mininet/net.py", line 174, in init File "build/bdist.linux-x86_64/egg/mininet/net.py", line 502, in build File "build/bdist.linux-x86_64/egg/mininet/net.py", line 489, in buildFromTopo File "build/bdist.linux-x86_64/egg/mininet/net.py", line 400, in addLink File "build/bdist.linux-x86_64/egg/mininet/link.py", line 557, in init File "build/bdist.linux-x86_64/egg/mininet/link.py", line 451, in init File "build/bdist.linux-x86_64/egg/mininet/link.py", line 496, in makeIntfPair File "build/bdist.linux-x86_64/egg/mininet/util.py", line 267, in makeIntfPair Exception: Error creating interface pair (s1-eth5,s2-eth5): RTNETLINK answers: File exists

../../utils/Makefile:35: recipe for target 'run' failed make: *** [run] Error 1

it seems that the mininet do not work during the create_network process, but when i run 'sudo mn -c', it did not work

jafingerhut commented 1 year ago

I believe this "RTNETLINK answers: File exists" is a sign that something was left behind by an earlier mininet and/or simple_switch_grpc run, but I do not recall exactly what.

Recommendation: Try rebooting the system and trying again. That is likely to clear up whatever was left behind. There are almost certainly ways to clear up that leftover state without rebooting the system, but if rebooting the system also leaves the system in a state where it fails for this reason, then ask again and we can look more carefully.