Skip to content
Latchkey

sqlfluff "no dialect was specified" in CI

sqlfluff needs a dialect to parse SQL and none was configured. Since a recent release it errors out instead of guessing, so the lint step fails immediately until you set one.

What this error means

A sqlfluff lint step exits with "No dialect was specified. You must configure a dialect or specify one on the command line" before linting any file.

sqlfluff
User Error: No dialect was specified. You must configure a dialect or
specify one on the command line using --dialect after the command. Available
dialects: ansi, bigquery, postgres, snowflake, ...

Common causes

No dialect in config or on the command line

Newer sqlfluff versions require an explicit dialect; a project without one in .sqlfluff and no --dialect flag errors.

The config file is not found in CI

The .sqlfluff exists locally but is not at the path sqlfluff searches from in CI, so no dialect is picked up.

How to fix it

Declare the dialect in .sqlfluff

  1. Add a dialect under [sqlfluff] in a committed .sqlfluff.
  2. Ensure the file sits where CI runs sqlfluff.
  3. Re-run lint to confirm the dialect resolves.
.sqlfluff
[sqlfluff]
dialect = postgres
templater = jinja

Pass the dialect on the command line

As a stopgap, pass --dialect directly in the CI step so the lint can run.

.github/workflows/ci.yml
sqlfluff lint models/ --dialect postgres

How to prevent it

  • Commit a .sqlfluff with an explicit dialect.
  • Keep the config at the repo root so CI finds it.
  • Pin the sqlfluff version so dialect requirements are predictable.

Frequently asked questions

What causes ""no dialect was specified""?
Newer sqlfluff versions require an explicit dialect; a project without one in .sqlfluff and no --dialect flag errors.
How do I fix "no dialect was specified"?
Declare the dialect in .sqlfluff

Related guides

References

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