kestra-io/kestra · error · IllegalArgumentException

Migration script [<scriptId>] has no checksum to repair.

Error message

Migration script [<scriptId>] has no checksum to repair.

What it means

Thrown by repairChecksum() when the resolved MigrationScript for the given scriptId has a null checksum. The repair operation's entire purpose is to overwrite the stored checksum with the script's current checksum, so a null checksum makes the operation meaningless and is rejected. This is an IllegalArgumentException indicating caller error — the script cannot be repaired.

Source

Thrown at core/src/main/java/io/kestra/core/migration/MigrationRunner.java:147

     * @throws MigrationLockedException if another process holds the migration lock
     * @throws Exception if the script is unknown, unapplied, unsupported, or the backend update fails
     */
    @Override
    public void repairChecksum(final String scriptId) throws MigrationLockedException, Exception {
        if (!lock.tryAcquire()) {
            throw new MigrationLockedException();
        }

        try {
            historyStore.bootstrapIfNeeded();

            MigrationScript script = scripts.stream()
                .filter(candidate -> candidate.scriptId().equals(scriptId))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unknown migration script [" + scriptId + "]."));

            if (script.checksum() == null) {
                throw new IllegalArgumentException("Migration script [" + scriptId + "] has no checksum to repair.");
            }

            if (!historyStore.isApplied(scriptId)) {
                throw new IllegalStateException("Cannot repair migration script [" + scriptId + "] because it has not been applied.");
            }

            historyStore.updateChecksum(script);
            log.info("Migration checksum repaired for script [{}].", scriptId);
        } finally {
            lock.release();
        }
    }

    /**
     * Returns all scripts that have not yet been applied, sorted by {@code scriptId}.
     * Used by EE to detect pending scripts before deciding whether to run or fail.
     *
     * <p>

View on GitHub (pinned to 823fada927)

Solutions

  1. Confirm the scriptId actually has a checksum by inspecting the MigrationScript bean.
  2. If the script genuinely has no checksum, repair is not applicable — do not call it.
  3. Re-run 'kestra migrate' normally; a missing checksum usually means the script is handled differently by the runner.
  4. List available scripts to verify you targeted the correct ID.
Defensive patterns

Strategy: validation

Validate before calling

MigrationScript script = scripts.stream()
    .filter(s -> s.scriptId().equals(scriptId))
    .findFirst().orElse(null);
if (script == null || script.checksum() == null) {
    log.warn("Script {} has no checksum; repair is not applicable.", scriptId);
    return;
}

Try / catch

try {
    migrationRunner.repairChecksum(scriptId);
} catch (IllegalArgumentException e) {
    log.warn("Repair not applicable for script {}: {}", scriptId, e.getMessage());
}

Prevention

When it happens

Trigger: Passing a scriptId whose MigrationScript.checksum() returns null (e.g., a script type that does not compute a checksum, or a dynamically-generated script); referencing a script ID that resolves but legitimately has no checksum.

Common situations: Operator targets the wrong script for repair; a custom or experimental migration script was registered without a checksum; confusion between script types where only some carry checksums.

Related errors


AI-assisted analysis of kestra-io/kestra@823fada927 (2026-08-14). Data as JSON: /api/errors/c563d8a87b8b39ca. Report an issue: GitHub.