rubenv / rubenv/sql-migrate

Migration failed: "pq: unexpected transaction status idle" when running against CRBD

Open
#290 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.4k
Forks
292
PR merge metrics
No merged PRs in 30d

Description

when I run sql-migrate up --env=$SQL_ENV I get every time

Migration failed: pq: unexpected transaction status idle handling 20250929142901-some-migration.sql

The DB we're connecting to is a CockroachDB instance, which should be fully PostgreSQL compatible.

Isn't "idle" exactly the state we expect?

Our db config:

staging:
  dialect: postgres
  datasource: dbname=username sslmode=verify-full host=our-db-host.cockroachlabs.cloud port=26257 user=${CRDB_USER} password=${CRDB_PASSWORD} sslrootcert=staging.crt
  dir: migrations
  table: migrations

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by reproducing sql-migrate up --env=$SQL_ENV with the provided CockroachDB configuration and trace how the postgres dialect handles transaction status after 20250929142901-some-migration.sql. Done means migrations complete successfully against CockroachDB without the unexpected idle-status error.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.