Area: Ingestion Issues
Sub-Area: Snowflake / Memory Management
Applies to: OSS + Cloud
Issue
A Snowflake ingestion run fails partway through. The run log stops without a Pipeline finished line, and the run never prints its final report. Only the periodic progress reports are in the log.
Error Messages
The run shows one of these:
Failed to execute 'datahub ingest', exit code 247- A message that starts with
The ingestion process was killed by signal SIGKILL - A message that starts with
The ingestion process was terminated with exit code 137
You Might Be Asking
- What does exit code 247 mean in DataHub ingestion?
- Why is my Snowflake ingestion killed mid-run with no clear error?
- Will upgrading the CLI to 1.6.0.3 fix it?
- Does
use_file_backed_cache: truehelp?
Cause
The operating system killed the datahub ingest process with SIGKILL (signal 9) because the executor ran out of memory. This is not a recipe error or a Snowflake error.
The executor starts datahub ingest through a small wrapper process. When the operating system kills datahub ingest, the wrapper exits with that process's return code, -9. An exit code is one unsigned byte, so -9 shows up as 247 (256 minus 9). A shell reports the same kill as 137 (128 plus 9). Both codes mean the process was killed.
Memory use grows with the amount of metadata one run pulls. Snowflake runs with large schemas, lineage or profiling are among the heaviest. All ingestions running on one executor share its memory, so runs that overlap add up.
Metadata the run sent to DataHub before the kill stays in DataHub. The pipeline writes as it goes. What you lose is the rest of the run and its final report.
Two things do not fix it:
- Upgrading to CLI 1.6.0.3. That release has no memory changes. It is a security, authorization and dependency hotfix for the 1.6.0 line.
- Setting
use_file_backed_cache: true. It has no effect on Snowflake memory. Some guides recommend it for large Snowflake accounts, and the Snowflake source docs list it as a cache for view definitions (defaulttrue). The Snowflake config accepts the key, but the Snowflake source never reads it. Setting it totrueorfalsechanges nothing. Use the steps below instead.
One CLI case is different. Most CLI versions install the compiled SQL parser (sqlglot[c]). This includes CLI 1.6.0.3 and CLI 1.7.0.20, the latest version. Only CLI 1.5.0.10 through 1.5.0.19 install the pure Python SQL parser. The compiled SQL parser caused memory leaks in some versions.
On CLI 1.7.0.20, you can make one source use the pure Python SQL parser:
- Open the source and go to Advanced Settings.
- In Extra Environment Variables, enter
{"DATAHUB_SQLGLOT_DISABLE_C": "true"}. - Save the source and run it again.
When you run the CLI yourself, set the environment variable DATAHUB_SQLGLOT_DISABLE_C=true. The run log then shows DATAHUB_SQLGLOT_DISABLE_C is set; forcing pure-Python sqlglot. This message tells you that the run uses the pure Python SQL parser.
If the run still stops with exit code 247 or 137, do the steps in the Solution section.
Solution
Lower the memory one run needs, run fewer ingestions at the same time, or give the executor more memory.
-
Narrow the run. Use
database_pattern,schema_patternandtable_patternto ingest less per run. You can split one large source into several smaller sources that run at different times. See the Snowflake source docs for each option. -
Turn off features you don't need for this source. Profiling is off by default (
profiling.enabled: false). If you turned it on, turn it off and check if the run finishes. You can also setinclude_column_lineage: false. You lose that metadata for this source.source: type: snowflake config: # keep your existing connection settings here database_pattern: allow: - "^ANALYTICS$" profiling: enabled: false include_column_lineage: false -
Run fewer ingestions at once. Schedule large warehouse ingestions so they don't overlap. On a Remote Executor,
DATAHUB_EXECUTOR_INGESTION_MAX_WORKERS(default4) sets how many ingestions run at the same time. See Remote Executor best practices. -
Give the executor more memory.
- Remote Executor: raise the memory limit in your deployment. Size it for all the runs that overlap, not one run. See Remote Executor best practices and Configuring Remote Executor.
- DataHub Cloud managed executor: contact DataHub Support.
- Self-hosted DataHub (UI ingestion): give the
datahub-actionscontainer more memory. - CLI ingestion (
datahub ingeston your own machine or container): give that machine or container more memory, or use steps 1 and 2.
After the change, run the ingestion again.
Additional Notes
The run report has peak_memory_usage and mem_info. mem_info is the process's memory use at the last report. It is not a limit. The two values are often close in healthy runs, so comparing them does not prove a kill. Use the exit code and a log that ends without Pipeline finished.
Related Documentation
Tags: snowflake, ingestion, oom, out-of-memory, exit-code-247, exit-code-137, sigkill, memory, remote-executor