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

[Custom Build Plugin] Error: Failed to describe the plugin #13020

Open
lmayorga1980 opened this issue Jun 4, 2024 · 1 comment
Open

[Custom Build Plugin] Error: Failed to describe the plugin #13020

lmayorga1980 opened this issue Jun 4, 2024 · 1 comment

Comments

@lmayorga1980
Copy link
Contributor

lmayorga1980 commented Jun 4, 2024

Created a Custom DataSource Plugin for Packer but when I run the packer plugins install fails with the following error

agent_1  | [Container] 2024/06/04 20:25:32 Running command PACKER_LOG=debug packer plugins install --path ./packer-plugin-myplugin_v0.0.1-dev_x5.0_linux_amd64 "my-private-github/org/myplugin"
agent_1  | 2024/06/04 20:25:33 [INFO] Packer version: 1.11.0 [go1.21.10 linux amd64]
agent_1  | 2024/06/04 20:25:33 [INFO] PACKER_CONFIG env var not set; checking the default config file path
agent_1  | 2024/06/04 20:25:33 [INFO] PACKER_CONFIG env var set; attempting to open config file: /root/.packerconfig
agent_1  | 2024/06/04 20:25:33 [WARN] Config file doesn't exist: /root/.packerconfig
agent_1  | 2024/06/04 20:25:33 [INFO] Setting cache directory: /root/.cache/packer
agent_1  | e: Running in background, not using a TTY
agent_1  | 
agent_1  | Packer failed to run /root/packer-plugin-myplugin_v0.0.1-dev_x5.0_linux_amd64
agent_1  | describe: signal: trace/breakpoint trap
agent_1  | 
agent_1  | Error: Failed to describe the plugin
agent_1  | 
agent_1  | Packer failed to run /root/packer-plugin-myplugin_v0.0.1-dev_x5.0_linux_amd64
agent_1  | describe: signal: trace/breakpoint trap

When I build the plugin using the Scaffold Repository using make i only zipped the binary and uploaded to my custom artifactory repo and try to download it as zip.

I cannot install plugins from github.com so i have to use a different namespace in my plugin my-private-github/org/myplugin

Is there any documentation on how to release a binary custom plugin to your own custom repository?

@nywilken
Copy link
Member

nywilken commented Jun 5, 2024

Hi @lmayorga1980 it looks like the plugin might be running into some cgo related issue due to static or dynamic linked libraries.

Are you downloading the zipped binary on to a Linux machine that is different from your build machine?

I would confirm that you can execute describe on the built binary before zipping it up and pushing it to your artifactory server. If you are using the latest make dev and that executes successfully I would think that on the build machine all works as expected but on the second host there is a linked library issue causing the signal breakpoint/trap.

Before getting into how to publish a plugin to your own custom repository. I would like to make sure you can run the plugin properly. Can you please trying do the following and report back.

  1. Build the binary locally as you normally would.
  2. Execute describe on the binary to validate it works ./path/to/binary describe
  3. Copy the said binary to the remote machine and re-run describe on the binary.
  4. Record the outputs of steps 2 and 3; report back.

If step 3 fails trying building the binary with CGO_ENABLED=0 and report steps 2 and 3; then report back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants