Igor Dal Bo
10/21/2024, 8:07 AMelementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command. , even if nothing changed in terms of project structure, variables, and infrastructure. We run the commands from within a container, and if I do so locally (with the same env vars) the command succeeds, if I run it through AWS ECS it does notIgor Dal Bo
10/21/2024, 8:07 AM2024-10-21T07:55:51.168Z
2024-10-21 07:55:51 — INFO — edr (0.15.1) and Elementary's dbt package (0.15.2) are compatible.
2024-10-21T07:55:56.562Z
2024-10-21 07:55:56 — INFO — Elementary's database and schema: '"INSIGHT_PROD.ELEMENTARY"'
2024-10-21T07:55:56.563Z
2024-10-21 07:55:56 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 16, "invocations_per_test": 720, "disable_passed_test_metrics": false}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:57:35.950Z
2024-10-21 07:57:35 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_source_freshness_results", "macro_args": {"days_back": 16, "invocations_per_test": 720}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:57:47.182Z
2024-10-21 07:57:47 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models", "macro_args": {"exclude_elementary": true}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:57:54.206Z
2024-10-21 07:57:54 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_sources", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:58:01.567Z
2024-10-21 07:58:01 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_exposures", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:58:09.032Z
2024-10-21 07:58:09 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_singular_tests", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:58:15.626Z
2024-10-21 07:58:15 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models_runs", "macro_args": {"days_back": 16, "exclude_elementary": true}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21T07:59:01.996Z
[31;20m2024-10-21 07:59:01 — ERROR — Could not generate the report - Error: Failed to run dbt command.
2024-10-21T07:59:01.996Z
Please reach out to our community for help with this issue.[0m
2024-10-21T07:59:01.996Z
Traceback (most recent call last):
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 88, in _run_command
2024-10-21T07:59:01.996Z
result = subprocess.run(
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/subprocess.py", line 528, in run
2024-10-21T07:59:01.996Z
raise CalledProcessError(retcode, process.args,
2024-10-21T07:59:01.996Z
subprocess.CalledProcessError: Command '['dbt', '--log-format', 'json', 'run-operation', 'elementary.log_macro_results', '--args', '{"macro_name": "elementary_cli.get_models_runs", "macro_args": {"days_back": 16, "exclude_elementary": true}}', '--project-dir', '/usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project']' died with <Signals.SIGKILL: 9>.
2024-10-21T07:59:01.996Z
During handling of the above exception, another exception occurred:
2024-10-21T07:59:01.996Z
Traceback (most recent call last):
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/report/report.py", line 85, in get_report_data
2024-10-21T07:59:01.996Z
models_runs = models_api.get_models_runs(
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/api/models/models.py", line 39, in get_models_runs
2024-10-21T07:59:01.996Z
model_runs_results = self.models_fetcher.get_models_runs(
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/monitor/fetchers/models/models.py", line 24, in get_models_runs
2024-10-21T07:59:01.996Z
run_operation_response = self.dbt_runner.run_operation(
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 160, in run_operation
2024-10-21T07:59:01.996Z
success, command_output = self._run_command(
2024-10-21T07:59:01.996Z
File "/usr/local/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 99, in _run_command
2024-10-21T07:59:01.996Z
raise DbtCommandError(err, command_args, logs=logs)
2024-10-21T07:59:01.996Z
elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command.
2024-10-21T07:59:03.592Z
cleanup
2024-10-21T07:59:03.592Z
cleanupJoost Boonzajer Flaes
10/21/2024, 8:28 AMdbt run /`dbt test` there without any issues?
And is there any more info in your edr.log (if you can access this?) It should sit in edr_target/edr.log in the containerIgor Dal Bo
10/21/2024, 8:48 AMJoost Boonzajer Flaes
10/21/2024, 8:58 AMIgor Dal Bo
10/21/2024, 9:14 AMedr report --env prod --days-back 16 --file-path test_report.html
________ __
/ ____/ /__ ____ ___ ___ ____ / /_____ ________ __
/ __/ / / _ \/ __ `__ \/ _ \/ __ \/ __/ __ `/ ___/ / / /
/ /___/ / __/ / / / / / __/ / / / /_/ /_/ / / / /_/ /
/_____/_/\___/_/ /_/ /_/\___/_/ /_/\__/\__,_/_/ \__, /
/____/
You are using Elementary 0.15.1, however version 0.16.1 is available.
Consider upgrading by running: "/usr/local/bin/python3.9 -m pip install --upgrade elementary-data"
Any feedback and suggestions are welcomed! join our community here - <https://bit.ly/slack-elementary>
2024-10-21 09:04:58 — INFO — Running with edr=0.15.1
2024-10-21 09:05:23 — INFO — edr (0.15.1) and Elementary's dbt package (0.15.2) are compatible.
2024-10-21 09:05:32 — INFO — Elementary's database and schema: '"INSIGHT_PROD.ELEMENTARY"'
2024-10-21 09:05:32 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 16, "invocations_per_test": 720, "disable_passed_test_metrics": false}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:08:31 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_source_freshness_results", "macro_args": {"days_back": 16, "invocations_per_test": 720}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:08:48 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models", "macro_args": {"exclude_elementary": true}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:08:59 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_sources", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:09:10 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_exposures", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:09:22 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_singular_tests", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:09:32 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models_runs", "macro_args": {"days_back": 16, "exclude_elementary": true}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:11:26 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_dbt_models_test_coverage", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:11:54 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_nodes_depends_on_nodes", "macro_args": {"exclude_elementary": true}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:12:13 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models_latest_invocation", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project
2024-10-21 09:12:26 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_models_latest_invocations_data", "macro_args": {}} --project-dir /usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_projectJoost Boonzajer Flaes
10/21/2024, 9:27 AMsubprocess.CalledProcessError: Command '['dbt', '--log-format', 'json', 'run-operation', 'elementary.log_macro_results', '--args', '{"macro_name": "elementary_cli.get_models_runs", "macro_args": {"days_back": 16, "exclude_elementary": true}}', '--project-dir', '/usr/local/lib/python3.9/site-packages/elementary/monitor/dbt_project']' died with <Signals.SIGKILL: 9>.
The error you're seeing, subprocess.CalledProcessError: Command '['dbt', ...] died with <Signals.SIGKILL: 9> means that the dbt process was forcibly killed. Signal SIGKILL (9) is typically sent when a process exceeds available resources or is manually killed.
So it looks like the container is running into it's limits which can be an issue with the resources allocated to it or a timeout. I don't think it's a timeout issue. Can you try increasing memory/cpu?Joost Boonzajer Flaes
10/21/2024, 9:28 AMIgor Dal Bo
10/21/2024, 9:39 AMJoost Boonzajer Flaes
10/21/2024, 9:40 AMIgor Dal Bo
10/21/2024, 9:42 AMJoost Boonzajer Flaes
10/21/2024, 9:44 AMIgor Dal Bo
10/21/2024, 10:31 AMJoost Boonzajer Flaes
10/21/2024, 10:31 AM