<div dir="ltr">David, a small change was recently committed to the behavioral-model repository that should enable it to auto-detect whether you are running on Ubuntu 18.04 or later, vs. earlier, and install the correct version of the libssl-dev package accordingly.  From that source code, you should be able to build behavioral-model (perhaps after uninstalling libssl-dev) on an Ubuntu 18.04 system, and it should build with Thrift 0.9.2.<div><br></div><div>Andy</div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Sep 16, 2018 at 4:38 PM David Hancock <<a href="mailto:dhancock@cs.utah.edu">dhancock@cs.utah.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <p>Ah, thanks both!</p>
    <p>--David<br>
    </p>
    <br>
    <div class="m_4755432053665488918moz-cite-prefix">On 09/16/2018 07:14 PM, Vladimir
      Gurevich wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">Hello David,
        <div><br>
        </div>
        <div>Another option is to continue to use thrift-0.9.2. The only
          thing you need to do on Ubuntu-18.04 is to remove libssl-dev
          and replace it with libssl1.0-dev. That will allow you to
          compile thrift-0.9.2</div>
        <div><br>
        </div>
        <div>Happy hacking,</div>
        <div>Vladimir</div>
        <div><br clear="all">
          <div>
            <div dir="ltr" class="m_4755432053665488918gmail_signature" data-smartmail="gmail_signature">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div><font size="4"><b>Vladimir Gurevich</b></font></div>
                    <div><font size="4"><b><br>
                        </b></font></div>
                    <div><font size="4"><b>Barefoot Networks</b></font></div>
                    <div><b><font size="2">Technical Lead, Customer
                          Engineering</font></b></div>
                    <div><font size="2">Email: <a href="mailto:vag@barefootnetworks.com" target="_blank">vag@barefootnetworks.com</a></font></div>
                    <div><font size="2">Phone: (408) 833-4505</font></div>
                    <div><br>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <br>
        </div>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr">On Sun, Sep 16, 2018 at 3:43 PM Andy Fingerhut
          <<a href="mailto:andy.fingerhut@gmail.com" target="_blank">andy.fingerhut@gmail.com</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
          <div dir="ltr">
            <div dir="ltr">Thanks for the detailed reports, David.  I
              suspect you are an Ubuntu 18.04 + P4 tools "early adopter"
              and may be one of the first to investigate this deeply
              into these issues.
              <div><br>
              </div>
              <div>I had tried Thrift 0.11.0 on Ubuntu 18.04 as well,
                but did not try mininet, nor multiple physical devices
                each running their own bmv2 simple_switch connected by
                physical Ethernet ports.  There is an issue here
                suggesting perhaps updating Thrift to version 0.11.0 for
                behavioral-model, but I have added a comment to that
                issue linking to your message: <a href="https://github.com/p4lang/behavioral-model/issues/597" target="_blank">https://github.com/p4lang/behavioral-model/issues/597</a></div>
              <div><br>
              </div>
              <div>I believe one long term answer is that Thrift will
                become no-longer-used at some point, once the P4Runtime
                API using Google Protobufs instead of Thrift becomes
                more tested and used.</div>
              <div><br>
              </div>
              <div>That said, if someone does figure out a way to get
                existing Thrift-based APIs working on Ubuntu 18.04, that
                would be nice to have.</div>
              <div><br>
              </div>
              <div>Andy Fingerhut</div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr">On Sun, Sep 16, 2018 at 2:36 PM David Hancock
              <<a href="mailto:dhancock@cs.utah.edu" target="_blank">dhancock@cs.utah.edu</a>>
              wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have
              confirmed that Thrift 0.9.2 on Ubuntu 14.04 works in my
              environment.<br>
              <br>
              I was trying 0.11.0 on Ubuntu 18.04 because during
              installation of 0.9.2 <br>
              I got an error claiming libcrypto was missing, which is
              supposed to be <br>
              included with libssl-dev but installing libssl-dev didn't
              fix the <br>
              problem.  Googling reveals this is a known problem but I
              couldn't tell <br>
              what the best solution was of many suggested.<br>
              <br>
              Hence 0.11.0, which presented no errors during
              installation, but when I <br>
              call runtime_CLI.load_json_config eventually it ends up in
              Thrift's <br>
              recv_bm_get_config_md5() -> read(), which has that
              extra check on <br>
              sys.version_info triggering
              iprot.readString().decode('utf-8'), which <br>
              fails with UnicodeDecodeError.<br>
              <br>
              To me this seems like a bug with Thrift but I'm no Thrift
              expert.  <br>
              'iprot' in my case is of type <br>
              thrift.protocol.TBinaryProtocol.TBinaryProtocol.  I don't
              know what <br>
              message is being sent that starts with 0xed and I don't
              understand the <br>
              logic for why Thrift wants to decode it as utf-8.<br>
              <br>
              So I downgraded to Ubuntu 14.04 and Thrift 0.9.2 because
              that was my <br>
              setup when doing experiments in mininet.<br>
              <br>
              --David<br>
              <br>
              <br>
              On 09/16/2018 12:15 AM, David Hancock wrote:<br>
              > It appears the issue is with Thrift.  I am running
              version 0.11.0.  I <br>
              > traced the error to std_client.bm_get_config_md5()
              -> ... -> <br>
              > recv_bm_get_config_md5 -> ...; here's the full
              stack trace:<br>
              ><br>
              > bm_md5sum = std_client.bm_get_config_md5()<br>
              > Traceback (most recent call last):<br>
              >   File "<console>", line 1, in <module><br>
              >   File <br>
              >
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py",
              <br>
              > line 2864, in bm_get_config_md5<br>
              >     return self.recv_bm_get_config_md5()<br>
              >   File <br>
              >
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py",
              <br>
              > line 2882, in recv_bm_get_config_md5<br>
              >     result.read(iprot)<br>
              >   File <br>
              >
"/usr/local/lib/python2.7/dist-packages/bm_runtime/standard/Standard.py",
              <br>
              > line 14572, in read<br>
              >     self.success = iprot.readString().decode('utf-8')
              if <br>
              > sys.version_info[0] == 2 else iprot.readString()<br>
              >   File "/usr/lib/python2.7/encodings/utf_8.py", line
              16, in decode<br>
              >     return codecs.utf_8_decode(input, errors, True)<br>
              > UnicodeDecodeError: 'utf8' codec can't decode byte
              0xed in position 0: <br>
              > invalid continuation byte<br>
              ><br>
              > --David<br>
              ><br>
              ><br>
              > On 09/15/2018 09:23 PM, David Hancock wrote:<br>
              >> Hello,<br>
              >><br>
              >> I get "Error when requesting config md5 sum from
              switch" when executing:<br>
              >><br>
              >>
              runtime_CLI.load_json_config(<bm_runtime.standard.Standard.Client
              <br>
              >> object>, <JSON path>)<br>
              >><br>
              >> in my python-based controller that connects to a
              bmv2 simple_switch.  <br>
              >> I did not get this error in mininet experiments;
              I'm only getting it <br>
              >> now that I'm trying to experiment on a physical
              cluster.<br>
              >><br>
              >> Is there a common reason for that error?<br>
              >><br>
              >> Here is some of the code preceding the statement
              that results in the <br>
              >> error:<br>
              >><br>
              >>     ip = 'localhost'<br>
              >>     port = 9090<br>
              >><br>
              >>     services = <br>
              >>
runtime_CLI.RuntimeAPI.get_thrift_services(runtime_CLI.PreType.SimplePre)<br>
              >>    
              services.extend(SimpleSwitchAPI.get_thrift_services())<br>
              >><br>
              >>     try:<br>
              >>       std_client, mc_client, sswitch_client = <br>
              >> runtime_CLI.thrift_connect(ip, port, services)<br>
              >>     except:<br>
              >>         return "Error - create_device(" +
              dev_name + "): " + <br>
              >> str(sys.exc_info()[0])<br>
              >><br>
              >>     json = <path to JSON><br>
              >>     runtime_CLI.load_json_config(std_client,
              json)<br>
              >><br>
              >> I can break right before the load_json_config
              call and everything <br>
              >> looks in order - in particular,
              get_thrift_services and <br>
              >> thrift_connect executed successfully.<br>
              >><br>
              >> Thank you for any ideas you may have,<br>
              >><br>
              >> David<br>
              >><br>
              >><br>
              >> _______________________________________________<br>
              >> P4-dev mailing list<br>
              >> <a href="mailto:P4-dev@lists.p4.org" target="_blank">P4-dev@lists.p4.org</a><br>
              >> <a href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org" rel="noreferrer" target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
              ><br>
              ><br>
              > _______________________________________________<br>
              > P4-dev mailing list<br>
              > <a href="mailto:P4-dev@lists.p4.org" target="_blank">P4-dev@lists.p4.org</a><br>
              > <a href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org" rel="noreferrer" target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
              <br>
              <br>
              _______________________________________________<br>
              P4-dev mailing list<br>
              <a href="mailto:P4-dev@lists.p4.org" target="_blank">P4-dev@lists.p4.org</a><br>
              <a href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org" rel="noreferrer" target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
            </blockquote>
          </div>
          _______________________________________________<br>
          P4-dev mailing list<br>
          <a href="mailto:P4-dev@lists.p4.org" target="_blank">P4-dev@lists.p4.org</a><br>
          <a href="http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org" rel="noreferrer" target="_blank">http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org</a><br>
        </blockquote>
      </div>
    </blockquote>
    <br>
  </div>

</blockquote></div>