{"record":{"id":"605c6ba90e1b54da","repo":"pulumi/pulumi","slug":"module-does-not-have-semver-compatible-version","errorCode":null,"errorMessage":"module does not have semver compatible version","messagePattern":"module does not have semver compatible version","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdk/go/pulumi-language-go/main.go","lineNumber":648,"sourceCode":"\t}\n\n\tfor _, path := range paths {\n\t\tplugin, err := plugin.LoadPulumiPluginJSON(path)\n\t\tif err != nil {\n\t\t\tif os.IsNotExist(err) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\treturn plugin, nil\n\t}\n\treturn nil, nil\n}\n\nfunc normalizeVersion(version string) (string, error) {\n\tv, err := semver.ParseTolerant(version)\n\tif err != nil {\n\t\treturn \"\", errors.New(\"module does not have semver compatible version\")\n\t}\n\n\t// psuedoversions are commits that don't have a corresponding tag at the specified git hash\n\t// https://golang.org/cmd/go/#hdr-Pseudo_versions\n\t// pulumi-aws v1.29.1-0.20200403140640-efb5e2a48a86 (first commit after 1.29.0 release)\n\tif buildutil.IsPseudoVersion(version) {\n\t\t// no prior tag means there was never a release build\n\t\tif v.Major == 0 && v.Minor == 0 && v.Patch == 0 {\n\t\t\treturn \"\", errors.New(\"invalid pseduoversion with no prior tag\")\n\t\t}\n\t\t// patch is typically bumped from the previous tag when using pseudo version\n\t\t// downgrade the patch by 1 to make sure we match a release that exists\n\t\tpatch := v.Patch\n\t\tif patch > 0 {\n\t\t\tpatch--\n\t\t}\n\t\tversion = fmt.Sprintf(\"v%v.%v.%v\", v.Major, v.Minor, patch)\n\t}","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/sdk/go/pulumi-language-go/main.go#L630-L666","documentation":"normalizeVersion must produce a semver version for a provider dependency so it can be reported to the engine. When semver.ParseTolerant cannot parse the module's version string, this error is thrown. It happens when a module's resolved version is not a real semantic version (e.g. a module with no tagged release resolved to a bare revision, or a hand-edited go.mod with a bogus version).","triggerScenarios":"GetRequiredPackages -> getPackage -> normalizeVersion: m.Version (or pulumi-plugin.json Version, if set) cannot be parsed by semver.ParseTolerant.","commonSituations":"A pulumi provider dependency replaced with a local path (go.mod `replace` directive) so no version exists; a module fetched by branch/commit without tags; pulumi-plugin.json containing a non-semver Version like \"main\" or \"latest\".","solutions":["Check go.mod for a `replace` directive pointing the provider at a local directory and pin a tagged version instead.","Ensure the provider module has a valid semver git tag (e.g. v1.29.1) and re-run `go mod tidy`.","If pulumi-plugin.json in the provider module sets a Version, make it valid semver.","Use a pseudo-version pin (`go get module@commit`) rather than an untagged branch reference, so a parseable version resolves."],"exampleFix":"// before (go.mod)\nreplace github.com/pulumi/pulumi-aws/sdk => ../pulumi-aws/sdk\n// after\nrequire github.com/pulumi/pulumi-aws/sdk v1.29.1","handlingStrategy":"validation","validationCode":"// shell, before pulumi up\nver=$(go list -m -f '{{.Version}}' github.com/pulumi/pulumi-aws/sdk)\nsemver_regex='^v?[0-9]+\\.[0-9]+\\.[0-9]+'\necho \"$ver\" | grep -Eq \"$semver_regex\" || echo \"non-semver version: $ver\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid long-lived `replace` directives to local paths in committed go.mod.","Only depend on provider SDK modules that have semver tags.","Never set pulumi-plugin.json Version to non-semver values like \"latest\" or a branch name."],"tags":["go","semver","versioning","providers"],"backgroundTag":"invalid-semver-version","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}