temporalio/temporal · critical

unable to decode cassandra serial consistency: %v

Error message

unable to decode cassandra serial consistency: %v

What it means

CassandraStoreConsistency.GetSerialConsistency parses the configured SerialConsistency string via parseSerialConsistency; if the value is not a recognized serial consistency (e.g. 'serial'/'local_serial'), it panics. This fails fast at store construction because an invalid consistency setting would break every CassCacheSession query.

Source

Thrown at common/config/persistence.go:207

	}
	if ds.Elasticsearch != nil {
		if err := ds.Elasticsearch.Validate(); err != nil {
			return err
		}
	}
	return nil
}

// GetConsistency returns the gosql.Consistency setting from the configuration for the given store type
func (c *CassandraStoreConsistency) GetConsistency() gocql.Consistency {
	return gocql.ParseConsistency(c.getConsistencySettings().Consistency)
}

// GetSerialConsistency returns the gosql.SerialConsistency setting from the configuration for the store
func (c *CassandraStoreConsistency) GetSerialConsistency() gocql.SerialConsistency {
	res, err := parseSerialConsistency(c.getConsistencySettings().SerialConsistency)
	if err != nil {
		panic(fmt.Sprintf("unable to decode cassandra serial consistency: %v", err))
	}
	return res
}

func (c *CassandraStoreConsistency) getConsistencySettings() *CassandraConsistencySettings {
	return ensureStoreConsistencyNotNil(c).Default
}

func ensureStoreConsistencyNotNil(c *CassandraStoreConsistency) *CassandraStoreConsistency {
	if c == nil {
		c = &CassandraStoreConsistency{}
	}
	if c.Default == nil {
		c.Default = &CassandraConsistencySettings{}
	}
	if c.Default.Consistency == "" {
		c.Default.Consistency = "LOCAL_QUORUM"
	}

View on GitHub (pinned to bde624efd1)

Solutions

  1. Set serialConsistency to a valid value (e.g. 'serial' or 'local_serial') in the persistence config
  2. Remove the serialConsistency key so the default is used
  3. Log/inspect the wrapped parse error (%v) to see which token was rejected
  4. Validate config with the service's config validation tooling before deploy

Example fix

// before (config)
persistence:
  default:
    cassandra:
      consistency:
        serialConsistency: quorum
// after
persistence:
  default:
    cassandra:
      consistency:
        serialConsistency: serial
Defensive patterns

Strategy: validation

Validate before calling

if sc != "serial" && sc != "local_serial" && sc != "" { return err }

Prevention

When it happens

Trigger: Setting `persistence.default.cassandra.consistency.serialConsistency` (or per-store consistency) in the Temporal config YAML to a misspelled or unsupported value, e.g. 'SERIAL ' with whitespace, 'quorum', or an empty string where parsing requires a valid token.

Common situations: Copy-pasting consistency settings between stores; renaming keys during config upgrades; environment-specific config overlays that override serialConsistency with an invalid value.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01). Data as JSON: /api/errors/ce7fba21b22aa313. Report an issue: GitHub.