{"record":{"id":"dcfd88ff3b71ed5f","repo":"pulumi/pulumi","slug":"invalid-version-q-in-package-schema-w","errorCode":null,"errorMessage":"invalid version %q in package schema: %w","messagePattern":"invalid version %q in package schema: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/packagecmd/package_publish.go","lineNumber":231,"sourceCode":"\t\tpublisher, err = b.GetDefaultOrg(ctx)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to determine default organization: %w\", err)\n\t\t}\n\t\tif publisher == \"\" {\n\t\t\treturn errors.New(\"no publisher specified and no default organization found, please set a publisher in \" +\n\t\t\t\t\"the package schema or set a default organization in your pulumi config\")\n\t\t}\n\t}\n\n\tname := pkg.Name\n\tif name == \"\" {\n\t\treturn errors.New(\"no package name specified, please set one in the package schema\")\n\t}\n\tvar version semver.Version\n\tif pkg.Version != \"\" {\n\t\tversion, err = semver.Parse(pkg.Version)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"invalid version %q in package schema: %w\", pkg.Version, err)\n\t\t}\n\t} else {\n\t\treturn errors.New(\"no version specified, please set a version in the package schema\")\n\t}\n\n\tjsonData, err := json.Marshal(pkg)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to marshal schema: %w\", err)\n\t}\n\n\tregistry, err := b.GetCloudRegistry()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to get the Private Registry backend: %w\", err)\n\t}\n\n\t// We need to set the content-size header for S3 puts. For byte buffers (or deterministic readers)\n\t// the stdlib http client does that automatically. For os.File it cannot do that because the size\n\t// returned by Stat() is not reliable:","sourceCodeStart":213,"sourceCodeEnd":249,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/packagecmd/package_publish.go#L213-L249","documentation":"The schema's version string failed semver parsing. Run() validates pkg.Version with semver.Parse before publishing and wraps the parse error in this message with %q showing the offending value.","triggerScenarios":"`pulumi package publish` with a schema whose `version` field is not valid semantic versioning, e.g. \"1.0\", \"v1.0.0\" with a prefix semver rejects, \"1.0.0-beta bad\", or containing whitespace/garbage.","commonSituations":"Hand-edited schema versions missing a component (\"1.0\"); build tooling writing \"v\"-prefixed tags into the schema; placeholder versions like \"dev\" or \"latest\" left in the schema.","solutions":["Fix the version in the schema to a valid semver string like 1.0.0 (MAJOR.MINOR.PATCH, optional -prerelease)","Check the wrapped error (%w) for the exact parse failure position","If the version comes from a build script, correct the script's template"],"exampleFix":"// before (schema.json)\n{ \"version\": \"1.0\" }\n// after\n{ \"version\": \"1.0.0\" }","handlingStrategy":"validation","validationCode":"if _, err := semver.Parse(schema.Version); err != nil {\n    return fmt.Errorf(\"schema version %q is not valid semver: %v\", schema.Version, err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use automated versioning (git tag -> semver) instead of hand-editing","Strip leading \"v\" from tags before writing into the schema","Test-parse versions in CI before publishing"],"tags":["pulumi-cli","semver","schema"],"backgroundTag":"invalid-semver","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}