[P4-dev] bmv2: "Error when requesting config md5 sum from switch"

David Hancock dhancock at cs.utah.edu
Sun Sep 16 00:15:42 EDT 2018


It appears the issue is with Thrift.  I am running version 0.11.0.  I 
traced the error to std_client.bm_get_config_md5() -> ... -> 
recv_bm_get_config_md5 -> ...; here's the full stack trace:

bm_md5sum = std_client.bm_get_config_md5()
Traceback (most recent call last):
   File "<console>", line 1, in <module>
   File 
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py", 
line 2864, in bm_get_config_md5
     return self.recv_bm_get_config_md5()
   File 
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py", 
line 2882, in recv_bm_get_config_md5
     result.read(iprot)
   File 
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py", 
line 14572, in read
     self.success = iprot.readString().decode('utf-8') if 
sys.version_info[0] == 2 else iprot.readString()
   File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
     return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xed in position 0: 
invalid continuation byte

--David


On 09/15/2018 09:23 PM, David Hancock wrote:
> Hello,
>
> I get "Error when requesting config md5 sum from switch" when executing:
>
> runtime_CLI.load_json_config(<bm_runtime.standard.Standard.Client 
> object>, <JSON path>)
>
> in my python-based controller that connects to a bmv2 simple_switch.  
> I did not get this error in mininet experiments; I'm only getting it 
> now that I'm trying to experiment on a physical cluster.
>
> Is there a common reason for that error?
>
> Here is some of the code preceding the statement that results in the 
> error:
>
>     ip = 'localhost'
>     port = 9090
>
>     services = 
> runtime_CLI.RuntimeAPI.get_thrift_services(runtime_CLI.PreType.SimplePre)
>     services.extend(SimpleSwitchAPI.get_thrift_services())
>
>     try:
>       std_client, mc_client, sswitch_client = 
> runtime_CLI.thrift_connect(ip, port, services)
>     except:
>         return "Error - create_device(" + dev_name + "): " + 
> str(sys.exc_info()[0])
>
>     json = <path to JSON>
>     runtime_CLI.load_json_config(std_client, json)
>
> I can break right before the load_json_config call and everything 
> looks in order - in particular, get_thrift_services and thrift_connect 
> executed successfully.
>
> Thank you for any ideas you may have,
>
> David
>
>
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org




More information about the P4-dev mailing list