Area: Ingestion
Sub-Area: Remote Executor
Applies to: Cloud
Issue
You need the debug logs of an ingestion run that ran on your Remote Executor, for example because DataHub Support asked for them. You can download them from the UI or copy them from the executor container. You may also need the query dump files that SQL parsing can write.
You Might Be Asking
- How do I enable debug mode for an ingestion source?
- How do I get the execution request URN of a run?
- How do I download the logs of a Remote Executor run?
- Where does the Remote Executor store logs, and how long are they kept?
- Where are query dump files written?
Cause
The Remote Executor runs your ingestion on your own infrastructure. For each run it writes a log file in its container. You can download the run's logs from the run details page in the UI. Since DataHub Cloud v0.3.15, Download Logs is not cut off by file size, and it covers all runs, including Remote Executor runs. You can also copy the file straight from the executor container.
Solution
Part 1: Get the debug logs
Step 1: Turn on Debug Mode for the source
- In the left sidebar, open Data Sources.
- Edit the ingestion source, or click Create Source.
- On the Connection Details step, expand Advanced Settings.
- Select the Debug Mode checkbox. Its help text says it turns on debug mode to get more verbose logs.
- Save the source and run it.
With Debug Mode on, the executor runs the ingestion with the --debug flag. The Executor Pool, CLI Version and Extra Environment Variables fields are in the same section. See Assigning ingestion sources to an executor pool.
Step 2: Get the execution request URN
- On the Manage Data Sources page, open the Run History tab.
- Open the actions menu for the run. It has Copy Urn and Details. A running run also has Cancel if you can execute the source.
- Click Copy Urn. The execution request URN starts with
urn:li:dataHubExecutionRequest:.
Step 3: Download the logs from the UI
- In the actions menu for the run, click Details.
- On the Summary tab, find the Logs section. Click the circular download icon (tooltip Download Logs), next to View All.
The file is saved as exec-<urn>.log. Download Logs is not in the run's actions menu. See Viewing detailed logs.
If you need the file from the executor itself, continue with Step 4.
Step 4: Copy the log file from the executor
The executor writes each run's log to:
<log_dir>/<exec_id>/executor-logs/ingestion-logs.log
log_dir defaults to /tmp/datahub/logs. You set it with DATAHUB_EXECUTOR_LOG_DIR on your executor. <exec_id> is the ID of the run's execution request. The run's ingestion report is in <log_dir>/<exec_id>/artifacts/ingestion_report.json.
On Kubernetes, copy the file to your machine:
kubectl cp <namespace>/<executor-pod-name>:/tmp/datahub/logs/<exec_id>/executor-logs/ingestion-logs.log ./ingestion-logs.log
If you changed DATAHUB_EXECUTOR_LOG_DIR, use your own directory in the path. If you run the executor with Docker or on Amazon ECS, kubectl does not apply. Use your platform's own tools to copy the same path out of the container.
Step 5: Send the logs to Support
Attach the log file to your support ticket.
Part 2: Query dump files
Collect query dump files only if Support asks for them.
The SQL parsing aggregator writes a query_log.db file only when DATAHUB_SQL_AGG_QUERY_LOG is not DISABLED. The default is DISABLED. The values are:
-
DISABLED: no query log (default). -
STORE_ALL: log every query. -
STORE_FAILED: log only queries that failed to parse.
To turn it on for one source, add the setting under Extra Environment Variables in Advanced Settings. The field takes a JSON object. Put it in this field, not in the recipe YAML:
{"DATAHUB_SQL_AGG_QUERY_LOG": "STORE_ALL"}
Each aggregator creates its query_log.db in a new temporary directory and records the path in the query_log_path field of its report. The paths are in the run's ingestion report (ingestion_report.json, see Step 4). For Snowflake they are under:
source.report.sql_aggregator.query_log_pathsource.report.queries_extractor.sql_aggregator.query_log_path
Snowflake with use_queries_v2 (the default is true) creates two SQL parsing aggregators, so it has two paths. Other connectors can have a different number of files.
The executor sets the temporary directory of the run to the run's working folder, /tmp/datahub/ingest/<exec_id>/, unless a temporary directory is already set. That folder is removed at the end of the run, and temporary files written under it are removed with it. So you can't count on copying a query_log.db file after the run ends. Tell Support before you rely on query dumps.
Additional Notes
-
Executor logs are kept after the run. A log garbage collector is on by default (
DATAHUB_EXECUTOR_LOG_GC_ENABLED). It keeps logs for 14 days (DATAHUB_EXECUTOR_LOG_GC_RETENTION_DAYS). It removes the oldest folders when the log directory is over 10000 MB (DATAHUB_EXECUTOR_LOG_GC_MAX_DIR_SIZE_MB, 0 turns the size cap off). Logs of runs active in the last hour are protected. Copy the logs soon after the run. -
The run's working folder is removed at the end of the run. The folder
/tmp/datahub/ingest/<exec_id>/holds the run's temporary virtual environment. Don't look there for logs.