-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Packer no longer checks PACKER_HOME_DIR/plugins
for plugin location
#11972
Comments
Hi @mschuchard thanks for bubbling this up. This should still work as documented. We use the same mechanism for acceptance testing HashiCorp maintained plugins. Looking at the provided logs it appears that you may also have a plugin in /usr/local/bin/, which is in the same directory as the If it is indeed true that there is a plugin Have you tired removing If possible could provide the full debug logs to help us better understand the the paths Packer is checking against. I look forward to hearing back. Below is the output from my local test using the Packer nightly build, which has identical plugin loading code as 1.8.3
I also tested with 1.8.3 to be sure
|
There are no Packer plugins installed in I can try to find some more information from the logs, but for loading a plugin from 1.7.10 - loaded and works completely correct I am not sure what exactly from the logs would be helpful to see. Please let me know. |
Ok I debugged a little more and have discovered that Packer 1.8.3 independently does locate plugins in So this is actually an incompatibility between a recent update to Packer and possibly a necessary corresponding update to the Packer SDK. For now I can workaround by building the plugin and not locally installing it since it can still be located in |
Should I migrate this issue to the |
Additional information is that Packer also cannot find the plugins locally installed in |
This issue has been synced to JIRA for planning. JIRA ID: HPR-941 |
@mschuchard thank you for all your work in tracking down the inconsistent behavior with the Plugin loading for Packer. TBH the change to the SDK to use the XDG directory spec was a bit of a surprise to me as Packer uses the older directory style ($HOME/.packer.d/). We've done some work to clean up the documentation in #12485 and we've fixed a bit of the plugin loading logic in #12414 that should fix the plugin loading order issues. The changes are available within the latest nightly builds if you wish to pull it down and give it a test run. Once I merge #12485 this issue will be closed. But if you test and find issues please feel free to drop a comment on the thread and I will gladly reopen. |
Oh sorry for only thumbs up and not replying with a thanks. I have been conditioned into believing all my issues in the Hashicorp repos are locked by the bot, and so I forgot I could reply. I know it is tough triaging these Packer issues with the current staffing, and so I appreciate the resolution. I am still rolling with 1.8.7 and 0.4 at the moment, but will update the deps and take advantage of these changes once I return to Packer plugin development in my cycle of plugin development (re: Hashi stack recently transitioned from a Vault plugin to a Terraform plugin, and so will probably be able to revisit Packer in September). |
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. |
Community Note
Overview of the Issue
As recently as version 1.7.10 of Packer, Packer would check the location
PACKER_HOME_DIR/plugins
for the location of a plugin and correctly utilize it. According to the plugin location documentation, this is priority three in reverse lookup order. With version 1.8.3, Packer will no longer check that location for plugins. I have tested and verified it will still check locations one and two for the location of a plugin. This makes plugin acceptance testing more difficult since we should not conflict with the proper installation namespaces maintained bypacker init
for a full release version.If this is an intended change, then please communicate it so that plugin maintainers can update our acceptance tests to locally build the plugin in the same directory as
path.root
, but not locally install the built plugin into thePACKER_HOME_DIR/plugins
directory. This would ensure Packer would accurately find the plugin since it would be at location two in the documentation. Thank you.Reproduction Steps
Place a required plugin in the location
PACKER_HOME_DIR/plugins
and build a Packer template requiring the plugin.Packer version
1.8.3
Simplified Packer Template
n/a
Operating system and Environment details
Linux home directory structure e.g.
~/.packer.d/plugins
Log Fragments and crash.log files
Output of logs from
go test
withPACKER_ACC=1
:2022/09/07 15:41:04 Current exe path: /usr/local/bin/packer
2022/09/07 15:41:04 [TRACE] Starting external plugin /usr/local/bin/NONEXISTENT
2022/09/07 15:41:04 Starting plugin: /usr/local/bin/NONEXISTENT []string{"/usr/local/bin/NONEXISTENT"}
2022/09/07 15:41:04 ui error: Error: failed loading PLUGIN
fork/exec /usr/local/bin/NONEXISTENT: no such file or directory
The text was updated successfully, but these errors were encountered: