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.

Handle Paramiko-level "logger" issues

See original GitHub issue

Description

This has come up at least twice now: a user sets env.user to a list instead of a string by mistake, and instead of an actual useful error, we get a funky No handlers could be found for logger "paramiko.transport" message.

Quick research implies that this is a Paramiko level bug, as we don’t use the logger module ourselves and that particular logger name is used in Paramiko itself. However, if it is, it’s not caught in their test suite.

Attack plan:

  • Look at Paramiko’s mailing list or bug tracker and see if this is a known issue
  • Attempt to troubleshoot ourselves if not
  • Once solved, inform upstream
  • Failing all else, deal with this specific problem at our level: issue our own useful alert when user is set to a list value.

Originally submitted by Jeff Forcier (bitprophet) on 2009-08-14 at 09:58am EDT

Relations

  • Related to #52: Allow display of full stack trace on error
  • Related to #57: improved logging

Issue Analytics

  • State:open
  • Created 12 years ago
  • Comments:18 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fgimiancommented, Aug 14, 2015

I think it might be your order. Here’s the start of my fabfile.py 😄

import logging

from fabric.api import env, task, abort
from fabric.exceptions import CommandTimeout, NetworkError
from fabric.state import output

# Workaround for: No handlers could be found for logger "paramiko.transport"
# (see https://github.com/fabric/fabric/issues/51#issuecomment-96341022)
logging.basicConfig()
paramiko_logger = logging.getLogger("paramiko.transport")
paramiko_logger.disabled = True

Cheers fotis

1reaction
fgimiancommented, Apr 26, 2015

Same problem here with the latest of everything, it seems to happen when the connection to the host hangs 😄

Here’s how I worked around it:

import logging

logging.basicConfig()
paramiko_logger = logging.getLogger("paramiko.transport")
paramiko_logger.disabled = True

This was added to the top of my fabfile.py file.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paramiko issues with SSH login - python - Stack Overflow
I think that this behaviour is caused by transport.set_keepalive(1) line. It is sending after a 1 second interval a "keepalive" packet.
Read more >
Handling set new password prompt with Paramiko - Qxf2 BLOG
Handle set new password prompt while logging in to a remote server with Paramiko Python.
Read more >
2.5 PDF - Paramiko documentation
The high-level client API starts with creation of an SSHClient object. For more direct control, pass a socket (or.
Read more >
How to check SSH authentication using Paramiko
Linux Dynamic Apps use the Paramiko library to connect to hosts. ... Copy and paste the code into a text file on your...
Read more >
The Python Paramiko library - Packt Subscription
It also provides both client and server operations. Paramiko is the low-level SSH client behind the high-level automation framework Ansible for its network ......
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