Support Questions
Find answers, ask questions, and share your expertise

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

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


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/", line 37, in <module>
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/", line 363, in execute
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/script/", 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/", 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/", line 223, in get_packages
    supported_packages = get_supported_packages()
  File "/usr/lib/ambari-agent/lib/resource_management/libraries/functions/", 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

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

Hi @Akhil S Naik

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

Super 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 :

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/, /usr/lib/hadoop/bin/, /usr/lib/hadoop/sbin/, /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.

Hi @Jay Kumar SenSharma,

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

Super 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


Super Mentor

@Shraddha Singh

You can find similar issue as yours here:

run_as_user = root

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

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

Super 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/


@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.


@Shraddha Singh

The current directory has links to /usr/hdp/3..0.x/{hdp_component} in your case, the below is from my HDP 2.6.5. so you should have copied those directories to /usr/hdp/3.0.x/ and do the tedious work to recreate symlinks from /usr/hdp/current as seen below, quite a good exercise. If this is a test cluster and most probably a single node

# tree /usr/hdp/current/
├── atlas-client -> /usr/hdp/
├── atlas-server -> /usr/hdp/
├── falcon-client -> /usr/hdp/
├── falcon-server -> /usr/hdp/
├── hadoop-client -> /usr/hdp/
├── hadoop-hdfs-client -> /usr/hdp/
├── hadoop-hdfs-datanode -> /usr/hdp/
├── hadoop-hdfs-journalnode -> /usr/hdp/
├── hadoop-hdfs-namenode -> /usr/hdp/
├── hadoop-hdfs-nfs3 -> /usr/hdp/
├── hadoop-hdfs-portmap -> /usr/hdp/
├── hadoop-hdfs-secondarynamenode -> /usr/hdp/
├── hadoop-hdfs-zkfc -> /usr/hdp/
├── hadoop-httpfs -> /usr/hdp/
├── hadoop-mapreduce-client -> /usr/hdp/
├── hadoop-mapreduce-historyserver -> /usr/hdp/
├── hadoop-yarn-client -> /usr/hdp/
├── hadoop-yarn-nodemanager -> /usr/hdp/
├── hadoop-yarn-resourcemanager -> /usr/hdp/
├── hadoop-yarn-timelineserver -> /usr/hdp/
├── hbase-client -> /usr/hdp/
├── hbase-master -> /usr/hdp/
├── hbase-regionserver -> /usr/hdp/
├── hive-client -> /usr/hdp/
├── hive-metastore -> /usr/hdp/
├── hive-server2 -> /usr/hdp/
├── hive-server2-hive2 -> /usr/hdp/
├── hive-webhcat -> /usr/hdp/
├── kafka-broker -> /usr/hdp/
├── knox-server -> /usr/hdp/
├── livy2-client -> /usr/hdp/
├── livy2-server -> /usr/hdp/
├── livy-client -> /usr/hdp/
├── oozie-client -> /usr/hdp/
├── oozie-server -> /usr/hdp/
├── phoenix-client -> /usr/hdp/
├── phoenix-server -> /usr/hdp/
├── pig-client -> /usr/hdp/
├── ranger-admin -> /usr/hdp/
├── ranger-tagsync -> /usr/hdp/
├── ranger-usersync -> /usr/hdp/
├── shc -> /usr/hdp/
├── slider-client -> /usr/hdp/
├── spark2-client -> /usr/hdp/
├── spark2-historyserver -> /usr/hdp/
├── spark2-thriftserver -> /usr/hdp/
├── spark-client -> /usr/hdp/
├── spark-historyserver -> /usr/hdp/
├── spark_llap -> /usr/hdp/
├── spark-thriftserver -> /usr/hdp/
├── sqoop-client -> /usr/hdp/
├── sqoop-server -> /usr/hdp/
├── storm-slider-client -> /usr/hdp/
├── tez-client -> /usr/hdp/
├── zeppelin-server -> /usr/hdp/
├── zookeeper-client -> /usr/hdp/
└── zookeeper-server -> /usr/hdp/
55 directories, 2 files

I would advise you if possible to re-install it completely and have a clean environment.


I have reinstalled and ran yum clean all, below is the output I am getting

#hdp-select versions

Traceback (most recent call last): File "/bin/hdp-select", line 456, in <module> printVersions() File "/bin/hdp-select", line 295, in printVersions for f in os.listdir(root): OSError: [Errno 2] No such file or directory: '/usr/hdp'

# hdp-select | grep hadoop

Traceback (most recent call last): File "/bin/hdp-select", line 456, in <module> printVersions() File "/bin/hdp-select", line 295, in printVersions for f in os.listdir(root): OSError: [Errno 2] No such file or directory: '/usr/hdp' [root@devaz01 ~]# hdp-select | grep hadoop hadoop-client - None hadoop-hdfs-client - None hadoop-hdfs-datanode - None hadoop-hdfs-journalnode - None hadoop-hdfs-namenode - None hadoop-hdfs-nfs3 - None hadoop-hdfs-portmap - None hadoop-hdfs-secondarynamenode - None hadoop-hdfs-zkfc - None hadoop-httpfs - None hadoop-mapreduce-client - None hadoop-mapreduce-historyserver - None hadoop-yarn-client - None hadoop-yarn-nodemanager - None hadoop-yarn-registrydns - None hadoop-yarn-resourcemanager - None hadoop-yarn-timelinereader - None hadoop-yarn-timelineserver - None

#ls -lart /usr/hdp

ls: cannot access /usr/hdp: No such file or directory

#ls -lart /usr/hdp/current/

ls: cannot access /usr/hdp/current/: No such file or directory

Super Mentor

@Shraddha Singh

While checking /usr/hdp/current folder there are no files available.


This is normal ... If your ambari cluster installation is not done successfully via ambari then the HDP binaries will not be installed to the cluster hosts and hence you will not see the directories inside the "/usr/hdp"

Once the HDP installation is started/completed then you will see the hsp-select command returning results by looking the contents inside the "/usr/hdp" directory.

I deleted the conf file under /usr/hdp/ and reinstalled services using Ambari UI and it worked.


For me the solution to this issue was just reinstalling the ambari-agent. Maybe it was partially installed somehow.

; ;