NetSys / bess

BESS: Berkeley Extensible Software Switch
Other
313 stars 156 forks source link

`bessctl` runs error with `'module' object has no attribute 'BESSControlStub'` #857

Closed jiexray closed 6 years ago

jiexray commented 6 years ago

Hello,

I'm running bess with my Ubuntu (Linux localhost 4.13.0-16-generic #19-Ubuntu SMP Wed Oct 11 18:35:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux).

After compiling the src code successfully as follows:

xiarui@localhost:~/bess$ ./build.py
Building DPDK...
Generating protobuf codes for pybess...
Building BESS daemon...
Building BESS kernel module (4.13.0-16-generic - running kernel) ...
Done.

I start to run bess using:

cd bessctl/
./bessctl

However, I met something strange:

Type "help" for more information.
Traceback (most recent call last):
  File "./bessctl", line 186, in <module>
    main()
  File "./bessctl", line 170, in main
    run_cli()
  File "./bessctl", line 152, in run_cli
    s.connect()
  File "/home/xiarui/bess/bessctl/../pybess/bess.py", line 199, in connect
    self.stub = service_pb2.BESSControlStub(self.channel)
AttributeError: 'module' object has no attribute 'BESSControlStub'

I went to file bess/pybess/buildin_pb/service_pb2.py, there is exactly no class named BESSControlStub. In fact, I find class BESSControlStub in service_pb2_grpc.py. How can I fix this error.

Thank you for sharing your idea.

Best wishes.

sangjinhan commented 6 years ago

Thank you for reporting the issue. It seems that starting from some version of protobuf/grpc, Stub classes are now created in _pb2_grpc.py, not in _pb2.py any longer (after some deprecation period). I guess the error happened on your system as you are using a very recent version of protobuf/grpc. I created a patch at #861.

jiexray commented 6 years ago

Thank you for the update, the new merge has finished the bug reported in previous time.