SigNoz/signoz · error
invalid_input
invalid_input
Error message
lock is missing in the request payload
What it means
LockUnlockDashboard.UnmarshalJSON requires an explicit locked field (JSON boolean, including false). Because Locked is a *bool, absence of the key leaves it nil, which is indistinguishable from an omitted field and is rejected to prevent accidental defaulting.
Source
Thrown at pkg/types/dashboardtypes/dashboard.go:322
}
dashboard.Locked = lock
dashboard.UpdatedBy = updatedBy
dashboard.UpdatedAt = time.Now()
return nil
}
func (lockUnlockDashboard *LockUnlockDashboard) UnmarshalJSON(src []byte) error {
var lockUnlock struct {
Locked *bool `json:"lock"`
}
err := json.Unmarshal(src, &lockUnlock)
if err != nil {
return err
}
if lockUnlock.Locked == nil {
return errors.New(errors.TypeInvalidInput, errors.CodeInvalidInput, "lock is missing in the request payload")
}
lockUnlockDashboard.Locked = lockUnlock.Locked
return nil
}
func (dashboard *Dashboard) GetWidgetQuery(startTime, endTime, widgetIndex uint64, logger *slog.Logger) (*querybuildertypesv5.QueryRangeRequest, error) {
type dashboardData struct {
Widgets []struct {
PanelTypes string `json:"panelTypes"`
Query struct {
Builder struct {
QueryData []map[string]any `json:"queryData"`
QueryFormulas []map[string]any `json:"queryFormulas"`
QueryTraceOperator []map[string]any `json:"queryTraceOperator"`
} `json:"builder"`
ClickhouseSQL []map[string]any `json:"clickhouse_sql"`
PromQL []map[string]any `json:"promql"`View on GitHub (pinned to 5069bf80b0)
Solutions
- Always send an explicit boolean: {"locked":false} to unlock
- Remove omitempty from the Locked field in client structs
- Check exact field name is locked (lowercase)
- Add payload logging to catch null/absent values
Example fix
// before
{"locked":null}
// after
{"locked":false}
Defensive patterns
Strategy: type-guard
Validate before calling
if (typeof body.locked !== 'boolean') throw new Error('locked must be an explicit boolean'); Type guard
function hasExplicitLocked(b: unknown): b is { locked: boolean } { return typeof (b as any)?.locked === 'boolean'; } Prevention
- Never use omitempty on tri-state booleans
- Distinguish null vs false explicitly in client models
When it happens
Trigger: PATCH/POST lock-unlock endpoint with body {} or {"locked":null} instead of {"locked":true} or {"locked":false}.
Common situations: Clients constructing payloads with omitempty that drop false values; confusion between null and false; typos in field name (lock vs locked).
Related errors
- ErrCodeRoleInvalidInput
- ErrCodeUserRoleInvalidInput
- dashboard_invalid_patch
- public_dashboard_invalid_input
- CodeInvalidInput
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/f320b9548b7e3daf.
Report an issue: GitHub.