temporalio/temporal · error
unable to delete chasm search attributes: %w
Error message
unable to delete chasm search attributes: %w
What it means
Returned when the DELETE on templateDeleteChasmSearchAttributes fails during DeleteFromVisibility. Like the other statements, failure triggers a full rollback of the transaction. The wrapped error contains the driver-level cause.
Source
Thrown at common/persistence/sql/sqlplugin/mysql/visibility.go:210
defer func() {
err := tx.Rollback()
// If the error is sql.ErrTxDone, it means the transaction already closed, so ignore error.
if err != nil && !errors.Is(err, sql.ErrTxDone) {
// Transaction rollback error should never happen, unless db connection was lost.
retError = fmt.Errorf("transaction rollback failed: %w", retError)
}
}()
_, err = tx.NamedExecContext(ctx, templateDeleteCustomSearchAttributes, filter)
if err != nil {
return nil, fmt.Errorf("unable to delete custom search attributes: %w", err)
}
result, err = tx.NamedExecContext(ctx, templateDeleteWorkflowExecution_v8, filter)
if err != nil {
return nil, fmt.Errorf("unable to delete workflow execution: %w", err)
}
_, err = tx.NamedExecContext(ctx, templateDeleteChasmSearchAttributes, filter)
if err != nil {
return nil, fmt.Errorf("unable to delete chasm search attributes: %w", err)
}
err = tx.Commit()
if err != nil {
return nil, err
}
return result, nil
}
// SelectFromVisibility reads one or more rows from visibility table
func (mdb *db) SelectFromVisibility(
ctx context.Context,
filter sqlplugin.VisibilitySelectFilter,
) ([]sqlplugin.VisibilityRow, error) {
if len(filter.Query) == 0 {
// backward compatibility for existing tests
err := sqlplugin.GenerateSelectQuery(&filter, mdb.converter.ToMySQLDateTime)
if err != nil {
return nil, errView on GitHub (pinned to bde624efd1)
Solutions
- Run the visibility schema migrations that create the CHASM search attributes table.
- Verify the DB user has DELETE privileges on all visibility tables.
- Check the wrapped driver error for the specific cause (unknown table, access denied, connection lost).
- Retry after transient connection/lock errors; the rollback guarantees a clean state.
Defensive patterns
Strategy: retry
Validate before calling
// Go: check chasm search attributes table exists SELECT COUNT(*) FROM information_schema.tables WHERE table_name = 'chasm_search_attributes';
Try / catch
// Go
if err := store.DeleteFromVisibility(ctx, req); err != nil {
if strings.Contains(err.Error(), "chasm search attributes") {
// likely missing migration: log schema version, alert
return err
}
return err
} Prevention
- Always run migrations that accompany CHASM-enabled releases
- Verify DB user permissions on newly created tables
- Alert on 'unknown table' MySQL errno 1146 in logs
- Test upgrades against a staging schema
When it happens
Trigger: DeleteFromVisibility when the CHASM search attributes delete errors — most commonly because the chasm search attributes table does not exist (schema predates the CHASM feature) or the connection dropped earlier in the transaction.
Common situations: Upgrading a cluster to a CHASM-enabled version without running the new visibility migrations; DB failover between statements; permission denied on the new table for the configured DB user.
Understand the failure class
Background: "query failed", "%w: SQL error" — wrapped database query errors in Go libraries explained — this error's family across 3 libraries.
Related errors
- unable to delete custom search attributes: %w
- unable to delete workflow execution: %w
- transaction rollback failed: %w
- unable to insert chasm search attributes: %w
- unable to upsert chasm search attributes: %w
AI-assisted analysis of temporalio/temporal@bde624efd1 (2026-09-01).
Data as JSON: /api/errors/4be47e656a148325.
Report an issue: GitHub.