gastownhall/beads · error

checking wisps.is_blocked column: %w

Error message

checking wisps.is_blocked column: %w

What it means

This error wraps a failure of schemaColumnExists when the repair checks whether `wisps.is_blocked` already exists before issuing its ADD COLUMN. The repair is a Go translation of ignored migration 0006 and must inspect the column to stay idempotent; a failing inspection (not a missing column) produces this message. A missing column proceeds normally to the ALTER TABLE path.

Source

Thrown at internal/storage/schema/migration_repairs.go:275

	hasWisps, err := schemaTableExists(ctx, db, "wisps")
	if err != nil {
		return fmt.Errorf("checking wisps table: %w", err)
	}
	if !hasWisps {
		return nil
	}
	if err := ensureWispIsBlockedColumn(ctx, db); err != nil {
		return err
	}
	return ensureWispIsBlockedIndex(ctx, db)
}

// ensureWispIsBlockedColumn is ignored/0006's ADD COLUMN statement,
// translated to Go for a clone that reached this repair without it.
func ensureWispIsBlockedColumn(ctx context.Context, db DBConn) error {
	hasColumn, err := schemaColumnExists(ctx, db, "wisps", "is_blocked")
	if err != nil {
		return fmt.Errorf("checking wisps.is_blocked column: %w", err)
	}
	if hasColumn {
		return nil
	}
	if _, err := db.ExecContext(ctx, "ALTER TABLE wisps ADD COLUMN is_blocked TINYINT(1) NOT NULL DEFAULT 0"); err != nil {
		return fmt.Errorf("adding wisps.is_blocked: %w", err)
	}
	return nil
}

// ensureWispIsBlockedIndex is ignored/0006's CREATE INDEX statement,
// translated to Go alongside ensureWispIsBlockedColumn above.
func ensureWispIsBlockedIndex(ctx context.Context, db DBConn) error {
	hasIndex, err := schemaIndexExists(ctx, db, "wisps", "idx_wisps_is_blocked")
	if err != nil {
		return fmt.Errorf("checking idx_wisps_is_blocked index: %w", err)
	}
	if hasIndex {

View on GitHub (pinned to 71377f2769)

Solutions

  1. Inspect the wrapped driver error and restore DB connectivity or privileges
  2. Grant the migration user metadata-read access (SELECT on information_schema)
  3. Re-run the repair — it is idempotent and will re-check the column
  4. If it persists, test the same SHOW COLUMNS FROM wisps query manually with the app's credentials
Defensive patterns

Strategy: try-catch

Validate before calling

var n int
if err := db.QueryRowContext(ctx,
    "SELECT COUNT(*) FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'wisps' AND column_name = 'is_blocked'").Scan(&n); err != nil {
    return fmt.Errorf("cannot inspect wisps columns: %w", err)
}

Try / catch

err := ensureWispIsBlockedForRecompute(ctx, db)
if err != nil {
    if strings.Contains(err.Error(), "checking wisps.is_blocked column") {
        // introspection failed — reconnect and retry once
        db = reconnect(db)
        err = ensureWispIsBlockedForRecompute(ctx, db)
    }
    return err
}

Prevention

When it happens

Trigger: ensureWispIsBlockedForRecompute confirmed the wisps table exists, then ensureWispIsBlockedColumn's schemaColumnExists query errors out due to driver failure, lost connection, or insufficient privileges to read column metadata.

Common situations: Running repairs with a migration user lacking information_schema/COLUMNS access; transient connection drops on long-running repair sequences; proxy/load-balancer terminating idle DB connections mid-repair.

Related errors


AI-assisted analysis of gastownhall/beads@71377f2769 (2026-08-30). Data as JSON: /api/errors/56b636bcb1e6f764. Report an issue: GitHub.