Support Questions

Find answers, ask questions, and share your expertise

Restart Ranger Fails - Permission Denied

avatar

Hi All,


I am having an issue in restarting Ranger Service via Ambari. I deployed a cluster via cloudbreak then added the Ranger service, I then had to make a config change and when I go to Ranger > Restart > Restart All Affected I get the attached issue:


Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/ranger_admin.py", line 241, in <module>
    RangerAdmin().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 352, in execute
    method(env)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 971, in restart
    self.stop(env, upgrade_type=upgrade_type)
  File "/var/lib/ambari-agent/cache/stacks/HDP/3.0/services/RANGER/package/scripts/ranger_admin.py", line 61, in stop
    Execute(format('{params.ranger_stop}'), environment={'JAVA_HOME': params.java_home}, user=params.unix_user)
  File "/usr/lib/ambari-agent/lib/resource_management/core/base.py", line 166, in __init__
    self.env.run()
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 160, in run
    self.run_action(resource, action)
  File "/usr/lib/ambari-agent/lib/resource_management/core/environment.py", line 124, in run_action
    provider_action()
  File "/usr/lib/ambari-agent/lib/resource_management/core/providers/system.py", line 263, in action_run
    returns=self.resource.returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 72, in inner
    result = function(command, **kwargs)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 102, in checked_call
    tries=tries, try_sleep=try_sleep, timeout_kill_strategy=timeout_kill_strategy, returns=returns)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 150, in _call_wrapper
    result = _call(command, **kwargs_copy)
  File "/usr/lib/ambari-agent/lib/resource_management/core/shell.py", line 314, in _call
    raise ExecutionFailed(err_msg, code, out, err)
resource_management.core.exceptions.ExecutionFailed: Execution of '/usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh stop' returned 126. -bash: /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh: Permission denied
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Nathaniel Vala

That shows a permission issue on this file /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh can you check that the file is readable and executable by user ranger and only readable by group and world r-x-r--r--

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@Nathaniel Vala

That shows a permission issue on this file /usr/hdp/current/ranger-admin/ews/ranger-admin-services.sh can you check that the file is readable and executable by user ranger and only readable by group and world r-x-r--r--

avatar

Thanks @Geoffrey Shelton Okot 🙂 it was owned by root, i thought this was normal and that ambari must have started the process as root because it is a security appliance, but changing to ranger works!