vitessio/vitess · error

found an entry from a previous run for migration id %d in _v

Error message

found an entry from a previous run for migration id %d in _vt.resharding_journal of tablets %s,please review and delete it before proceeding and restart the workflow using the Workflow %s.%s start

What it means

Before starting MoveTables streams, wrangler checks _vt.resharding_journal on the target tablets and found a journal entry from a previous run with the same migration id. A leftover journal means a prior migration with this id did not complete cleanly, and restarting could conflict with that state. The operator must review and delete the stale journal entry before re-running.

Source

Thrown at go/vt/wrangler/materializer.go:358

	}

	migrationID, err := getMigrationID(targetKeyspace, tabletShards)
	if err != nil {
		return err
	}

	if externalCluster == "" {
		exists, tablets, err := wr.checkIfPreviousJournalExists(ctx, mz, migrationID)
		if err != nil {
			return err
		}
		if exists {
			wr.Logger().Errorf("Found a previous journal entry for %d", migrationID)
			msg := fmt.Sprintf("found an entry from a previous run for migration id %d in _vt.resharding_journal of tablets %s,",
				migrationID, strings.Join(tablets, ","))
			msg += fmt.Sprintf("please review and delete it before proceeding and restart the workflow using the Workflow %s.%s start",
				workflow, targetKeyspace)
			return errors.New(msg)
		}
	}
	if autoStart {
		return mz.startStreams(ctx)
	}
	wr.Logger().Infof("Streams will not be started since --auto_start is set to false")

	return nil
}

func (wr *Wrangler) validateSourceTablesExist(sourceKeyspace string, ksTables, tables []string) error {
	// validate that tables provided are present in the source keyspace
	var missingTables []string
	for _, table := range tables {
		if schema.IsInternalOperationTableName(table) {
			continue
		}
		found := slices.Contains(ksTables, table)

View on GitHub (pinned to 01a25a7d17)

Solutions

  1. Inspect the journal on the listed tablets: SELECT * FROM _vt.resharding_journal WHERE id=<migration_id>
  2. Verify no workflow is actively using the migration, then DELETE the stale journal row from each listed tablet
  3. Restart the workflow: vtctldclient Workflow --keyspace <target> moveTables --workflow <wf> start

Example fix

-- on each listed tablet
SELECT * FROM _vt.resharding_journal;
DELETE FROM _vt.resharding_journal WHERE id=<migration_id>;
-- then
vtctldclient Workflow --keyspace target moveTables --workflow mt1 start
Defensive patterns

Strategy: validation

Validate before calling

-- run on source tablets before retrying the migration id
SELECT COUNT(*) AS stale FROM _vt.resharding_journal WHERE id=<migration_id>;
-- must be 0 before re-running MoveTables

Try / catch

if err := mz.migrateTables(ctx); err != nil {
	if strings.Contains(err.Error(), "previous run for migration id") {
		// stop automation, page operator to review journal entries
	}
	return err
}

Prevention

When it happens

Trigger: Re-running MoveTables with the same workflow/migration id after a previous run crashed or was partially cleaned up, leaving rows in _vt.resharding_journal on the source tablets.

Common situations: Interrupted MoveTables (network failure mid-migration, vtctld crash); deleting the workflow without journal cleanup; retrying a migration with a fixed migration id in automation.

Related errors


AI-assisted analysis of vitessio/vitess@01a25a7d17 (2026-09-01). Data as JSON: /api/errors/0f88566ae4f28314. Report an issue: GitHub.