cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
448
Views
0
Helpful
4
Replies

Port forward broken in Radkit client 1.6.11

Wayne Knight
Level 1
Level 1

I have just upgraded from 1.5.12 to 1.6.11 and noticed the port forwarding is now broken. I have tried using the network console as well as the client. The client provides these errors, but not very meaningful to troubleshoot myself.

I have reverted back to 1.5.12 and port forward works, just doesnt seem to work in 1.6.11

The commands used in the client was below, but seemed to be accepted, it was only when i tried to browse to https://127.0.0.1:4443 then i got the errors below
dnac = service.inventory['dnac']
port_forwarder2 = dnac.forward_tcp_port(local_port=4443, destination_port=443)


10:55:40.777Z ERROR | connection closed due to unhandled exception [uuid=UUID('045a061f-b0a6-4a39-aa9d-4b53325f7fd6') endpoint='dnac:443' err='''
Traceback (most recent call last):
File "<frozen radkit_client.async_.port_forwarding.base>", line 245, in handle
File "<frozen radkit_client.async_.port_forwarding.tcp>", line 174, in _handle_connection
File "<frozen radkit_client.async_.port_forwarding.base>", line 409, in _bridge_connections
File "<path_to_radkit>\python\Lib\contextlib.py", line 211, in __aexit__
await anext(self.gen)
File "<frozen radkit_common.utils.asyncio_>", line 61, in create_task_group
File "<path_to_radkit>\python\Lib\site-packages\exceptiongroup\_catch.py", line 39, in __exit__
raise unhandled from exc.__cause__
File "<path_to_radkit>\python\Lib\site-packages\exceptiongroup\_catch.py", line 65, in handle_exception
result = handler(matched)
^^^^^^^^^^^^^^^^
File "<frozen radkit_common.utils.asyncio_>", line 58, in handler
File "<frozen radkit_client.async_.port_forwarding.base>", line 386, in port_to_request
File "<frozen radkit_client.async_.terminal.streams>", line 88, in write
TypeError: Expecting bytes
''']

4 Replies 4

mboumeaz
Cisco Employee
Cisco Employee

Hi @Wayne Knight 

I don't see any reason why port forwarding is working for you on an old version but not on 1.6.11.

can you share the output of the following cmd on Radkit client :

1- the value of the variable : dnac   #where you store the output of this cmd service.inventory['dnac']

2- port_forwarder2.port_forwards

3- port_forwarder2.connections

thank you in advance !

 

 

 

 

 

>>> dnac
AsyncDevice(name='dnac', service_display_name='dnac', host='x.x.64.2', device_type='CiscoDNACenter', forwarded_tcp_ports='443', failed=False)
Object parameters
-------------------- -------------------
identity <redacted>
serial None
name dnac
service_display_name dnac
-------------------- -------------------
Internal attributes
key value
------------------- --------------
description
device_type CiscoDNACenter
forwarded_tcp_ports 443
host x.x.64.2
http_config True
netconf_config False
snmp_config False
swagger_config False
terminal_config False
External attributes
APIs
------- -------
Netconf UNKNOWN
Swagger UNKNOWN
------- -------

>>> port_forwarder2.port_forwards
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'TCPPortForwarder' object has no attribute 'port_forwards'

>>> dnac.port_forwards
<radkit_client.sync.state.TCPPortForwardsDict object at 0x167a0b8b690>
Port forwards for device: dnac
key status serial device_name local_port dynamic_local_ports destination_port #active #failed #closed #total
bytes up bytes down exception
----- -------- -------- ------------- ------------ --------------------- ------------------ --------- --------- --------- --------
---------- ------------ -----------
0 RUNNING None dnac 4443 N/A 443 0 0 0 0
0 0 None


>>> port_forwarder2.connections
<radkit_client.sync.port_forwarding.Connections object at 0x167a2875310>
Tunneled connections made at localhost:4443 to dnac:443:

###### Tried connecting and got the same traceback as per original post #######

>>> dnac.port_forwards
<radkit_client.sync.state.TCPPortForwardsDict object at 0x167a3d29c50>
Port forwards for device: dnac
key status serial device_name local_port dynamic_local_ports destination_port #active #failed #closed #total bytes up bytes down exceptio
n
----- -------- -------- ------------- ------------ --------------------- ------------------ --------- --------- --------- -------- ---------- ------------ --------
---
0 RUNNING None dnac 4443 N/A 443 0 14 0 14 14336 0 None

>>> port_forwarder2.connections
<radkit_client.sync.port_forwarding.Connections object at 0x167a3481b50>
Tunneled connections made at localhost:4443 to dnac:443:
key uuid endpoint status opened closed exception
----- ------------------------------------ ---------- -------- -------------------------- -------------------------- ---------------
0 6b14b50e-913f-4a06-bf74-f548f647fda4 dnac:443 FAILED 2024-07-26 15:35:08.006081 2024-07-26 15:35:08.052411 Expecting bytes
1 5fa26015-4377-4d3c-a131-66e09fae59b6 dnac:443 FAILED 2024-07-26 15:35:08.054938 2024-07-26 15:35:08.068781 Expecting bytes
2 30569183-d745-4007-a419-6009bb480485 dnac:443 FAILED 2024-07-26 15:35:08.064404 2024-07-26 15:35:08.082419 Expecting bytes
3 68cd02bd-ffc9-43cf-84c3-d81d799fec04 dnac:443 FAILED 2024-07-26 15:35:08.084916 2024-07-26 15:35:08.106993 Expecting bytes
4 121e53c3-d90e-497e-a4be-83f3f492cc6d dnac:443 FAILED 2024-07-26 15:35:09.236742 2024-07-26 15:35:09.251499 Expecting bytes
5 ca812146-5097-48c7-b8e2-cc2164409158 dnac:443 FAILED 2024-07-26 15:35:09.253533 2024-07-26 15:35:09.262677 Expecting bytes
6 3cdf1e79-f049-469e-a0f9-3c24258236da dnac:443 FAILED 2024-07-26 15:35:09.276698 2024-07-26 15:35:09.289432 Expecting bytes
7 aa02fb3e-2763-46c2-b558-d66baf277e90 dnac:443 FAILED 2024-07-26 15:35:09.282697 2024-07-26 15:35:09.291457 Expecting bytes
8 59d75a90-4d87-47b9-9787-28564411f648 dnac:443 FAILED 2024-07-26 15:35:09.294201 2024-07-26 15:35:09.303031 Expecting bytes
9 39d3bb22-4680-4847-9cec-c6a951ebfd3a dnac:443 FAILED 2024-07-26 15:35:09.301178 2024-07-26 15:35:09.309606 Expecting bytes
10 14d7e81f-60f2-439f-b8a0-b4923f84bb68 dnac:443 FAILED 2024-07-26 15:35:14.311792 2024-07-26 15:35:14.319970 Expecting bytes
11 0208e50d-1a4d-44e0-8e83-147ff9d4fa2f dnac:443 FAILED 2024-07-26 15:35:14.322009 2024-07-26 15:35:14.337075 Expecting bytes
12 42a3992f-71be-42d7-ac66-539235416266 dnac:443 FAILED 2024-07-26 15:35:14.339022 2024-07-26 15:35:14.358718 Expecting bytes
13 6117a031-3cd8-4403-b8e0-3de179669af5 dnac:443 FAILED 2024-07-26 15:35:14.361464 2024-07-26 15:35:14.375881 Expecting bytes

Wayne Knight
Level 1
Level 1

@mboumeaz Does the above output help?

Dear @Wayne Knight ,

 

Kindly notice that we are aware of this bug, please hold for RADKit 1.7 which will be released soon and test on it, we believe it should address this issue.

 

Best Regards,

Rana