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

David Hancock dhancock at cs.utah.edu
Sun Sep 16 17:36:08 EDT 2018


I have confirmed that Thrift 0.9.2 on Ubuntu 14.04 works in my environment.

I was trying 0.11.0 on Ubuntu 18.04 because during installation of 0.9.2 
I got an error claiming libcrypto was missing, which is supposed to be 
included with libssl-dev but installing libssl-dev didn't fix the 
problem.  Googling reveals this is a known problem but I couldn't tell 
what the best solution was of many suggested.

Hence 0.11.0, which presented no errors during installation, but when I 
call runtime_CLI.load_json_config eventually it ends up in Thrift's 
recv_bm_get_config_md5() -> read(), which has that extra check on 
sys.version_info triggering iprot.readString().decode('utf-8'), which 
fails with UnicodeDecodeError.

To me this seems like a bug with Thrift but I'm no Thrift expert.  
'iprot' in my case is of type 
thrift.protocol.TBinaryProtocol.TBinaryProtocol.  I don't know what 
message is being sent that starts with 0xed and I don't understand the 
logic for why Thrift wants to decode it as utf-8.

So I downgraded to Ubuntu 14.04 and Thrift 0.9.2 because that was my 
setup when doing experiments in mininet.

--David


On 09/16/2018 12:15 AM, David Hancock wrote:
> 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
>
>
> _______________________________________________
> 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