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.

Adtran ValueError: Failed to enter enable mode.

See original GitHub issue

I am running into an issue when trying to get into an Adtran TA5004.

It comes up with the error ValueError: Failed to enter enable mode. Please ensure you pass the 'secret' argument to ConnectHandler.

Here is the code I am using to try and send the commands

from netmiko import ConnectHandler

olt = {
        'device_type': 'adtran_os',
        'ip': '10.0.0.10',
        'username': 'ADMIN',
        'password': 'PASSWORD',
        'secret': '',
        'session_log': 'adtran_output.txt'
}

config_commands = ['do show system parameters']
print(config_commands)

all_devices = [olt]
for devices in all_devices:
    net_connect = ConnectHandler(**devices)
    net_connect.enable()
    output = net_connect.send_config_set(config_commands)
    print(output)

Have also got a session log if that helps

Last Login Date      : Jan  1 2000 00:46:17 
Last Login Type      : IP Session(CLI) 
Login Failures       : 0 (Since Last Login)
                     : 4 (Total for Account)
>
>terminal length 0
>
>

The OLT doesn’t have a secret enabled, and just seems like there is an issue with using net_connect.enable() on the device, it doesn’t seem to be grabbing the secret value Thinking it might be down to the OLT having a different command dictionary compared to regular AOS, but I’m not 100% on that

Sorry if this has been answered before and I missed it

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
jhodiecommented, Nov 15, 2021

Guessing this is what you are wanting (still new to all this):

Traceback (most recent call last):
  File "C:\Users\JoshHodkinson\Documents\Netmiko\adtran-netmiko-example-1.py", line 21, in <module>
    net_connect.enable()
  File "C:\Users\JoshHodkinson\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\netmiko\adtran\adtran.py", line 26, in enable
    return super().enable(cmd=cmd, pattern=pattern, re_flags=re_flags)
  File "C:\Users\JoshHodkinson\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\netmiko\cisco_base_connection.py", line 24, in enable
    return super().enable(
  File "C:\Users\JoshHodkinson\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\netmiko\base_connection.py", line 1707, in enable
    raise ValueError(msg)
ValueError: Failed to enter enable mode. Please ensure you pass the 'secret' argument to ConnectHandler.

Process returned 0 (0x0)        execution time : 7.475 s
Press any key to continue . . .

The reason I am trying the show command is just to have it as a test before fully deploying it

0reactions
jhodiecommented, Nov 16, 2021

It looks slightly different to that pull request as it doesn’t ask for a password, it goes straight into enable mode

>enable
#
Read more comments on GitHub >

github_iconTop Results From Across the Web

Netmiko - Enter configuration terminal mode - Stack Overflow
Editing I tried the following command to enter config_mode and got 'ValueError'. net_connect.find_prompt() net_connect.enable() net_connect.
Read more >
netmiko API documentation - GitHub Pages
Enter enable mode. :param cmd: Device command to enter enable mode. :param pattern: pattern to search for indicating device is waiting for password....
Read more >
BlueSecure™ Controller Setup and Administration Guide
You can configure BSAPs to function as access points or RF sensors. The BSC manages and configures BSAPs operating in AP-only mode, ...
Read more >
Untitled
... -Queued-Backup-Exec-11D-Oracle-10-Database-Backup-error-0xe000846b.html ... https://www.experts-exchange.com/questions/23670704/Insert-Sql-Statement- ...
Read more >
Provisioning of GPON Specifications DPoGv1.0 DPoG ...
may require access to such other documents. ... The DPoG System MUST reject and report a 'Wrong Value' error for SNMP v2c/v3 PDUs...
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