Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

python

fabric

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.

like image 841
BryanWheelock Avatar asked Nov 25 '09 15:11

BryanWheelock


3 Answers

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

like image 107
BryanWheelock Avatar answered Sep 21 '22 04:09

BryanWheelock


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.

like image 22
JimB Avatar answered Sep 20 '22 04:09

JimB


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)
like image 27
Mateusz Kleinert Avatar answered Sep 21 '22 04:09

Mateusz Kleinert