pulumi/pulumi · error

marshaling provider inputs: %w

Error message

marshaling provider inputs: %w

What it means

Before invoking the provider's Configure RPC, the whole provider input PropertyMap is marshaled to protobuf Struct form via MarshalProperties. If that marshaling fails (unsupported value kinds, assets with reject flags, invalid values), the error is wrapped as "marshaling provider inputs", the config source is rejected, and Configure aborts. Like 3110 it is a wrapper; the %w cause carries the real reason.

Source

Thrown at sdk/go/common/resource/plugin/provider_plugin.go:1100

				err := fmt.Errorf("marshaling configuration property '%v': %w", k, err)
				p.configSource.MustReject(err)
				return ConfigureResponse{}, err
			}
			mapped = string(marshalled)
		}

		variables[string(pkg)+":config:"+string(k)] = mapped.(string)
	}

	minputs, err := MarshalProperties(req.Inputs, MarshalOptions{
		Label:         label + ".inputs",
		KeepUnknowns:  true,
		KeepSecrets:   true,
		KeepResources: true,
		PropagateNil:  true,
	})
	if err != nil {
		err := fmt.Errorf("marshaling provider inputs: %w", err)
		p.configSource.MustReject(err)
		return ConfigureResponse{}, err
	}

	// Spawn the configure to happen in parallel.  This ensures that we remain responsive elsewhere that might
	// want to make forward progress, even as the configure call is happening.
	go func() {
		var urn, typ, id *string
		if req.URN != nil {
			urnVal := string(*req.URN)
			urn = &urnVal
		}
		if req.ID != nil {
			idVal := string(*req.ID)
			id = &idVal
		}
		if req.Type != nil {
			typVal := string(*req.Type)

View on GitHub (pinned to 793f7b2e16)

Solutions

  1. Read the wrapped cause from %w to find the offending property and fix its value kind.
  2. Validate the inputs PropertyMap (no exotic/unsupported signatures) before calling Configure.
  3. Rebuild/upgrade the Go SDK and engine together so property marshaling is version-consistent.
  4. Reduce the input to a minimal set and add properties back until the failing one is isolated.

Example fix

// before: synthetic property with no valid kind
inputs["weird"] = resource.NewProperty(someUnsupportedGoValue)
// after: use a supported property
inputs["weird"] = resource.NewProperty("supported-string")
Defensive patterns

Strategy: validation

Validate before calling

// Sanity-check the inputs PropertyMap before Configure
err := inputs.Validate(func(k resource.PropertyKey, v resource.PropertyValue) error {
    if v.IsSecret() && !keepSecrets {
        return fmt.Errorf("unexpected secret at %q", k)
    }
    return nil
})

Type guard

func hasExoticValues(m resource.PropertyMap) bool {
    for _, v := range m {
        if !(v.IsString() || v.IsNumber() || v.IsBool() || v.IsArray() || v.IsObject() || v.IsNull()) {
            return true
        }
    }
    return false
}

Prevention

When it happens

Trigger: Calling Configure on a Go provider whose req.GetArgs() property map fails MarshalProperties — e.g. a nested object value the marshaller cannot represent, an invalid secret/asset signature, or unknowns handled contrary to the KeepUnknowns/KeepSecrets options in effect.

Common situations: Passing hand-built PropertyMaps in tests with synthetic signatures; engine/provider version drift introducing new property kinds an older SDK cannot marshal; corrupted state producing malformed property values.

Related errors


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