{"record":{"id":"f14b3220e1e753ea","repo":"SigNoz/signoz","slug":"errors-codeinvalidinput-f14b32","errorCode":"errors.CodeInvalidInput","errorMessage":"id is not a valid uuid","messagePattern":"id is not a valid uuid","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/types/dashboardtypes/dashboard.go","lineNumber":78,"sourceCode":"\n\tUpdatableDashboard = StorableDashboardData\n\n\tPostableDashboard = StorableDashboardData\n\n\tListableDashboard []*GettableDashboard\n)\n\n// readString reads a string field from the untyped data blob, yielding \"\" when\n// the key is absent, null, or not a string.\nfunc (d StorableDashboardData) readString(key string) string {\n\ts, _ := d[key].(string)\n\treturn s\n}\n\nfunc NewStorableDashboardFromDashboard(dashboard *Dashboard) (*StorableDashboard, error) {\n\tdashboardID, err := valuer.NewUUID(dashboard.ID)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, errors.TypeInvalidInput, errors.CodeInvalidInput, \"id is not a valid uuid\")\n\t}\n\n\tif !dashboard.Source.IsValid() {\n\t\treturn nil, errors.Newf(errors.TypeInvalidInput, ErrCodeDashboardInvalidSource, \"invalid dashboard source %q, must be one of user, system, integration\", dashboard.Source.StringValue())\n\t}\n\n\treturn &StorableDashboard{\n\t\tIdentifiable: types.Identifiable{\n\t\t\tID: dashboardID,\n\t\t},\n\t\tTimeAuditable: types.TimeAuditable{\n\t\t\tCreatedAt: dashboard.CreatedAt,\n\t\t\tUpdatedAt: dashboard.UpdatedAt,\n\t\t},\n\t\tUserAuditable: types.UserAuditable{\n\t\t\tCreatedBy: dashboard.CreatedBy,\n\t\t\tUpdatedBy: dashboard.UpdatedBy,\n\t\t},","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/types/dashboardtypes/dashboard.go#L60-L96","documentation":"NewStorableDashboardFromDashboard converts a Dashboard into its storable form by parsing dashboard.ID with valuer.NewUUID. If the ID is not a parseable UUID (empty string, random string, malformed), the UUID parse fails and this invalid-input error is returned.","triggerScenarios":"Calling Create/Update/LockUnlock with dashboard.ID set to a non-UUID string such as \"my-dashboard\" or an empty string where a UUID is required.","commonSituations":"Clients generating their own slug-style IDs instead of server-assigned UUIDs; frontend forms not clearing an ID field on clone/duplicate flows; test fixtures with placeholder IDs like \"test-1\".","solutions":["Omit/empty the ID for Create so a UUID is generated server-side, and pass the returned UUID on Update","Generate a proper UUID (github.com/google/uuid.New()) client-side if you must supply an ID","Validate the ID format before calling the API"],"exampleFix":"// before\ndashboard.ID = \"my-cool-dashboard\"\n\n// after\nimport \"github.com/google/uuid\"\ndashboard.ID = uuid.New().String()","handlingStrategy":"validation","validationCode":"import (\n  \"github.com/google/uuid\"\n)\n\nfunc validDashboardID(id string) bool {\n    if id == \"\" { return true } // server assigns on create\n    _, err := uuid.Parse(id)\n    return err == nil\n}","typeGuard":"func isUUID(s string) bool {\n    if s == \"\" { return false }\n    _, err := uuid.Parse(s)\n    return err == nil\n}","tryCatchPattern":"sd, err := NewStorableDashboardFromDashboard(d)\nif err != nil && strings.Contains(err.Error(), \"id is not a valid uuid\") {\n    d.ID = uuid.New().String()\n    sd, err = NewStorableDashboardFromDashboard(d)\n}","preventionTips":["Leave ID empty on create; use the server-returned UUID thereafter","Clear IDs on clone/duplicate flows"],"tags":["uuid","dashboard","validation","id"],"backgroundTag":"invalid-uuid-format","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}