Luka
08/12/2024, 11:31 AMedr monitor all of the sudden.
The errors we are having is :
1. Unable to get the latest invocation: Failed to run dbt command
2. Failed to parse Elementary's database and schema.
I am not sure what changed and why we started having this error. We are running 0.10.0 version.
When calling that command on-run and on-end hooks run successfully.
Also running elementary commands and full-refresh of a project runs without a problem.
We are running 1.6.1 dbt versionLuka
08/12/2024, 11:35 AM2024-08-12 13:33:22 — INFO — Running with edr=0.10.0
2024-08-12 13:33:24 — ERROR — Unable to get the latest invocation: Failed to run dbt command.
2024-08-12 13:33:29 — ERROR — Failed to parse Elementary's database and schema.
2024-08-12 13:33:29 — INFO — Running internal dbt run to aggregate alerts
2024-08-12 13:33:29 — INFO — Running dbt run -m alerts --project-dir /Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/dbt_project
11:33:31 Running with dbt=1.6.1
11:33:31 target not specified in profile 'elementary', using 'default'
11:33:32 Registered adapter: snowflake=1.6.8
11:33:33 Found 37 models, 2 operations, 6 tests, 6 sources, 0 exposures, 0 metrics, 1166 macros, 0 groups, 0 semantic models
11:33:33
11:33:34
11:33:34 Running 1 on-run-start hook
11:33:34 1 of 1 START hook: elementary.on-run-start.0 ................................... [RUN]
11:33:34 1 of 1 OK hook: elementary.on-run-start.0 ...................................... [OK in 0.00s]
11:33:34
11:33:34 Concurrency: 16 threads (target='default')
11:33:34
11:33:34 1 of 3 START sql incremental model ELEMENTARY.alerts ........................... [RUN]
11:33:34 2 of 3 START sql incremental model ELEMENTARY.alerts_models .................... [RUN]
11:33:34 3 of 3 START sql incremental model ELEMENTARY.alerts_source_freshness .......... [RUN]
11:33:38 3 of 3 OK created sql incremental model ELEMENTARY.alerts_source_freshness ..... [SUCCESS 0 in 3.76s]
11:33:38 1 of 3 OK created sql incremental model ELEMENTARY.alerts ...................... [SUCCESS 0 in 3.80s]
11:33:38 2 of 3 OK created sql incremental model ELEMENTARY.alerts_models ............... [SUCCESS 0 in 4.13s]
11:33:38
11:33:38 Running 1 on-run-end hook
11:33:38 1 of 1 START hook: elementary.on-run-end.0 ..................................... [RUN]
11:33:38 1 of 1 OK hook: elementary.on-run-end.0 ........................................ [OK in 0.00s]
11:33:38
11:33:38
11:33:38 Finished running 3 incremental models, 2 hooks in 0 hours 0 minutes and 5.87 seconds (5.87s).
11:33:39
11:33:39 Completed successfully
11:33:39
11:33:39 Done. PASS=3 WARN=0 ERROR=0 SKIP=0 TOTAL=3
2024-08-12 13:33:39 — INFO — Querying test alerts.
2024-08-12 13:33:39 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "get_pending_test_alerts", "macro_args": {"days_back": 1, "disable_samples": false}} --project-dir /Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/dbt_project
Traceback (most recent call last):
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 71, in _run_command
result = subprocess.run(
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 524, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['dbt', '--log-format', 'json', 'run-operation', 'elementary.log_macro_results', '--args', '{"macro_name": "get_pending_test_alerts", "macro_args": {"days_back": 1, "disable_samples": false}}', '--project-dir', '/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/dbt_project']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/bin/edr", line 8, in <module>
sys.exit(cli())
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/cli/cli.py", line 67, in invoke
return super().invoke(ctx)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 1635, in invoke
rv = super().invoke(ctx)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/cli.py", line 311, in monitor
success = data_monitoring.run_alerts(
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/data_monitoring/data_monitoring_alerts.py", line 250, in run_alerts
alerts = self.alerts_api.get_new_alerts(
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/api/alerts/alerts.py", line 48, in get_new_alerts
new_test_alerts = self.get_test_alerts(days_back, disable_samples, filter)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/api/alerts/alerts.py", line 65, in get_test_alerts
pending_test_alerts = self.alerts_fetcher.query_pending_test_alerts(
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/fetchers/alerts/alerts.py", line 49, in query_pending_test_alerts
return self._query_alert_type(
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/monitor/fetchers/alerts/alerts.py", line 112, in _query_alert_type
raw_alerts = self.dbt_runner.run_operation(**run_operation_args)
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 136, in run_operation
success, command_output = self._run_command(
File "/Users/lukavitosevic/Library/Caches/pypoetry/virtualenvs/snowflake-dbt-30UPbkJS-py3.9/lib/python3.9/site-packages/elementary/clients/dbt/dbt_runner.py", line 82, in _run_command
raise DbtCommandError(err, command_args, logs=logs)
elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command.