temporalio/temporal · error
Can't deep copy value of type %s: %v
Error message
Can't deep copy value of type %s: %v
What it means
deepCopyValue handles only the concrete kinds the dynamicconfig default-copy supports (structs, maps, slices, pointers to those, basic scalars). Any other value — e.g. a func, chan, or unhandled composite — reaches the default branch and panics. Like error 613, it fires from static initializers when a setting default contains an unsupported type.
Source
Thrown at common/dynamicconfig/deepcopy.go:76
return reflect.ValueOf(time.Time{})
}
// nolint:forbidigo // this will be triggered from a static initializer before it can be triggered from production code
panic(fmt.Sprintf("Can't deep copy non-zero time.Time: %v", v.Interface()))
}
nv := reflect.New(v.Type()).Elem()
for i := range v.Type().NumField() {
nv.Field(i).Set(deepCopyValue(v.Field(i)))
}
return nv
case reflect.Interface, reflect.Func, reflect.Chan:
// only nil values of any other reference types allowed!
if v.IsNil() {
return v
}
fallthrough
default:
// nolint:forbidigo // this will be triggered from a static initializer before it can be triggered from production code
panic(fmt.Sprintf("Can't deep copy value of type %s: %v", v.Type(), v))
}
}
View on GitHub (pinned to bde624efd1)
Solutions
- Remove or retype the unsupported field in the setting's default value
- Add a case in deepCopyValue for the needed reflect.Kind if genuinely required
- Flatten the default struct so it only contains scalars, strings, slices, maps, and nested structs
Example fix
// before
Setting{Callback: func() {}}
// after
Setting{} // handle callbacks outside the config default value Defensive patterns
Strategy: validation
Validate before calling
// reject chan/func/unsafe kinds in defaults
Prevention
- Restrict default structs to plain data types
When it happens
Trigger: Declaring a dynamicconfig setting whose default value contains a field/value of an unsupported type (func, chan, interface holding something exotic, unsafe pointer) which deepCopyValue recursively encounters.
Common situations: Adding a callback field to a config struct default; nesting a map with non-copyable values; upgrading a setting's struct with a new field of an unhandled type.
Related errors
- Can't deep copy non-zero time.Time: %v
- ConvertGradualChange can only be used with scalar types for
- dynamicconfig.New*Setting must only be called from static in
- duplicate registration of dynamic config key: %q
- unsupported error type: %v
AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01).
Data as JSON: /api/errors/8e0fc1faeac54750.
Report an issue: GitHub.