Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Unable to query for supported packages using /usr/bin/hdp-select

avatar
Contributor

I am installing a 6 node cluster with 1 as ambari-server and rest other as agents.

Ambari-version: 2.7.0.0

HDP version:3.0

I am getting error at the installation stage where it is not able to find hdp-select file for versions.

Traceback (most recent call last):
  File "/var/lib/ambari-agent/cache/stack-hooks/before-INSTALL/scripts/hook.py", line 37, in <module>
    BeforeInstallHook().execute()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 363, in execute
    self.save_component_version_to_structured_out(self.command_name)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py", line 222, in save_component_version_to_structured_out
    stack_select_package_name = stack_select.get_package_name()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/stack_select.py", line 109, in get_package_name
    package = get_packages(PACKAGE_SCOPE_STACK_SELECT, service_name, component_name)
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/stack_select.py", line 223, in get_packages
    supported_packages = get_supported_packages()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/stack_select.py", line 147, in get_supported_packages
    raise Fail("Unable to query for supported packages using {0}".format(stack_selector_path))
resource_management.core.exceptions.Fail: Unable to query for supported packages using /usr/bin/hdp-select
14 REPLIES 14

avatar

Hi @Shraddha Singh,

are you running the ambari-agent as root user ? and its given the sud opermission for :

/usr/bin/ambari-python-wrap *

is the below command running correctly when run manually?

/usr/bin/hdp-select versions

avatar
Contributor

Hi @Akhil S Naik

I am getting 'permission denied' error on two hosts and on other hosts it is 'command not found'.

avatar
Master Mentor

@Shraddha Singh

If you are running ambari agent as non root user then you must have to give him some command execute permissions and sudoer permission as mentioned in :

https://docs.hortonworks.com/HDPDocuments/Ambari-2.6.2.2/bk_ambari-security/content/commands_agent.h...

sudo entries that should be placed in/etc/sudoersby running thevisudocommand

Example (snippet): (notice hdp-select in below command list.)

# Ambari: Hadoop and Configuration Commands
ambari ALL=(ALL) NOPASSWD:SETENV: /usr/bin/hdp-select, /usr/bin/conf-select, /usr/hdp/current/hadoop-client/sbin/hadoop-daemon.sh, /usr/lib/hadoop/bin/hadoop-daemon.sh, /usr/lib/hadoop/sbin/hadoop-daemon.sh, /usr/bin/ambari-python-wrap *

.

You can get the list of all needed commands in the mentioned Doc.

You must do this sudo configuration on every node in the cluster. To ensure that the configuration has been done properly, you can su to the ambari user and run sudo -l. There, you can double check that there are no warnings, and that the configuration output matches what was just applied.

avatar
Contributor

Hi @Jay Kumar SenSharma,

I am running the ambari-agent command being the root user only.

avatar
Master Mentor

@Shraddha Singh

Can you please share the "/etc/ambari-agent/conf/ambari-agent.ini" file or check & share the output of the following commands :

# grep 'run_as_user' /etc/ambari-agent/conf/ambari-agent.ini

# ps -ef | grep main.py

.

avatar
Master Mentor

@Shraddha Singh

You can find similar issue as yours here:

http://knowledge.teradata.com/KCS/id/KCS015527

avatar
Contributor

run_as_user = root

nxautom+ 6789 1 0 Feb02 ? 00:01:09 python /opt/microsoft/omsconfig/modules/nxOMSAutomationWorker/DSCResources/MSFT_nxOMSAutomationWorkerResource/automationworker/worker/main.py /var/opt/microsoft/omsagent/state/automationworker/oms.conf rworkspace:2cdafa97-1d38-4ad7-afc8-68a74145a77c 1.6.3.0 root 97419 97415 9 08:48 pts/0 00:02:02 /usr/bin/python /usr/lib/ambari-agent/lib/ambari_agent/main.py start root 109563 96746 0 09:11 pts/0 00:00:00 grep --color=auto main.py

This is the output I am getting after running the above commands.

avatar
Master Mentor

@Shraddha Singh

Please try this on the problematic host and then check if it works,

# yum reinstall hdp-select -y
# yum clean all

.

Also please share the output of the following commands:

# hdp-select versions
# hdp-select | grep hadoop
# ls -lart /usr/hdp
# ls -lart /usr/hdp/current/

.

avatar
Contributor

@Jay Kumar SenSharma

While checking /usr/hdp/current folder there are no files available. Can you provide me a way to install HDP correctly to get the files and resolve the error. I tried scp'ing it from one of the node out of 5 which is working correctly but they are stored as directories.