03-06-2017 11:59 PM
I'm a newbie to TREX. I was trying to connect remotely through the PYTHON APIs. I ended up with the below error. The TREX version used by me is V2.2.0. Could someone help me find out if I have the correct version installed ? Is the below error due to any incompatibility.
client - side logs:
============
>>> c = STLClient(username = "trex",server = "172.26.156.57", sync_port = 4507 ,verbose_level = LoggerApi.VERBOSE_HIGH)
>>> c.connect()
Connecting to RPC server on 172.26.156.57:4507
[SUCCESS]
[verbose] Sending Request To Server:
{
"id": "22khg28j",
"jsonrpc": "2.0",
"method": "api_sync",
"params": {
"api_vers": [
{
"major": 3,
"minor": 1,
"type": "core"
}
]
}
}
[verbose] Server Response:
{
"error": {
"code": -32601,
"message": "Method not found"
},
"id": "null",
"jsonrpc": "2.0"
}
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/auto/wskpoopath-rtp/pyats/examples/connection/prod/v2.20/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py", line 1171, in wrap2
ret = f(*args, **kwargs)
File "/auto/wskpoopath-rtp/pyats/examples/connection/prod/v2.20/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py", line 1720, in connect
raise STLError(rc)
trex_stl_lib.trex_stl_exceptions.STLError: Method not found
Server-side logs
=============
06-03-2017 18:42:14 Received Message: {"method": "api_sync", "id": "22khg28j", "jsonrpc": "2.0", "params": {"api_vers": [{"type": "core", "minor": 1, "major": 3}]}}
06-03-2017 18:42:14 ERROR -32601: Method not found
06-03-2017 18:42:14 Exception info: Traceback (most recent call last):
File "scapy_zmq_server.py", line 139, in activate
method,params,req_id = self.scapy_wrapper.parse_req_msg(message)
File "scapy_zmq_server.py", line 44, in parse_req_msg
raise MethodNotFound(req_id)
MethodNotFound: 22khg28j
06-03-2017 18:42:14 Sending Message: {"error": {"code": -32601, "message": "Method not found"}, "jsonrpc": "2.0", "id": "null"}
03-07-2017 12:04 AM
The port is not the right one. just remove it (default is 4501)
STLClient(username = "trex",server = "172.26.156.57", sync_port = 4507
Connecting to RPC server on csi-kiwi-02:4501
Connecting to publisher server on csi-kiwi-02:4500
Please ask question in our gmail forum.
Hanoh
03-07-2017 12:09 AM
Thans Hanoch.I still see the same problem.
trex@trex-dna-san1:~/trex/v2.20/automation/trex_control_plane/stl/services/scapy_server$ sudo /usr/bin/python3.5 scapy_zmq_server.py -s 4501 -v -l
[sudo] password for trex:
IGMPv3 is still under development - Nov 2010
06-03-2017 19:05:29 ***Scapy Server Started***
06-03-2017 19:05:29 Listening on port: 4501
06-03-2017 19:05:29 Server IP address: 172.26.156.57
06-03-2017 19:05:51 Received Message: {"method": "api_sync", "id": "1lxwyoox", "jsonrpc": "2.0", "params": {"api_vers": [{"type": "core", "minor": 1, "major": 3}]}}
06-03-2017 19:05:51 ERROR -32601: Method not found
06-03-2017 19:05:51 Exception info: Traceback (most recent call last):
File "scapy_zmq_server.py", line 139, in activate
method,params,req_id = self.scapy_wrapper.parse_req_msg(message)
File "scapy_zmq_server.py", line 44, in parse_req_msg
raise MethodNotFound(req_id)
MethodNotFound: 1lxwyoox
06-03-2017 19:05:51 Sending Message: {"error": {"code": -32601, "message": "Method not found"}, "jsonrpc": "2.0", "id": "null"}
I will post the same question on the gmail forum
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide