{"record":{"id":"a857ab85bf68127f","repo":"mattermost-community/focalboard","slug":"invalid-property","errorCode":null,"errorMessage":"invalid property","messagePattern":"invalid property","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/model/properties.go","lineNumber":19,"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\"`\n\tName  string `json:\"name\"`","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/mattermost-community/focalboard/blob/a84bbb65e32edf972856b329417096ac413518e9/server/model/properties.go#L1-L37","documentation":"ErrInvalidProperty indicates a property referenced by a card does not exist in the board's property schema, or a properties map cannot be parsed correctly. It is returned by GetPropertyString, GetValue, and ParseProperties. The library throws it so callers know a property key/value pair cannot be resolved against the board's defined schema.","triggerScenarios":"Looking up a property value via GetPropertyString/GetValue with a key absent from the board's cardProperties, or calling ParseProperties on a card whose properties map references undefined schema entries.","commonSituations":"A board property was deleted while cards still carry the old key, cards copied between boards with different schemas, or plugin/API clients referencing hand-crafted property ids.","solutions":["Remove the stale property key from the card, or re-add the missing property definition to the board's cardProperties.","When copying cards across boards, remap property ids to the target board's schema first.","Verify the property id used matches an existing cardProperties entry exactly.","Wrap reads with errors.Is(err, model.ErrInvalidProperty) and skip/treat as empty instead of failing the whole request."],"exampleFix":"// before: blind read panics on missing schema entry\nval, err := card.FieldValueAsString(props, \"stale_prop_id\")\n// after\nif _, ok := board.CardProperties[\"stale_prop_id\"]; !ok {\n    return \"\", nil // property no longer defined on this board\n}\nval, err := card.FieldValueAsString(props, \"stale_prop_id\")","handlingStrategy":"try-catch","validationCode":"func propDefined(board *model.Board, key string) bool {\n    _, ok := board.CardProperties[key]\n    return ok\n}\n// check before reading: if !propDefined(board, key) { skip }","typeGuard":"func propertyExists(board *model.Board, key string) bool {\n    _, ok := board.CardProperties[key]\n    return ok\n}","tryCatchPattern":"val, err := GetValue(resolver, board, props, key)\nif errors.Is(err, model.ErrInvalidProperty) {\n    val = \"\" // property no longer in schema; treat as unset\n}","preventionTips":["Delete card property values when removing the property definition from the board.","Remap property ids when copying cards across boards.","Check property existence before programmatic reads."],"tags":["go","properties","data-validation"],"backgroundTag":"unknown-property-key","analyzedSha":"a84bbb65e32edf972856b329417096ac413518e9","analyzedAt":"2026-08-30T09:22:20.720Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}