Huawei special_login_handler is not logging in successfully
See original GitHub issueThe system information is as follows:
- netmiko version: 4.0
- python 3.10
- window 11
error_print:
Traceback (most recent call last):
File "E:\web_API\test.py", line 11, in <module>
app.net_ssh_proxy(switch_json = switch_json, commands=commands)
File "E:\web_API\app.py", line 25, in net_ssh_proxy
with ConnectHandler(**device_info, sock=sock) as net_connect:
File "E:\venv_02\lib\site-packages\netmiko\ssh_dispatcher.py", line 344, in ConnectHandler
return ConnectionClass(*args, **kwargs)
File "E:\venv_02\lib\site-packages\netmiko\base_connection.py", line 434, in __init__
self._open()
File "E:\venv_02\lib\site-packages\netmiko\base_connection.py", line 439, in _open
self.establish_connection()
File "E:\venv_02\lib\site-packages\netmiko\base_connection.py", line 1092, in establish_connection
self.special_login_handler()
File "E:\venv_02\lib\site-packages\netmiko\huawei\huawei.py", line 105, in special_login_handler
output = self.read_until_pattern(password_change_prompt)
File "E:\venv_02\lib\site-packages\netmiko\base_connection.py", line 631, in read_until_pattern
raise ReadException(msg)
netmiko.exceptions.ReadException: Unable to successfully split output based on pattern:
pattern=((Change now|Please choose))|([\]>]\s*$)
output='\nInfo: The max number of VTY users is 21, the number of current VTY users online is 2, and total number of terminal users online is 2.\n The current login time is 2022-03-28 15:55:30+08:00.\n<xxxx_hostname>'
results=['\nInfo: The max number of VTY users is 21, the number of current VTY users online is 2, and total number of terminal users online is 2.\n The current login time is 2022-03-28 15:55:30+08:00.\n<xxxx_hostname', None, None, '>', '']
test instanse 2. python 3.10 3. window 11 Netmiko 3.4.0 Release
out_print
no problem
Issue Analytics
- State:
- Created a year ago
- Comments:52 (26 by maintainers)
Top Results From Across the Web
An issue occurs when logging in to my HUAWEI ID
When logging in to their HUAWEI ID, the user is prompted with "Unable to obtain data. Please try again later.", a message indicating...
Read more >What should I do if I am having trouble logging in to ...
Cause and solution: · The network environment may be abnormal. · Clear the data and cache of HUAWEIAppGallery and open the app again....
Read more >Troubleshooting Failures to Log In to the Web System of AR ...
Run the display this command in the interface view to check whether the router's IP address is correctly configured. If not, run the...
Read more >Troubleshooting S5700 Switch Login Failures - Huawei Support
This document describes how to troubleshoot common login faults of Huawei S series switches, including: Failure to log in to a Huawei S...
Read more >Failed to Log in to the FusionAccess VM- Huawei
A user fails to log in to the FusionAccess VM. After the user enters the account and password, the VM is stuck in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The reason for Huawei telnet trouble
netmiko.exceptions.ReadException: Unable to successfully split output based on pattern
is that pattern(]\s*$|>\s*$|(Change now|Please choose 'YES' or 'NO').+)
contains nested group (nested parentheses). To fix this issue, changes of source code needed.Details:
combined_pattern
created - i mean this pattern(]\s*$|>\s*$|(Change now|Please choose 'YES' or 'NO').+)
combined_pattern
passes toread_until_pattern
method here https://github.com/ktbyers/netmiko/blob/f3b5da244e6ce1e5fd7bd89fd36b090e854828b4/netmiko/huawei/huawei.py#L155result
list of length = 4, and this is the reason forReadException
here: https://github.com/ktbyers/netmiko/blob/f3b5da244e6ce1e5fd7bd89fd36b090e854828b4/netmiko/base_connection.py#L645result
) = 4 is thatcombined_pattern
has nested parentheses here:@Toxic-Waste- you can try to edit file
/home/<snip>/.local/lib/python3.10/site-packages/netmiko/huawei/huawei.py
on line 131 change this:to this:
But you must understand that:
@ktbyers I can try to analize side effects of proposed changes and craft Pull Request if you like. But if you think that PR is redundant, please let me know. Thanks!
@ktbyers Yes, i see.