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.
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
- Add a
dialectunder[sqlfluff]in a committed.sqlfluff. - Ensure the file sits where CI runs sqlfluff.
- Re-run lint to confirm the dialect resolves.
[sqlfluff]
dialect = postgres
templater = jinjaPass the dialect on the command line
As a stopgap, pass --dialect directly in the CI step so the lint can run.
sqlfluff lint models/ --dialect postgresHow to prevent it
- Commit a
.sqlfluffwith an explicit dialect. - Keep the config at the repo root so CI finds it.
- Pin the sqlfluff version so dialect requirements are predictable.