ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.59k stars 1.31k forks source link

hp_comware H3C device will give 'Timed-out reading channel, data not available.'; only for RBM devices, others are normal #2776

Closed leojianli closed 9 months ago

leojianli commented 2 years ago

DEBUG:paramiko.transport:starting thread (client mode): 0xabb24688 DEBUG:paramiko.transport:Local version/idstring: SSH-2.0-paramiko_2.9.2 DEBUG:paramiko.transport:Remote version/idstring: SSH-2.0-Comware-7.1.064 INFO:paramiko.transport:Connected (version 2.0, client Comware-7.1.064) DEBUG:paramiko.transport:=== Key exchange possibilities === DEBUG:paramiko.transport:kex algos: ecdh-sha2-nistp256, ecdh-sha2-nistp384, diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1, diffie-hellman-group1-sha1 DEBUG:paramiko.transport:server key: ssh-rsa DEBUG:paramiko.transport:client encrypt: aes128-ctr, aes192-ctr, aes256-ctr, AEAD_AES_128_GCM, AEAD_AES_256_GCM, aes128-cbc, 3des-cbc, aes256-cbc, des-cbc DEBUG:paramiko.transport:server encrypt: aes128-ctr, aes192-ctr, aes256-ctr, AEAD_AES_128_GCM, AEAD_AES_256_GCM, aes128-cbc, 3des-cbc, aes256-cbc, des-cbc DEBUG:paramiko.transport:client mac: hmac-sha2-256, hmac-sha2-512, hmac-sha1, hmac-md5, hmac-sha1-96, hmac-md5-96 DEBUG:paramiko.transport:server mac: hmac-sha2-256, hmac-sha2-512, hmac-sha1, hmac-md5, hmac-sha1-96, hmac-md5-96 DEBUG:paramiko.transport:client compress: none, zlib, zlib@openssh.com DEBUG:paramiko.transport:server compress: none, zlib, zlib@openssh.com DEBUG:paramiko.transport:client lang: DEBUG:paramiko.transport:server lang: DEBUG:paramiko.transport:kex follows: False DEBUG:paramiko.transport:=== Key exchange agreements === DEBUG:paramiko.transport:Kex: ecdh-sha2-nistp256 DEBUG:paramiko.transport:HostKey: ssh-rsa DEBUG:paramiko.transport:Cipher: aes128-ctr DEBUG:paramiko.transport:MAC: hmac-sha2-256 DEBUG:paramiko.transport:Compression: none DEBUG:paramiko.transport:=== End of kex handshake === DEBUG:paramiko.transport:kex engine KexNistp256 specified hash_algo DEBUG:paramiko.transport:Switch to new keys ... DEBUG:paramiko.transport:Adding ssh-rsa host key for 10.165.240.19: b'89c8e9d5af94fb93607a0878de0b3362' DEBUG:paramiko.transport:userauth is OK INFO:paramiko.transport:Authentication (password) successful! DEBUG:paramiko.transport:[chan 0] Max packet in: 32768 bytes DEBUG:paramiko.transport:[chan 0] Max packet out: 32768 bytes DEBUG:paramiko.transport:Secsh channel 0 opened. DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:paramiko.transport:[chan 0] Sesch channel 0 request ok DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:write_channel: b'\n' DEBUG:netmiko:read_channel:

RBM_S DEBUG:netmiko:Clear buffer detects data in the channel DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n'

RBM_S DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n'

RBM_S DEBUG:netmiko:read_channel: DEBUG:netmiko:[find_prompt()]: prompt is RBM_S DEBUG:netmiko:In disable_paging DEBUG:netmiko:Command: screen-length disable

DEBUG:netmiko:write_channel: b'\nscreen-length disable\n' DEBUG:netmiko:Pattern is: BM_S<HZ_rndlabFW_J01-17u_M9K_backup RBM_S RBM_S

RBM_S DEBUG:netmiko:Exiting disable_paging DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'\n' RBM_S DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'system-view\n' DEBUG:netmiko:Pattern is: BM_S<HZ_rndlabFW DEBUG:netmiko:_read_channel_expect read_data: s RBM_S[HZ_rndlabFW_J01-17u_M9K_backup]

ktbyers commented 2 years ago

@leojianli Can you post the full exception stack trace that you receive?

Also can you post a code snippet corresponding to the above debug message and corresponding to your exception stack trace (so I can see where you are running into an error)?

andrewXiaoyu commented 2 years ago

I have the same problem, I have send_config_set(commands, read_timeout=60), but I prompt ReadTimeout when I save force。

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: Saved the current configuration to mainboard device successfully. Slot 5:

DEBUG:netmiko:read_channel: DEBUG:netmiko:read_channel: DEBUG:netmiko:write_channel: b'exit\n' DEBUG:paramiko.transport:EOF in transport thread INFO:netmiko: Exec time: 0:00:37.210458 ReadTimeout("\nPattern not detected: '\\[H3C16010\\]' in output.\n\nThings you might try to fix this:\n1. Explicitly set your pattern using the expect_string argument.\n2. Increase the read_timeout to a larger value.\n\nYou can also look at the Netmiko session_log or debug log for more information.\n\n")

###########################session log output [H3C16010]save force Validating file. Please wait... Saved the current configuration to mainboard device successfully. Slot 5: exit

#########################I manually logged in the output of the device [H3C16010]save force Validating file. Please wait... Saved the current configuration to mainboard device successfully. Slot 5: Save next configuration file successfully. [H3C16010]

ktbyers commented 2 years ago

@andrewXiaoyu Can you post a larger section of your code. Please include commands with this.

I assume you are using Netmiko 4.1.0 and a device_type of huawei?