Community Articles

Find and share helpful community-sourced technical articles.
Labels (1)
avatar

While installing HDP components using Ambari some times it fails with below errors.

raise Fail("Cannot match package for regexp name {0}. Available packages: {1}".format(name, self.available_packages_in_repos)) 
resource_management.core.exceptions.Fail: Cannot match package for regexp name zookeeper_${stack_version}. Available packages: []

What does this mean? basically Ambari is unable to find the packages. the possible reasons can be,

Reason1: Is that host already have that binaries installed? If it is already installed using different repo-name then Ambari would not be able to determine those binaries. You can find out that by running

yum list installed | grep zookeeper

This tells using which tag/repo it was installed (look for specific HDP version).

If you find entry and it was installed different tag/repo then manually remove above packages and attempt to install again.

Reason2: Its possible that provided URL does not have those binaries. you can determine by running below command

yum list available | grep zookeeper

If it is not returning any list for that version then check tag/repoURL defined in Ambari to make sure it is correct.

3,856 Views
0 Kudos
Comments

You may be hittung this bug https://issues.apache.org/jira/browse/AMBARI-22652

 

A workaround is to delete the line of code:

 

package_version = None

 in all agents in file:

/usr/lib/ambari-agent/lib/resource_management/libraries/script/script.py

 at line 541 in ambari 2.6.2.2

 

then compile the script with:

python -O -m compileall script.py
avatar
Super Guru

<edit> Sorry I thought this was a new post.  @guido please do not respond to old posts with new solutions.   Ambari 2.6.0 Bug is not applicable here.

 

 

@apappu The version on the end of the package is how they handled having multiple versions available in the repos as well as facilitating the upgrade process from one version to another.   Using the variable scope in the python allowed ambari code to be dynamic across all the different versions, environments, etc.

 

If your repos are setup right, this should not be an issue.  I have seen some failure in the public repos lately, slow to respond, or blocked by certain cloud providers causing the "no package found" errors.  

 

If you are running your own private repos and have an issue like this, you can just create the packages you need in the version you want using the rpmrebuild command on an existing rpm.