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

Cannot initialize plugin with Packer 1.11.z due to plugin version mismatch error #90

Closed
F21 opened this issue Jun 5, 2024 · 7 comments · Fixed by #91
Closed

Cannot initialize plugin with Packer 1.11.z due to plugin version mismatch error #90

F21 opened this issue Jun 5, 2024 · 7 comments · Fixed by #91

Comments

@F21
Copy link
Contributor

F21 commented Jun 5, 2024

When trying to initialize the plugin with Packer 1.11.z, I get the following error:

Failed getting the "github.com/YaleUniversity/goss" plugin:
11 errors occurred:
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.10", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.8", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.7", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.6", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.5", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.4", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.3", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.2", skipping
        * Continuing to next available version: binary reported version ("0.0.1") is different from the expected "3.2.1", skipping
        * could not get sha256 checksum file for github.com/YaleUniversity/goss version 3.2.0. Is the file present on the release and correctly named ? GET https://github.com/YaleUniversity/packer-plugin-goss/releases/download/v3.2.0/packer-plugin-goss_v3.2.0_SHA256SUMS: 404  []
        * could not install any compatible version of plugin "github.com/YaleUniversity/goss"

It seems there's an issue with setting the version number using ldflags in Goreleaser: https://github.com/YaleUniversity/packer-plugin-goss/blob/master/main.go#L14

@FalcoSuessgott
Copy link
Collaborator

You have to use the latest plugin version (3.2.10) in your packer plugin configuration

@F21
Copy link
Contributor Author

F21 commented Jun 5, 2024

I am using:

 goss = {
      version = "~> 3.2"
      source  = "github.com/YaleUniversity/goss"
    }

From testing locally, I don't think main.Version is being set correctly in goreleaser's ldflags config.

@FalcoSuessgott
Copy link
Collaborator

Will check asap, something is going on I tested the release CI assets a few times but I guess one PR messed with the goreleaser config ..

@F21
Copy link
Contributor Author

F21 commented Jun 5, 2024

I don't think it was ever working properly before. Looking at the history of .goreleaser.yml, these 2 lines have never changed:

I think the version has always been set to 0.0.1 and packer has only started enforcing the version check in the 1.11.z release.

@FalcoSuessgott
Copy link
Collaborator

Yeah seems likes it but a local packer init has always worked for me. But will investigate later and hopefully fix it for good

@F21
Copy link
Contributor Author

F21 commented Jun 5, 2024

The plugin version check was only released in Packer 1.11.0, which was released a few days ago.
See:

@FalcoSuessgott
Copy link
Collaborator

Oh that makes sense! Thanks for investigating

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

Successfully merging a pull request may close this issue.

2 participants