dapr/dapr · error
failed to marshal response as JSON: %w
Error message
failed to marshal response as JSON: %w
What it means
Error "failed to marshal response as JSON: %w" thrown in dapr/dapr.
Source
Thrown at pkg/api/http/lock.go:89
)
}
func (a *api) onUnlockAlpha1() http.HandlerFunc {
return UniversalHTTPHandler(
a.universal.UnlockAlpha1,
UniversalHTTPHandlerOpts[*runtimev1pb.UnlockRequest, *runtimev1pb.UnlockResponse]{
InModifier: func(r *http.Request, in *runtimev1pb.UnlockRequest) (*runtimev1pb.UnlockRequest, error) {
in.StoreName = chi.URLParam(r, storeNameParam)
return in, nil
},
OutModifier: func(out *runtimev1pb.UnlockResponse) (any, error) {
// Create the response manually because we want to report the status as a number and not a string
b, err := protojson.MarshalOptions{
EmitUnpopulated: true,
UseEnumNumbers: true,
}.Marshal(out)
if err != nil {
return nil, fmt.Errorf("failed to marshal response as JSON: %w", err)
}
return UniversalHTTPRawResponse{
Body: b,
ContentType: jsonContentTypeHeader,
}, nil
},
},
)
}
View on GitHub (pinned to 74ad417027)
When it happens
Trigger: Thrown at pkg/api/http/lock.go:89 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of dapr/dapr@74ad417027 (2026-08-16).
Data as JSON: /api/errors/12ca9a604d97d636.
Report an issue: GitHub.