hasura/graphql-engine · info

no change

Error message

no change

What it means

ErrNoChange is a sentinel error signaling that a migration or metadata operation resulted in no changes (e.g. metadata export identical to stored state). It is informational, not a failure; callers use errors.Is to detect it.

Source

Thrown at cli/migrate/migrate.go:43

	"github.com/hasura/graphql-engine/cli/v2/migrate/database"
	"github.com/hasura/graphql-engine/cli/v2/migrate/source"
	"github.com/hasura/graphql-engine/cli/v2/util"
	log "github.com/sirupsen/logrus"
	"golang.org/x/term"
)

// DefaultPrefetchMigrations sets the number of migrations to pre-read
// from the source. This is helpful if the source is remote, but has little
// effect for a local source (i.e. file system).
// Please note that this setting has a major impact on the memory usage,
// since each pre-read migration is buffered in memory. See DefaultBufferSize.
var DefaultPrefetchMigrations = uint64(10)

// DefaultLockTimeout sets the max time a database driver has to acquire a lock.
var DefaultLockTimeout = 15 * time.Second

var (
	ErrNoChange         = errors.New("no change")
	ErrNilVersion       = errors.New("no migration")
	ErrLocked           = errors.New("database locked")
	ErrNoMigrationFiles = errors.New("no migration files found")
	ErrLockTimeout      = errors.New("timeout: can't acquire database lock")
	ErrApplied          = errors.New("Version already applied in database")
	ErrNotApplied       = errors.New("Migration not applied in database")
	ErrNoMigrationMode  = errors.New("Migration mode is disabled")
	ErrMigrationMode    = errors.New("Migration mode is enabled")
)

const (
	applyingMigrationsMessage = "Applying migrations"
)

func newProgressBar(str string, w io.Writer, pbLogs bool) *pb.ProgressBar { //nolint:unparam
	// Default behaviour in non-interactive mode
	if !pbLogs && !term.IsTerminal(int(os.Stdout.Fd())) {
		return nil

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Treat it as success/no-op in CLI scripts (compare with errors.Is(err, migrate.ErrNoChange))
  2. No fix needed if no-op behavior is expected
  3. If you expected changes, verify you're pointing at the right endpoint/database

Example fix

// before
if err != nil { log.Fatal(err) }
// after
if err != nil && !errors.Is(err, migrate.ErrNoChange) { log.Fatal(err) }
Defensive patterns

Strategy: try-catch

Type guard

func IsNoChange(err error) bool { return errors.Is(err, migrate.ErrNoChange) }

Try / catch

if err := m.Steps(1); err != nil {
    if errors.Is(err, migrate.ErrNoChange) { return nil }
    return err
}

Prevention

When it happens

Trigger: Running Steps() or metadata reload/export flows where the computed state equals the existing state, so nothing was applied or written.

Common situations: `hasura migrate apply` with all migrations already applied, or metadata operations producing identical output.

Related errors


AI-assisted analysis of hasura/graphql-engine@724551b9ae (2026-08-28). Data as JSON: /api/errors/585c05f9573dd8a0. Report an issue: GitHub.