thelastpickle / cassandra-medusa

Apache Cassandra Backup and Restore Tool
Apache License 2.0
266 stars 143 forks source link

Medusa 0.7.1 throws 'No module named 'ssh2.error_codes'' on run #208

Closed vinovarov closed 4 years ago

vinovarov commented 4 years ago

Environment: Debian 9.13, Python 2.7.16 / 3.7.3

Installed Medusa with pip3, receive this on run attempt:

$ medusa
Traceback (most recent call last):
  File "/usr/local/bin/medusa", line 6, in <module>
    from medusa.medusacli import cli
  File "/usr/local/lib/python3.7/dist-packages/medusa/medusacli.py", line 40, in <module>
    import medusa.restore_cluster
  File "/usr/local/lib/python3.7/dist-packages/medusa/restore_cluster.py", line 17, in <module>
    from pssh.clients.miko import ParallelSSHClient
  File "/usr/local/lib/python3.7/dist-packages/pssh/clients/__init__.py", line 19, in <module>
    from .native.parallel import ParallelSSHClient
  File "/usr/local/lib/python3.7/dist-packages/pssh/clients/native/__init__.py", line 19, in <module>
    from .parallel import ParallelSSHClient
  File "/usr/local/lib/python3.7/dist-packages/pssh/clients/native/parallel.py", line 25, in <module>
    from .single import SSHClient
  File "/usr/local/lib/python3.7/dist-packages/pssh/clients/native/single.py", line 31, in <module>
    from ssh2.error_codes import LIBSSH2_ERROR_EAGAIN
ModuleNotFoundError: No module named 'ssh2.error_codes'

Tried to install it, looks okay:

$ sudo pip3 install ssh2-python
Requirement already satisfied: ssh2-python in /usr/local/lib/python3.7/dist-packages (0.20.0)

Please advise.

(and as I've bumped into this https://github.com/thelastpickle/cassandra-medusa/issues/201 today too, none of ways to install Medusa 0.7.1 seem to work =) )

michaelsembwever commented 4 years ago

ParallelSSH's ssh2-python version 0.20.0 breaks it.

pip3 install ssh2-python==0.19.0

should fix things for you.

alvaropalmeirao commented 4 years ago

Yap, everything is working fine here. Thanks 👍

vinovarov commented 4 years ago

ParallelSSH's ssh2-python version 0.20.0 breaks it.

pip3 install ssh2-python==0.19.0

should fix things for you.

That really worked, thank you!

vinovarov commented 4 years ago

Some dependency fix could follow this thread, maybe?

vinovarov commented 4 years ago

Now with default version of ssh2-python==0.22.0 installed automatically everything works fine out of the box.

arodrime commented 4 years ago

@vinovarov so setting the PR to use this sounds like a good fix/safety to you?

ssh2-python>=0.22.0

arodrime commented 4 years ago

We have the PR ready but we're fighting with integration tests a bit at the moment.

We plan on changing #210 to be as mentioned above and release medusa 0.7.2.

ssh2-python>=0.22.0

arodrime commented 4 years ago

Fixed with pin on ssh2-python>=0.19.0.