hasura/graphql-engine · error

not a valid input for steps/version: %w

Error message

not a valid input for steps/version: %w

What it means

The --version-type/--goto-version parsing accepts 'all' or an integer for steps/version. Any non-integer, non-'all' value passed to strconv.ParseInt triggers this wrap of the strconv error.

Source

Thrown at cli/commands/migrate_apply.go:517

		)
	}

	skipExecutionValid := migrationName == "version" || migrationName == "up" ||
		migrationName == "down"
	if !skipExecutionValid && skipExecution {
		return "", 0, herrors.E(
			op,
			"--skip-execution flag can be set only with --version, --up, --down flags",
		)
	}

	if stepString == "all" && migrationName != "version" {
		return migrationName, -1, nil
	}

	step, err := strconv.ParseInt(stepString, 10, 64)
	if err != nil {
		return "", 0, herrors.E(op, fmt.Errorf("not a valid input for steps/version: %w", err))
	}

	return migrationName, step, nil
}

View on GitHub (pinned to 724551b9ae)

Solutions

  1. Use an integer or the exact lowercase string 'all'
  2. Quote and echo the variable feeding --goto-version in scripts to verify its value
  3. For version-type version, pass the numeric timestamp from `hasura migrate status`

Example fix

# before
hasura migrate apply --goto-version "$VER"   # VER accidentally 'all '
# after
hasura migrate apply --goto-version "$(echo "$VER" | tr -d ' ')"  # or fix VER to 'all' or a number
Defensive patterns

Strategy: validation

Validate before calling

case "$V" in all|[0-9]*) ;; *) echo "invalid steps/version: $V"; exit 1;; esac

Prevention

When it happens

Trigger: `hasura migrate apply --goto-version abc` or --version 1.5, or setting steps via ENV/config with a non-numeric value while not using the literal 'all'.

Common situations: Typo like 'ALL' (case-sensitive) or 'all-databases' mistakenly used as goto-version; shell variable expansion producing an empty/non-numeric string.

Related errors


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