Area: Ingestion Issues
Sub-Area: dbt Ingestion, SQL Parser Crash
Applies to: OSS + Cloud
Issue
You run dbt ingestion with acryl-datahub[dbt] 1.6.0, or a 1.6.0.x patch release up to 1.6.0.13. The process stops partway through the run. There is no Python traceback and no final ingestion report. Your shell or CI job reports Segmentation fault or exit code 139.
The ingestion log often shows many Node missing from catalog warnings before the crash.
You Might Be Asking
- Why does my dbt ingestion stop with no error message or stack trace?
- Which CLI version fixes this?
- Does setting
include_column_lineage: falsestop the crash? - How do I find the dbt model that causes it?
Cause
DataHub uses the sqlglot library to parse each dbt model's compiled SQL. The dbt source uses this parse to infer schemas and to build column-level lineage. CLI 1.6.0 and the patch releases 1.6.0.1 through 1.6.0.13 pin the compiled build sqlglot[c]==30.8.0.
sqlglot versions 30.7.0 through 30.10.0 have a resolver bug. It recurses without end on a LATERAL (for example LATERAL FLATTEN or LATERAL VIEW EXPLODE) or UNNEST of an unqualified column when the schema DataHub has does not fully describe the base table. This happens in two cases:
- The base table is not in the schema at all.
- The base table is in the schema, but the column being flattened or unnested is not. A semi-structured column (for example a Snowflake VARIANT or array column) is a common case.
In the compiled build, the recursion overflows the native stack and the process gets a segmentation fault. Python can't catch a native crash, so you see no traceback.
An incomplete catalog.json is the most common reason a base table is missing. That is what the Node missing from catalog warning tells you: the node is in manifest.json but not in catalog.json.
sqlglot 30.12.0 fixes the resolver. CLI 1.7.0 and later pin sqlglot[c]==30.12.0 or newer. On the 1.6.0 line, 1.6.0.14 and later also pin sqlglot[c]==30.12.0.
Solution
- Upgrade the DataHub CLI to the latest release (1.7.0 or later). Follow the install steps in the DataHub CLI docs, and include the dbt plugin:
pip install --upgrade "acryl-datahub[dbt]"
If you pin versions in requirements.txt or a CI workflow, pin the latest release version from PyPI instead of 1.6.0. If you must stay on the 1.6.0 line, use 1.6.0.14 or later.
- If you can't upgrade yet, make your
catalog.jsoncomplete. Rundbt docs generatebefore ingestion so every model and source is in the catalog.
dbt docs generate
datahub ingest -c recipe.yml
This removes the most common trigger, a base table that is missing from the schema. It does not stop the crash when the base table is in the catalog but the column being flattened or unnested is not. If the crash continues after you regenerate the catalog, use step 1 or step 3.
- If you can't upgrade and step 2 does not stop the crash, turn off schema inference and column-level lineage together:
source:
type: dbt
config:
# ... other config ...
infer_dbt_schemas: false
include_column_lineage: false
You must set both keys. include_column_lineage defaults to true, and with infer_dbt_schemas: false alone the recipe fails with:
`infer_dbt_schemas` must be enabled to use `include_column_lineage`
Setting only include_column_lineage: false does not stop the crash. With infer_dbt_schemas on, DataHub still parses each model's SQL to infer its schema. With both off, you lose column-level lineage and inferred schemas for dbt nodes. Table-level lineage stays. See the dbt source docs for both options.
- To find the model that triggers the crash, run ingestion with debug logging:
datahub --debug ingest -c recipe.yml
The log ends at a Prior to column qualification sql line. The SQL printed there is the statement that crashed. Look for a LATERAL or UNNEST over an unqualified column.