dagger/dagger · error

decode persisted cache volume payload: %w

Error message

decode persisted cache volume payload: %w

What it means

Wrap from CacheVolume.DecodePersistedObject when the persisted payload JSON cannot be unmarshalled into persistedCacheVolumePayload. Means the cache volume ID's embedded payload is corrupt or was written by an incompatible Dagger version.

Source

Thrown at core/cache.go:401

		Selector  string           `json:"selector,omitempty"`
	}{
		Key:       cache.Key,
		Namespace: cache.Namespace,
		SourceID:  sourceID,
		Sharing:   cache.Sharing,
		Owner:     cache.Owner,
		Selector:  selector,
	})
	if err != nil {
		return "", fmt.Errorf("marshal cache volume lock key: %w", err)
	}
	return "cache-volume:" + string(payload), nil
}

func (*CacheVolume) DecodePersistedObject(ctx context.Context, dag *dagql.Server, resultID uint64, _ *dagql.ResultCall, payload json.RawMessage) (dagql.Typed, error) {
	var persisted persistedCacheVolumePayload
	if err := json.Unmarshal(payload, &persisted); err != nil {
		return nil, fmt.Errorf("decode persisted cache volume payload: %w", err)
	}

	source := dagql.Nullable[dagql.ObjectResult[*Directory]]{}
	if persisted.SourceResultID != 0 {
		sourceRes, err := loadPersistedObjectResultByResultID[*Directory](ctx, dag, persisted.SourceResultID, "cache volume source")
		if err != nil {
			return nil, err
		}
		if sourceRes.Self() != nil {
			source = dagql.NonNull(sourceRes)
		}
	}

	cache := NewCache(
		persisted.Key,
		persisted.Namespace,
		source,
		persisted.Sharing,

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Create a fresh CacheVolume instead of reusing the old ID
  2. Check for engine version mismatch when reusing cached IDs
  3. Inspect the payload in the ID for corruption
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at core/cache.go:401 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/a3072c9fc7c9b26f. Report an issue: GitHub.