question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unifi switch returns "failed to enter enable mode" upon connect

See original GitHub issue

When trying out the UbiquitiUnifiSwitchSSH class, I keep running in “failed to enter enable mode”.

I used a debugger to see where it goes wrong. It successfully sends out the command here: https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1677 Then with this line: https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1679 The output becomes enable\r\n\r\n(UBNT) # That is the correct response, the session is in “enable” now. Nothing more is needed. It however does not see the pattern ssword in the output, so here: https://github.com/ktbyers/netmiko/blob/d0dc0c0dc8d2a52c0c5b92d60cd1427e71878d4c/netmiko/base_connection.py#L1681-L1683 It’s going to read until prompt or pattern. This function times out because no more output is coming.

I can see, at the time this code was merged, the function looked differently:

https://github.com/ktbyers/netmiko/blob/16f735751fb39021bab235de1625f18a7367e604/netmiko/base_connection.py#L1546-L1575

I suppose that code will work, given that it will only do one read.

I think the existing logic does not work with Unifi Switch because no password should be entered. I’m willing to push some code, but would need some guidance then what would be an appropriate solution.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbyerscommented, Apr 13, 2021
1reaction
RobBie1221commented, Apr 10, 2021

It is standard behavior not to prompt, I didn’t set any config for that. I don’t know if and how a password/secret could be set and what it’s behavior would be.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unifi Switch 8 POE - Unable to upgrade, adopt, connect via SSH
Reset switch using reset button. View device in controller software and click button for "Adopt and Upgrade". Status then switches to red text...
Read more >
US-8 Switch Uplink Issue | Ubiquiti Community
I have a UniFi Switch 8 POE-60W (4.0.21.9965) in my house that I used to connect my 3 APs (UniFi AP-AC-Lite, UniFi AP-AC-Mesh...
Read more >
Unifi Switch 24 adoption troubles | Ubiquiti Community
1. reset the device to factory settings and connect it to the same L2 network as the controller (on a port that has...
Read more >
The Uplink Connectivity Monitor causes the blocking of ports ...
Currently, the workaround is to DISABLE the "Uplink Connectivity Monitor." Then the blocked port becomes unblocked and the Access Points reconnects to the ......
Read more >
USW: Configuring Access Policies (802.1X) for Wired Clients
This article describes how to configure access policies (802.1X) on UniFi switches for wired clients. This article includes instructions...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found