pulumi/pulumi · error

no version specified, please set a version in the package sc

Error message

no version specified, please set a version in the package schema

What it means

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.

Source

Thrown at pkg/cmd/pulumi/packagecmd/package_publish.go:234

		}
		if publisher == "" {
			return errors.New("no publisher specified and no default organization found, please set a publisher in " +
				"the package schema or set a default organization in your pulumi config")
		}
	}

	name := pkg.Name
	if name == "" {
		return errors.New("no package name specified, please set one in the package schema")
	}
	var version semver.Version
	if pkg.Version != "" {
		version, err = semver.Parse(pkg.Version)
		if err != nil {
			return fmt.Errorf("invalid version %q in package schema: %w", pkg.Version, err)
		}
	} else {
		return errors.New("no version specified, please set a version in the package schema")
	}

	jsonData, err := json.Marshal(pkg)
	if err != nil {
		return fmt.Errorf("failed to marshal schema: %w", err)
	}

	registry, err := b.GetCloudRegistry()
	if err != nil {
		return fmt.Errorf("failed to get the Private Registry backend: %w", err)
	}

	// We need to set the content-size header for S3 puts. For byte buffers (or deterministic readers)
	// the stdlib http client does that automatically. For os.File it cannot do that because the size
	// returned by Stat() is not reliable:
	// - Another process might modify the file by appending to it or truncating it
	// - If the file is a special file like a device file, pipe, or socket, its size may change dynamically
	// - On network filesystems, there could be caching or synchronization issues

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Add "version": "x.y.z" (valid semver) to the package schema and retry
  2. If the schema is generated, ensure the generation pipeline stamps a version

Example fix

// before (schema.json)
{ "name": "my-package" }
// after
{ "name": "my-package", "version": "0.1.0" }
Defensive patterns

Strategy: validation

Validate before calling

if schema.Version == "" {
    return fmt.Errorf("schema is missing required \"version\" field")
}

Prevention

When it happens

Trigger: `pulumi package publish` with a schema JSON that omits the `version` field entirely or has it set to "".

Common situations: 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.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pulumi/pulumi@793f7b2e16 (2026-08-31). Data as JSON: /api/errors/552a9edd0a279004. Report an issue: GitHub.