Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation failure of packer in Rhel 7 #12786

Closed
vanshikw opened this issue Jan 16, 2024 · 3 comments
Closed

Installation failure of packer in Rhel 7 #12786

vanshikw opened this issue Jan 16, 2024 · 3 comments
Labels

Comments

@vanshikw
Copy link

When installing packer using the below lines, I am getting error

Lines:
echo "Adding Packer to the image"
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum -y install packer || exit 1

Error:
11:01:17 azure-arm: Adding Packer to the image
11:01:19 azure-arm: Loaded plugins: langpacks, product-id, yum_rhui_plugin
11:01:19 azure-arm: adding repo from: https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
11:01:19 azure-arm: grabbing file https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo to /etc/yum.repos.d/hashicorp.repo
11:01:19 azure-arm: repo saved to /etc/yum.repos.d/hashicorp.repo
11:01:20 azure-arm: Loaded plugins: langpacks, product-id, search-disabled-repos, yum_rhui_plugin
11:01:21 azure-arm: https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found
11:01:21 azure-arm: Trying other mirror.
11:01:21 azure-arm: To address this issue please refer to the below knowledge base article
11:01:21 azure-arm:
11:01:21 azure-arm: https://access.redhat.com/articles/1320623
11:01:21 azure-arm:
11:01:21 azure-arm: If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
11:01:21 azure-arm:
11:01:21 azure-arm:
11:01:21 azure-arm:
11:01:21 azure-arm: One of the configured repositories failed (Hashicorp Stable - x86_64),
11:01:21 azure-arm: and yum doesn't have enough cached data to continue. At this point the only
11:01:21 azure-arm: safe thing yum can do is fail. There are a few ways to work "fix" this:
11:01:21 azure-arm:
11:01:21 azure-arm: 1. Contact the upstream for the repository and get them to fix the problem.
11:01:21 azure-arm:
11:01:21 azure-arm: 2. Reconfigure the baseurl/etc. for the repository, to point to a working
11:01:21 azure-arm: upstream. This is most often useful if you are using a newer
11:01:21 azure-arm: distribution release than is supported by the repository (and the
11:01:21 azure-arm: packages for the previous distribution release still work).
11:01:21 azure-arm:
11:01:21 azure-arm: 3. Run the command with the repository temporarily disabled
11:01:21 azure-arm: yum --disablerepo=hashicorp ...
11:01:21 azure-arm:
11:01:21 azure-arm: 4. Disable the repository permanently, so yum won't use it by default. Yum
11:01:21 azure-arm: will then just ignore the repository until you permanently enable it
11:01:22 azure-arm: again or use --enablerepo for temporary usage:
11:01:22 azure-arm:
11:01:22 azure-arm: yum-config-manager --disable hashicorp
11:01:22 azure-arm: or
11:01:22 azure-arm: subscription-manager repos --disable=hashicorp
11:01:22 azure-arm:
11:01:22 azure-arm: 5. Configure the failing repository to be skipped, if it is unavailable.
11:01:22 azure-arm: Note that yum will try to contact the repo. when it runs most commands,
11:01:22 azure-arm: so will have to try and fail each time (and thus. yum will be be much
11:01:22 azure-arm: slower). If it is a very temporary problem though, this is often a nice
11:01:22 azure-arm: compromise:
11:01:22 azure-arm:
11:01:22 azure-arm: yum-config-manager --save --setopt=hashicorp.skip_if_unavailable=true
11:01:22 azure-arm:
11:01:22 azure-arm: failure: repodata/repomd.xml from hashicorp: [Errno 256] No more mirrors to try.
11:01:22 azure-arm: https://rpm.releases.hashicorp.com/RHEL/7Server/x86_64/stable/repodata/repomd.xml: [Errno 14] HTTPS Error 404 - Not Found

How to install packer now?

@vanshikw vanshikw added the bug label Jan 16, 2024
@nywilken
Copy link
Contributor

nywilken commented Jan 16, 2024

Hi @vanshikw thanks for reaching out. It sounds like you might be running into an issue with the recent changes made to HashiCorp's Linux package distributions. In October of last year, the RHEL/Centos 7 aliases such as 7Server, 7Workstation, 7.7, 7.8, 7.9 were consolidated into a single repository for RHEL 7. Last week all the EoL linux distributions were removed from the repository and I assume the removal of aliases were in full effect.

Unfortunately, this means that practitioners need to change the releasever variable within the repo baseurl to 7 as opposed to 7Server or any other variant. The consolidation of alias also occurred for RHEL/Centos 8.

That being said, you have two options to install Packer on RHEL 7.

  1. Via yum you can update the yum subscription for HashiCorp to use RHEL/7. See example below.
[hashicorp]
baseurl = https://rpm.releases.hashicorp.com/RHEL/7/aarch64/stable
cachedir = /var/cache/yum/aarch64/7/hashicorp
gpgcadir = /var/lib/yum/repos/aarch64/7/hashicorp/gpgcadir
gpgdir = /var/lib/yum/repos/aarch64/7/hashicorp/gpgdir
gpgkey = https://rpm.releases.hashicorp.com/gpg
hdrdir = /var/cache/yum/aarch64/7/hashicorp/headers
persistdir = /var/lib/yum/repos/aarch64/7/hashicorp
pkgdir = /var/cache/yum/aarch64/7/hashicorp/packages
  1. You can manually download the RHEL 7 binaries for your flavor of RHEl 7 at https://archive.releases.hashicorp.com/RHEL/

Please try updating your yum configuration and try again. I will keep this issue open until you report back to ensure you can get Packer installed correctly.

@nywilken nywilken added stage/waiting-reply crt common release tooling issue stage/not-a-bug labels Jan 16, 2024
@nywilken
Copy link
Contributor

Closing as this does not appear to be a Packer issue. Please feel free to drop us a comment if you believe this is a Packer issue.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants