We are getting error when run `edr monitor` comma...
# community-support
r
We are getting error when run
edr monitor
command
Copy code
[2023-11-12, 22:50:12 EST] {subprocess.py:74} INFO - Running command: ['bash', '-c', 'edr monitor --project-dir /opt/airflow/dbt-dir/dbt/ --profiles-dir /opt/airflow/dbt-dir/ -c /mnt/working-dir -st *** -ch alerts']
[2023-11-12, 22:50:12 EST] {subprocess.py:85} INFO - Output:
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO -     ________                          __
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO -    / ____/ /__  ____ ___  ___  ____  / /_____ ________  __
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO -   / __/ / / _ \/ __ `__ \/ _ \/ __ \/ __/ __ `/ ___/ / / /
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO -  / /___/ /  __/ / / / / /  __/ / / / /_/ /_/ / /  / /_/ /
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - /_____/_/\___/_/ /_/ /_/\___/_/ /_/\__/\__,_/_/   \__, /
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO -                                                  /____/
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - 
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - Any feedback and suggestions are welcomed! join our community here - <https://bit.ly/slack-elementary>
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - 
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - 2023-11-13 03:50:15 — INFO — Running with edr=0.12.0
[2023-11-12, 22:50:15 EST] {subprocess.py:92} INFO - 2023-11-13 03:50:15 — INFO — Running dbt --log-format json deps --project-dir /mnt/working-dir/edr/elementary/monitor/dbt_project --profiles-dir /opt/airflow/dbt-dir/
[2023-11-12, 22:50:41 EST] {subprocess.py:92} INFO - [31;20m2023-11-13 03:50:41 — ERROR — Unable to get the latest invocation: list index out of range[0m
[2023-11-12, 22:50:59 EST] {subprocess.py:92} INFO - [31;20m2023-11-13 03:50:59 — ERROR — Failed to parse Elementary's database and schema.[0m
[2023-11-12, 22:50:59 EST] {subprocess.py:92} INFO - 2023-11-13 03:50:59 — INFO — Running internal dbt run to aggregate alerts
[2023-11-12, 22:50:59 EST] {subprocess.py:92} INFO - 2023-11-13 03:50:59 — INFO — Running dbt run -m elementary_cli.alerts --project-dir /mnt/working-dir/edr/elementary/monitor/dbt_project --profiles-dir /opt/airflow/dbt-dir/
[2023-11-12, 22:51:14 EST] {subprocess.py:92} INFO - 2023-11-13 03:51:14 — INFO — Querying test alerts.
[2023-11-12, 22:51:14 EST] {subprocess.py:92} INFO - 2023-11-13 03:51:14 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_pending_test_alerts", "macro_args": {"days_back": 1, "disable_samples": false}} --project-dir /mnt/working-dir/edr/elementary/monitor/dbt_project --profiles-dir /opt/airflow/dbt-dir/
[2023-11-12, 22:51:25 EST] {subprocess.py:92} INFO - 2023-11-13 03:51:25 — INFO — Querying test alerts last sent times.
[2023-11-12, 22:51:25 EST] {subprocess.py:92} INFO - 2023-11-13 03:51:25 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_last_test_alert_sent_times", "macro_args": {"days_back": 1}} --project-dir /mnt/working-dir/edr/elementary/monitor/dbt_project --profiles-dir /opt/airflow/dbt-dir/
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO - Traceback (most recent call last):
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/bin/edr", line 8, in <module>
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     sys.exit(cli())
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 1130, in __call__
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return self.main(*args, **kwargs)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 1055, in main
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     rv = self.invoke(ctx)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/cli/cli.py", line 67, in invoke
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return super().invoke(ctx)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 1657, in invoke
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return _process_result(sub_ctx.command.invoke(sub_ctx))
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 1635, in invoke
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     rv = super().invoke(ctx)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 1404, in invoke
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return ctx.invoke(self.callback, **ctx.params)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/core.py", line 760, in invoke
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return __callback(*args, **kwargs)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/click/decorators.py", line 26, in new_func
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return f(get_current_context(), *args, **kwargs)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/monitor/cli.py", line 329, in monitor
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     success = data_monitoring.run_alerts(
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/monitor/data_monitoring/data_monitoring_alerts.py", line 254, in run_alerts
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     alerts = self.alerts_api.get_new_alerts(
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/monitor/api/alerts/alerts.py", line 48, in get_new_alerts
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     new_test_alerts = self.get_test_alerts(days_back, disable_samples, filter)
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/monitor/api/alerts/alerts.py", line 68, in get_test_alerts
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     last_alert_sent_times = self.alerts_fetcher.query_last_test_alert_times(
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -   File "/mnt/working-dir/edr/elementary/monitor/fetchers/alerts/alerts.py", line 91, in query_last_test_alert_times
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO -     return json.loads(response[0])
[2023-11-12, 22:51:35 EST] {subprocess.py:92} INFO - IndexError: list index out of range
[2023-11-12, 22:51:35 EST] {subprocess.py:96} INFO - Command exited with return code 1
[2023-11-12, 22:51:35 EST] {taskinstance.py:1909} ERROR - Task failed with exception