{"record":{"id":"c01166467a50a28d","repo":"mattermost-community/focalboard","slug":"invalid-property-schema","errorCode":null,"errorMessage":"invalid property schema","messagePattern":"invalid property schema","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/model/properties.go","lineNumber":18,"sourceCode":"// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.\n// See LICENSE.txt for license information.\n\n//go:generate mockgen -destination=mocks/propValueResolverMock.go -package mocks . PropValueResolver\n\npackage model\n\nimport (\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/mattermost/focalboard/server/utils\"\n)\n\nvar ErrInvalidBoardBlock = errors.New(\"invalid board block\")\nvar ErrInvalidPropSchema = errors.New(\"invalid property schema\")\nvar ErrInvalidProperty = errors.New(\"invalid property\")\nvar ErrInvalidPropertyValue = errors.New(\"invalid property value\")\nvar ErrInvalidPropertyValueType = errors.New(\"invalid property value type\")\nvar ErrInvalidDate = errors.New(\"invalid date property\")\n\n// PropValueResolver allows PropDef.GetValue to further decode property values, such as\n// looking up usernames from ids.\ntype PropValueResolver interface {\n\tGetUserByID(userID string) (*User, error)\n}\n\n// BlockProperties is a map of Prop's keyed by property id.\ntype BlockProperties map[string]BlockProp\n\n// BlockProp represent a property attached to a block (typically a card).\ntype BlockProp struct {\n\tID    string `json:\"id\"`\n\tIndex int    `json:\"index\"`","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/model/properties.go#L1-L36","documentation":"ErrInvalidPropSchema indicates that a board's property schema (the 'cardProperties' definitions) is malformed or cannot be parsed into the expected PropDef structure. ParsePropertySchema returns it so callers can distinguish bad schema data from other failures. It prevents property values from being interpreted against an unusable schema.","triggerScenarios":"Calling ParsePropertySchema on a board whose cardProperties array contains entries missing required fields (e.g. id, name, type) or whose JSON cannot unmarshal into the property-definition shape.","commonSituations":"Boards created by older Focalboard versions with legacy property definitions, boards edited directly in the database, or sync/import from external tools writing non-conforming cardProperties.","solutions":["Fix the board's cardProperties array so every property has a valid id, name, and type.","Re-create the board or re-import a clean archive if the schema in the DB is corrupted.","Compare the schema against a working board export to identify the non-conforming property entry.","Upgrade/outdated clients or migrations so legacy property formats are converted before use."],"exampleFix":"// before: schema entry missing type\n{\"id\":\"prp1\",\"name\":\"Status\",\"options\":[]}\n// after\n{\"id\":\"prp1\",\"name\":\"Status\",\"type\":\"select\",\"options\":[]}","handlingStrategy":"validation","validationCode":"func validatePropSchema(props []model.PropDef) error {\n    for _, p := range props {\n        if p.ID == \"\" || p.Name == \"\" || p.Type == \"\" {\n            return fmt.Errorf(\"property %q missing id/name/type\", p.ID)\n        }\n    }\n    return nil\n}","typeGuard":"func hasValidSchema(board *model.Board) bool {\n    for _, p := range board.CardProperties {\n        if p.ID == \"\" || p.Type == \"\" {\n            return false\n        }\n    }\n    return true\n}","tryCatchPattern":"schema, err := board.ParsePropertySchema()\nif errors.Is(err, model.ErrInvalidPropSchema) {\n    log.Error(\"board has corrupt cardProperties; repairing or recreating board\")\n    return\n}","preventionTips":["Avoid editing cardProperties directly in the database.","Test imports/syncs against boards from the same app version.","Include schema checks in board import/copy routines."],"tags":["go","schema","properties"],"backgroundTag":"schema-validation-failed","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}