Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'MininetLogger' object has no attribute 'ch' #43

Open
trailll opened this issue Sep 27, 2022 · 7 comments
Open

'MininetLogger' object has no attribute 'ch' #43

trailll opened this issue Sep 27, 2022 · 7 comments

Comments

@trailll
Copy link

trailll commented Sep 27, 2022

hello,I install p4-utils and run it in p4-learning,but error occur,here is image ,can you help me?thanks
wcc@ubuntu:/p4/p4-learning/exercises/01-Reflector$ p4run
Traceback (most recent call last):
File "/usr/local/bin/p4run", line 11, in
load_entry_point('p4utils', 'console_scripts', 'p4run')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 480, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2693, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2324, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2330, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/home/wcc/p4/p4-utils/p4utils/p4run.py", line 33, in
from p4utils.utils.helper import *
File "/home/wcc/p4/p4-utils/p4utils/utils/helper.py", line 21, in
from p4utils.mininetlib.log import info, output, error, warning, debug
File "/home/wcc/p4/p4-utils/p4utils/mininetlib/log.py", line 92, in
lg.ch.setFormatter( formatter )
AttributeError: 'MininetLogger' object has no attribute 'ch'
wcc@ubuntu:
/p4/p4-learning/exercises/01-Reflector$

@edgar-costa
Copy link
Collaborator

edgar-costa commented Sep 27, 2022

The ch attribute to lg was added in this commit mininet/mininet@2255bc7

I believe your problem is that you have an old version of mininet, try to update it.

PS: can you remove the text crossing, was hard to read.

@trailll
Copy link
Author

trailll commented Sep 27, 2022

The ch attribute to lg was added in this commit mininet/mininet@2255bc7

I believe your problem is that you have an old version of mininet, try to update it.

PS: can you remove the text crossing, was hard to read.

I have slove the problem after I update my mininet from 2.3.0d6 to 2.3.1b1m,but when I try exercise at tutorials,make run faild,it work normal when the version of mininet is 2.3.0d6

wcc@ubuntu:/p4/tutorials/exercises/basic$ make run
mkdir -p build pcaps logs
p4c-bm2-ss --p4v 16 --p4runtime-files build/basic.p4.p4info.txt -o build/basic.json basic.p4
sudo python3 ../../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 28, in
import p4runtime_lib.simple_controller
File "/home/wcc/p4/tutorials/utils/p4runtime_lib/simple_controller.py", line 24, in
from . import bmv2, helper
File "/home/wcc/p4/tutorials/utils/p4runtime_lib/bmv2.py", line 17, in
from .switch import SwitchConnection
File "/home/wcc/p4/tutorials/utils/p4runtime_lib/switch.py", line 21, in
from p4.v1 import p4runtime_pb2, p4runtime_pb2_grpc
File "/usr/local/lib/python3.6/dist-packages/p4/v1/p4runtime_pb2.py", line 17, in
from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2
File "/usr/local/lib/python3.6/dist-packages/google/rpc/status_pb2.py", line 39, in
_STATUS = DESCRIPTOR.message_types_by_name["Status"]
AttributeError: 'NoneType' object has no attribute 'message_types_by_name'
../../utils/Makefile:35: recipe for target 'run' failed
make: *** [run] Error 1
wcc@ubuntu:
/p4/tutorials/exercises/basic$ mn --version
ps: I don't know why there have so many text crossing...

@edgar-costa
Copy link
Collaborator

edgar-costa commented Sep 27, 2022

How did you install all the other things? Can you try with the p4-utils VM? It is a qcow2 image, but you can translate it to OVA for VirtualBox.

@trailll
Copy link
Author

trailll commented Sep 27, 2022

How did you install all the other things? Can you try with the p4-utils VM?

I uninstall the old version and install the new version from source,and p4run can work at p4-learning

@edgar-costa
Copy link
Collaborator

By tutorials, you mean, p4lang tutorials? How is that related to p4-learning and mininet version. There seems to be a problem with p4runtime and the tutorials. Which VM are you using? Our VM or the one from there.

@trailll
Copy link
Author

trailll commented Sep 27, 2022

By tutorials, you mean, p4lang tutorials? How is that related to p4-learning and mininet version. There seems to be a problem with p4runtime and the tutorials. Which VM are you using? Our VM or the one from there.

yeah,it's p4lang turtorials,it can work normal before I uninstall mininet 2.3.0d6,but faild though I install 2.3.1b1

@kpapd
Copy link

kpapd commented Dec 20, 2022

I've run into the same issue. It seems that p4-utils break the p4lang/tutorials installation and even uninstalling doesn't seem to bring things back! Is there a way to revert this? You may want to mention that to installation instructions of p4-utlis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants