tbarbugli / cassandra_snapshotter

A tool to backup cassandra nodes using snapshots and incremental backups on S3
Other
222 stars 122 forks source link

cassandra_snapshotter fails with ImportError: No module named pkg_resources #131

Closed zencircle closed 5 years ago

zencircle commented 5 years ago
[root@awsdevmesl30 root]# cassandra-snapshotter --s3-bucket-name=XXX --s3-bucket-region=us-east-1 --s3-base-path=/XX --aws-access-key-id=AKXXX --aws-secret-access-key=XXX backup --hosts=192.168.100.1 --user=testuser
[192.168.100.1] Executing task 'node_start_backup'
[192.168.100.1] Executing task 'upload_node_backups'
[192.168.100.1] run: cassandra-snapshotter-agent  create-upload-manifest --manifest_path=/tmp/backupmanifest --snapshot_name=20190307153646 --snapshot_keyspaces= --snapshot_table= --conf_path=/etc/cassandra/conf/ --exclude_tables=
[192.168.100.1] out: Traceback (most recent call last):
[192.168.100.1] out:   File "/opt/rh/python27/root/usr/bin/cassandra-snapshotter-agent", line 5, in <module>
[192.168.100.1] out:     from pkg_resources import load_entry_point
[192.168.100.1] out: ImportError: No module named pkg_resources
[192.168.100.1] out: 

Fatal error: run() received nonzero return code 1 while executing!
zencircle commented 5 years ago
# pip -V
pip 19.0.3 from /opt/rh/python27/root/usr/lib/python2.7/site-packages/pip (python 2.7)

# uname -a
Linux XX  3.10.0-957.5.1.el7.x86_64 #1 SMP Wed Dec 19 10:46:58 EST 2018 x86_64 x86_64 x86_64 GNU/Linux
#pip show setuptools
Name: setuptools
Version: 40.8.0
..
Location: /opt/rh/python27/root/usr/lib/python2.7/site-packages
..            
# which cassandra-snapshotter
/opt/rh/python27/root/usr/bin/cassandra-snapshotter
# pip show cassandra-snapshotter
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7.
Name: cassandra-snapshotter
Version: 1.0.0
Summary: Cassandra snapshotter is a tool to backup cassandra to Amazon S3.
..
Location: /opt/rh/python27/root/usr/lib/python2.7/site-packages
zencircle commented 5 years ago

I have tried reinstalling setuptools and also using virtuaenv and I get the same result

zencircle commented 5 years ago

I reinstalled cassandra_snapshotter Error changed to No module from cassandra_snapshotter.agent import main

Changed directory permission to 755. chmod 755 -R /opt/rh/python27/root. Fixed the issue. Closing