Hello Packer community,
I’m encountering an issue where Packer does not recognize the plugins I’ve manually installed, even though they’re placed in the correct directory and the PACKER_PLUGIN_PATH
environment variable is set accordingly.
Setup:
- Packer Version: 1.9.4
- Operating System: Linux (amd64 architecture)
Steps Taken:
- Manually downloaded the Amazon and Openstack plugins from my internal artifact repository.
- Extracted the plugins and placed them in the
/root/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon
directory. - Set the
PACKER_PLUGIN_PATH
environment variable to/root/.config/packer/plugins/
. - Listed the directory to confirm plugins are present:
drwxr-xr-x 2 root root 80 Sep 5 14:04 .
drwxr-xr-x 1 root root 20 Sep 5 14:04 ..
-rwxr-xr-x 1 root root 42913792 Jun 5 14:31 packer-plugin-amazon
When running Packer, I receive the error:
Failed getting the "github.com/hashicorp/amazon" plugin:
1 error occurred:
* Plugin host rate limited the plugin getter. Try again in 8m56.272593086s.
HINT: Set the PACKER_GITHUB_API_TOKEN env var with a token to get more requests.
GET https://api.github.com/repos/hashicorp/packer-plugin-amazon/git/matching-refs/tags: 403 API rate limit exceeded for x.x.x.x . (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 8m56s]
===> build_image.sh: [05-09-2023 14:04:16] [ENV=dev;PROVIDER=AWS] Running packer validate command...
Error: Missing plugins
The following plugins are required, but not installed:
* github.com/hashicorp/amazon = 1.2.6
Did you run packer init for this project ?
===> build_image.sh: [05-09-2023 14:04:16] [ENV=dev;PROVIDER=AWS] Template templates/AWS.pkr.hcl for dev with role xxx not valid, took 0 sec!
2023/09/05 14:04:16 [INFO] Packer version: 1.9.4 [go1.20.7 linux amd64]
2023/09/05 14:04:16 [TRACE] discovering plugins in /root/.config/packer/plugins/github.com/hashicorp/amazon/
2023/09/05 14:04:16 [INFO] Discovered potential plugin: amazon = /root/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon
2023/09/05 14:04:16 [INFO] found external [chroot ebs ebssurrogate ebsvolume instance] builders from amazon plugin
2023/09/05 14:04:16 [INFO] found external [import] post-processors from amazon plugin
2023/09/05 14:04:16 found external [ami parameterstore secretsmanager] datasource from amazon plugin
2023/09/05 14:04:16 [INFO] PACKER_CONFIG env var not set; checking the default config file path
2023/09/05 14:04:16 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
2023/09/05 14:04:16 [WARN] Config file doesn't exist: /root/.packerconfiG
2023/09/05 14:04:16 [INFO] Setting cache directory: /root/.cache/packer
e: Running in background, not using a TTY
2023/09/05 14:04:16 [TRACE] listing potential installations for "github.com/hashicorp/amazon" that match "= 1.2.6". plugingetter.ListInstallationsOptions{FromFolders:[]string{"/root/.config/packer/plugins/github.com/hashicorp/amazon/"}, BinaryInstallationOptions:plugingetter.BinaryInstallationOptions{APIVersionMajor:"5", APIVersionMinor:"0", OS:"linux", ARCH:"amd64", Ext:"", Checksummers:[]plugingetter.Checksummer{plugingetter.Checksummer{Type:"sha256", Hash:(*sha256.digest)(0xc000065000)}}}}
2023/09/05 14:04:16 ui error: Error: Missing plugins
The following plugins are required, but not installed:
* github.com/hashicorp/amazon = 1.2.6
Did you run packer init for this project ?
As seein in the logs, it is able to detect the plugin
2023/09/05 14:04:16 [INFO] Discovered potential plugin: amazon = /root/.config/packer/plugins/github.com/hashicorp/amazon/packer-plugin-amazon
, yet it tries to download plugin from github.com
In my aws.pkr.hcl file, I have mentioned
packer {
required_plugins {
amazon = {
version = "= 1.2.6"
source = "github.com/hashicorp/amazon"
}
}
}
This error I am getting is both for aws and openstack plugin.
I did run packer init.