mattermost-community/focalboard · warning

invalid property value

Error message

invalid property value

What it means

ErrInvalidPropertyValue means a stored property value cannot be interpreted according to its property definition, e.g. a select value that is not among the declared options. GetPropertyString and GetValue return it when decoding the raw value fails. It guards against silently rendering meaningless data.

Source

Thrown at server/model/properties.go:20

// See LICENSE.txt for license information.

//go:generate mockgen -destination=mocks/propValueResolverMock.go -package mocks . PropValueResolver

package model

import (
	"encoding/json"
	"errors"
	"fmt"
	"strings"

	"github.com/mattermost/focalboard/server/utils"
)

var ErrInvalidBoardBlock = errors.New("invalid board block")
var ErrInvalidPropSchema = errors.New("invalid property schema")
var ErrInvalidProperty = errors.New("invalid property")
var ErrInvalidPropertyValue = errors.New("invalid property value")
var ErrInvalidPropertyValueType = errors.New("invalid property value type")
var ErrInvalidDate = errors.New("invalid date property")

// PropValueResolver allows PropDef.GetValue to further decode property values, such as
// looking up usernames from ids.
type PropValueResolver interface {
	GetUserByID(userID string) (*User, error)
}

// BlockProperties is a map of Prop's keyed by property id.
type BlockProperties map[string]BlockProp

// BlockProp represent a property attached to a block (typically a card).
type BlockProp struct {
	ID    string `json:"id"`
	Index int    `json:"index"`
	Name  string `json:"name"`
	Value string `json:"value"`

View on GitHub (pinned to a84bbb65e3)

Solutions

  1. Reset the card's property value to a valid option (or empty) via the UI or API.
  2. Update the board's property definition options to include the stored value's id.
  3. Check that the value format matches the property type before writing via the API.
  4. Handle the error gracefully on read: treat invalid values as blank and log for cleanup.

Example fix

// before: writing a raw label instead of an option id
props["status"] = "Done"
// after: write the option id from the schema
props["status"] = board.CardProperties["status"].Options[1].ID
Defensive patterns

Strategy: validation

Validate before calling

func isValidPropValue(def model.PropDef, value interface{}) bool {
    switch def.Type {
    case "select":
        s, _ := value.(string)
        for _, o := range def.Options {
            if o.ID == s {
                return true
            }
        }
        return false
    }
    return true
}

Type guard

func isKnownOption(def model.PropDef, optionID string) bool {
    for _, o := range def.Options {
        if o.ID == optionID {
            return true
        }
    }
    return false
}

Try / catch

val, err := GetValue(resolver, board, props, key)
if errors.Is(err, model.ErrInvalidPropertyValue) {
    log.Warn("stale property value; treating as empty", "key", key)
    val = ""
}

Prevention

When it happens

Trigger: Calling GetValue/GetPropertyString where the raw value does not match the PropDef type's expected shape (e.g. select option id not present in options list, malformed multi-select value, unparseable person/date value).

Common situations: Values written by an older client version, values copied from a board whose options differ, direct DB edits, or imports from other tools writing raw strings instead of option ids.

Related errors


AI-assisted analysis of mattermost-community/focalboard@a84bbb65e3 (2026-08-30). Data as JSON: /api/errors/822ac7d570588af2. Report an issue: GitHub.