[Solved] Fabric error No handlers could be found for logger “paramiko.transport”

I’m not sure why I’m getting this error that’s terminating my connection. I updated paramiko-1.7.6 from 1.7.5 via easy_install.

I’m trying to setup Fabric to upload my Django app to my server. The error seems to be happening when I attempt to make a backup of the existing app directory:

def backup_current_install():
  now = datetime.datetime.now()
  cmd="cp -r /home/path/django-projects/app /home/path/django-projects/app%s" % now.strftime("%Y%m%d_%I:%M:%S")
run(cmd)

I have set:

env.hosts  
env.password

In the fabfile and I’m not sure how to navigate this handler error.

Solution #1:

It turns out that this error was a result of me not configuring env.password as a simple string.

Both env.user and env.password should be simple strings, not Lists.
Documentation

Respondent: BryanWheelock

Solution #2:

If it’s not causing a problem, you can safely ignore this message.

In this case, the library (paramiko), expects the application to handle the logging. The application programmer however probably expected the library to not have any side effects, and handle logging properly.

See Configuring Logging for a Library.

Respondent: BryanWheelock

Solution #3:

In addition to the previous answers:

If you want to find a root cause of the error in your application it’s useful to enable logging which was signalized by the message:

Fabric error No handlers could be found for logger “paramiko.transport”

You can enable logging from paramico in fabric like this:

from fabric.network import ssh

ssh.util.log_to_file("paramiko.log", 10)
Respondent: JimB

The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .

Leave a Reply

Your email address will not be published.