[P4-dev] [p4-factory]Error While running simple router - number of arguments are not correct

Mahesh Dananjaya dananjayamahesh at gmail.com
Mon Sep 5 03:09:01 EDT 2016


Hi antonin,
Should we send a PR request for above issue. It is not fixed yet right.Let
us know.thank you.
regards,
Mahesh

On Fri, Sep 2, 2016 at 11:11 PM, Mahesh Dananjaya <dananjayamahesh at gmail.com
> wrote:

> Hi antonio,
> Bvm2 is working fine and we are using bvm2 cli.thank you.
> Regards,
> Mahesh
>
> On Sep 2, 2016 10:36 PM, "Antonin Bas" <antonin at barefootnetworks.com>
> wrote:
>
>> Hi Mahesh,
>>
>> Thanks for pointing this out. The client_init() parameter list was
>> changed recently and we forgot to update some files. I just opened a pull
>> request to remedy this (https://github.com/p4lang/p4factory/pull/156).
>> Note that when running bmv2, we recommend using the bmv2 CLI (
>> https://github.com/p4lang/behavioral-model#using-the-cli-
>> to-populate-tables), rather than the PD CLI which is in p4factory.
>>
>> Best,
>>
>> Antonin
>>
>> On Thu, Sep 1, 2016 at 10:40 PM, Mahesh Dananjaya <
>> dananjayamahesh at gmail.com> wrote:
>>
>>> Hi guys,
>>> we got small error while running /p4factory/targets/simple_route.
>>> following the same steps as p4factory README file, we used
>>>
>>> ./run_add_demo_entries.bash.
>>>
>>> Then the following error appeared.
>>>
>>>
>>>
>>> File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>> Traceback (most recent call last):
>>>
>>>  File "../../cli/pd_cli.py", line 677, in <module>
>>>
>>>     main(sys.argv[1:])
>>>
>>>  File "../../cli/pd_cli.py", line 665, in main
>>>
>>>     pd_cli = PdCli(p4_name, thrift_client_module, thrift_server, port)
>>>
>>>  File "../../cli/pd_cli.py", line 35, in __init__
>>>
>>>     self._thrift_client = pd_thrift_client.ThriftClient(self._module,
>>> thrift_server, port, self._p4_name)
>>>
>>>  File "/home/san/p4/p4factory/cli/pd_thrift_client.py", line 56, in
>>> __init__
>>>
>>>     self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> TypeError: client_init() takes exactly 1 argument (2 given)
>>>
>>>
>>> ------------------------------------------------------------
>>> -------------------------------------
>>>
>>> Then we fix that issue by changing the
>>> /p4factory/cli/pd_thrift_client.py", line 56
>>>
>>> from,
>>> self._session_handle = self._conn_mgr.client_init(16)
>>>
>>> to,
>>> self._session_handle = self._conn_mgr.client_init()
>>>
>>>
>>> Now the error is not there all out p4s are running perfectly. even bvm2
>>> programs.My question is,
>>>
>>>
>>> Is this the correct way to do this or did we miss something.?
>>>
>>>
>>> regards,
>>>
>>> Mahesh.
>>>
>>> _______________________________________________
>>> P4-dev mailing list
>>> P4-dev at lists.p4.org
>>> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
>>>
>>
>>
>>
>> --
>> Antonin
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20160905/39f58b74/attachment-0002.html>


More information about the P4-dev mailing list