temporalio/temporal · error

error reading contents: unmatched right parenthesis

Error message

error reading contents: unmatched right parenthesis

What it means

Error "error reading contents: unmatched right parenthesis" thrown in temporalio/temporal.

Source

Thrown at common/persistence/query_util.go:86

			// stack to keep track of open parenthesis/blocks
			var st []byte
			var stmtBuilder strings.Builder

		stmtLoop:
			for ; j < n; j++ {
				switch contentStr[j] {
				case queryDelimiter:
					if len(st) == 0 {
						j++
						break stmtLoop
					}

				case sqlLeftParenthesis:
					st = append(st, sqlLeftParenthesis)

				case sqlRightParenthesis:
					if len(st) == 0 || st[len(st)-1] != sqlLeftParenthesis {
						return nil, fmt.Errorf("error reading contents: unmatched right parenthesis")
					}
					st = st[:len(st)-1]

				case sqlDoubleDollarKeyword[0]:
					if !hasWordAt(contentStr, sqlDoubleDollarKeyword, j) {
						continue
					}
					if len(st) == 0 || st[len(st)-1] != sqlDoubleDollarKeyword[0] {
						st = append(st, sqlDoubleDollarKeyword[0])
						j += len(sqlDoubleDollarKeyword) - 1
					} else {
						st = st[:len(st)-1]
						j += len(sqlDoubleDollarKeyword) - 1
					}

				case sqlIfKeyword[0]:
					if !hasWordAt(contentStr, sqlIfKeyword, j) {
						continue

View on GitHub (pinned to bde624efd1)

When it happens

Trigger: Thrown at common/persistence/query_util.go:86 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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