Symantec / ambari-cassandra-service

26 stars 33 forks source link

Fails on HDP 2.5: "cannot import name format hdp_stack_version" #11

Open rabejens opened 7 years ago

rabejens commented 7 years ago

I am trying to install this on HDP 2.5, and I get:

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/clients.py", line 38, in <module>
    clients().execute()
  File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute
    method(env)
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/clients.py", line 32, in install
    import params
  File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/params.py", line 16, in <module>
    from resource_management.libraries.functions.version import format_hdp_stack_version, compare_versions
ImportError: cannot import name format_hdp_stack_version
juan-echeverria commented 7 years ago

Hello @rabejens. I was able to fix that error doing the following:

1-) Go to the script /var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/clients.py and, in the affected line, replace format_hdp_stack_version with format_stack_version.

2-) In my case, a second error appeared after fixing the previous one. The error was the following:

Traceback (most recent call last): File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/cassandra_master.py", line 60, in <module> Cassandra_Master().execute() File "/usr/lib/python2.6/site-packages/resource_management/libraries/script/script.py", line 280, in execute method(env) File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/cassandra_master.py", line 46, in start self.configure(env) File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/cassandra_master.py", line 35, in configure cassandra() File "/var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/cassandra.py", line 29, in cassandra recursive=True File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 114, in __new__ cls(names_list.pop(0), env, provider, **kwargs) File "/usr/lib/python2.6/site-packages/resource_management/core/base.py", line 147, in __init__ raise Fail("%s received unsupported argument %s" % (self, key)) resource_management.core.exceptions.Fail: Directory['/var/log/cassandra'] received unsupported argument recursive

For this case, you should go to that script /var/lib/ambari-agent/cache/stacks/HDP/2.5/services/CASSANDRA/package/scripts/cassandra.py and replace recursive=True for create_parents=True.

I hope this can help you too.