Skip to content
Latchkey

Flyway "No value provided for placeholder" in CI

A migration contains a ${...} placeholder, and Flyway found no value for it. By default Flyway fails on an unresolved placeholder rather than running ambiguous SQL - a configuration gap, not a transient failure.

What this error means

flyway migrate fails naming a placeholder it could not resolve, before applying the migration. It is deterministic - the value is simply not configured for this run.

flyway output
ERROR: No value provided for placeholder expressions:
${tablespace}. Check your configuration!

Common causes

Placeholder value not supplied

The migration references ${tablespace} (or similar), but no -placeholders.tablespace=..., config entry, or env var provided a value.

Unintended placeholder syntax in SQL

A literal ${...} meant as data (e.g. in a function body) is interpreted as a placeholder because placeholder replacement is enabled.

How to fix it

Provide the placeholder value

Pass the value on the command line, in config, or via the FLYWAY_PLACEHOLDERS_* env vars.

Terminal
flyway migrate -placeholders.tablespace=app_ts
# or via env
export FLYWAY_PLACEHOLDERS_TABLESPACE=app_ts

Disable replacement for literal ${...}

If the ${...} is real SQL, not a placeholder, turn off placeholder replacement (or change the prefix).

Terminal
flyway migrate -placeholderReplacement=false

How to prevent it

  • Define every placeholder used by migrations in config or CI env.
  • Avoid literal ${...} in SQL when placeholder replacement is on.
  • Keep placeholder names consistent and documented.

Frequently asked questions

What causes ""No value provided for placeholder""?
The migration references ${tablespace} (or similar), but no -placeholders.tablespace=..., config entry, or env var provided a value.
How do I fix "No value provided for placeholder"?
Pass the value on the command line, in config, or via the FLYWAY_PLACEHOLDERS_* env vars.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card