{"record":{"id":"552a9edd0a279004","repo":"pulumi/pulumi","slug":"no-version-specified-please-set-a-version-in-the","errorCode":null,"errorMessage":"no version specified, please set a version in the package schema","messagePattern":"no version specified, please set a version in the package schema","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/pulumi/packagecmd/package_publish.go","lineNumber":234,"sourceCode":"\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:\n\t// - Another process might modify the file by appending to it or truncating it\n\t// - If the file is a special file like a device file, pipe, or socket, its size may change dynamically\n\t// - On network filesystems, there could be caching or synchronization issues","sourceCodeStart":216,"sourceCodeEnd":252,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/cmd/pulumi/packagecmd/package_publish.go#L216-L252","documentation":"The package schema must carry a version to publish. Run() checks pkg.Version after the name check; if it is empty, it aborts with this error instead of attempting to publish a versionless package.","triggerScenarios":"`pulumi package publish` with a schema JSON that omits the `version` field entirely or has it set to \"\".","commonSituations":"Minimal hand-written schemas that include name but not version; generated schemas from providers that do not report a version; templates where version is meant to be injected at build time but the injection step was skipped.","solutions":["Add \"version\": \"x.y.z\" (valid semver) to the package schema and retry","If the schema is generated, ensure the generation pipeline stamps a version"],"exampleFix":"// before (schema.json)\n{ \"name\": \"my-package\" }\n// after\n{ \"name\": \"my-package\", \"version\": \"0.1.0\" }","handlingStrategy":"validation","validationCode":"if schema.Version == \"\" {\n    return fmt.Errorf(\"schema is missing required \\\"version\\\" field\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Stamp the version in the schema during the build step","Validate the schema JSON before every publish"],"tags":["pulumi-cli","package-publish","schema"],"backgroundTag":"missing-required-field","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}