My tests are working, but there is one table, that...
# ask-elementary-ai
m
My tests are working, but there is one table, that in test_results_description (in elementary.elementary_test_results) I see "Last update was at 2025-05-30 101103.929926, 373.82 hours ago. Usually the table is updated within 217.82 hours." So it is obvious it should trigger an alert in slack, but nothing is happening. How to debug the issue?
k
A message from kapa.ai
If your test results clearly indicate a freshness anomaly (e.g., "Last update was at 2025-05-30 101103.929926, 373.82 hours ago. Usually the table is updated within 217.82 hours."), but you are not receiving alerts in Slack, here are the recommended debugging steps based on the knowledge sources: 1. Check if Alerts Are Being Generated in Elementary Tables - Verify if there are new records in the relevant Elementary alert tables, such as
alerts
,
alerts_dbt_models
,
alerts_models
, or
alerts_v2
(depending on your version). If these tables are empty, it means alerts are not being generated or not being picked up by the monitor process. - Also, check if the
alert_sent
column is set to
FALSE
for any records, which would indicate unsent alerts. You can run:
Copy code
sql      select * from <your_db>.<your_schema>_elementary.alerts where alert_sent = FALSE
[Debugging alert delivery](https://slack.com/archives/C02CTC89LAX/p1656444318102429) 2. Check the Schema Configuration - Ensure that the Elementary tables are being written to the expected schema. If you have custom
generate_schema_name
or
generate_database_name
macros, it's possible that the alerts are being written to a different schema than you expect. Double-check your dbt and Elementary profile configurations to ensure alignment. This is a common source of issues where alerts are not found or sent [Schema mismatch issue](https://slack.com/archives/C02CTC89LAX/p1688649713861769). 3. Check the Sequence of Commands - The recommended sequence is: 1.
dbt run -s elementary
2.
dbt test
3.
edr monitor --slack-token <your_slack_token> --slack-channel-name <slack_channel>
- Running
dbt run -s elementary
ensures that the necessary Elementary tables and views are created and up to date before running tests and monitoring [Command sequence advice](https://slack.com/archives/C02CTC89LAX/p1707906123258189). 4. Review the edr.log File - Check the
edr.log
file for any errors or warnings that might indicate why alerts are not being sent. Look for issues related to permissions, missing tables, or Slack integration problems. The log file is typically found in your working directory or specified output location [Log file troubleshooting](https://slack.com/archives/C02CTC89LAX/p1707906123258189). 5. Check Slack Integration - Ensure your Slack token and channel are correctly configured and that your Slack app has the necessary permissions. Try running the
edr monitor
command without extra flags like
--group-by
to avoid filtering out alerts unintentionally. 6. Check for Disabled Alerts in dbt_project.yml - Make sure you have not set variables like
disable_warn_alerts
,
disable_skipped_model_alerts
, or similar in your
dbt_project.yml
that could prevent alerts from being sent [Disabled alerts vars](https://slack.com/archives/C02CTC89LAX/p1688649713861769). If after these steps you still do not see alerts, try running the following macro to see if any new alerts are being picked up:
Copy code
bash dbt run-operation get_new_alerts --args '{"days_back": 7}' --project-dir <elementary_monitor_project_dir> --profiles-dir <profile>
This will help you determine if the issue is with alert generation or alert delivery [Macro for debugging](https://slack.com/archives/C02CTC89LAX/p1656444318102429). If you need more targeted help, sharing your
edr.log
and relevant configuration files with the Elementary support team can help them diagnose the issue further.
m
@kapa.ai alerts_v2 has the following row (while I would expect more recent records): 479209fd-995f-45c3-8bcd-14f4d0cd40be.test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53,test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53.None.generic,test,2025-05-13 072545.000000,2025-05-13 072717.000000,2025-05-13 072714.000000,pending,"{""id"": ""479209fd-995f-45c3-8bcd-14f4d0cd40be.test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53"", ""alert_class_id"": ""test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53.None.generic"", ""model_unique_id"": ""model.dwh_dbt_redshift.company_segments"", ""test_unique_id"": ""test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53"", ""detected_at"": ""2025-05-13T072545"", ""database_name"": ""rhodium"", ""schema_name"": ""intermediate_product"", ""table_name"": ""company_segments"", ""column_name"": null, ""test_type"": ""anomaly_detection"", ""test_sub_type"": ""generic"", ""test_results_description"": null, ""owners"": ""[\""@product-analytics-team\""]"", ""tags"": ""[\""daily\"", \""product\"", \""elementary-tests\""]"", ""test_results_query"": null, ""test_rows_sample"": [], ""other"": null, ""test_name"": ""elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30"", ""test_short_name"": ""freshness_anomalies"", ""test_params"": ""{\""timestamp_column\"": \""updated_at\"", \""where_expression\"": \""updated_at > current_date - 30\"", \""model\"": \""{{ get_where_subquery(ref('company_segments')) }}\""}"", ""severity"": ""warn"", ""test_meta"": ""{\""description\"": \""Monitors the freshness of your table over time, as the expected time between data updates.\""}"", ""model_meta"": ""{\""owner\"": [\""@product-analytics-team\""]}"", ""status"": ""skipped"", ""elementary_unique_id"": ""test.dwh_dbt_redshift.elementary_freshness_anomalies_company_segments_updated_at__updated_at_current_date_30.deafefdb53.None.generic""}",null Then there is a table alerts_dbt_tests, which doesn't have any rows associated with this test or model.
k
A message from kapa.ai
Based on your description and the knowledge sources, here’s how to debug the issue: ### 1. Why is
alerts_v2
not updating with new records for this test? - The row you see in
alerts_v2
is from 2025-05-13 and is marked as
pending
with a
status
of
skipped
. There are no more recent records, and nothing appears in
alerts_dbt_tests
for this test/model. ### 2. Possible Causes and Debug Steps #### a. Skipped Status - If a test or alert is marked as
skipped
, it usually means that the test was not executed or was skipped due to upstream failures or suppression logic. For example, if you use
dbt build
and an upstream model fails, downstream tests are marked as skipped and will not generate alerts [Skipped alerts explanation](https://slack.com/archives/C02CTC89LAX/p1703151833058309). #### b. No New Test Results - If there are no new test results in
elementary_test_results
for this test/model, Elementary will not generate new alerts. Make sure that the test is actually being executed and failing/passing as expected in your latest
dbt test
runs. #### c. Suppression or Disabled Alerts - Check your
dbt_project.yml
for variables like
disable_test_alerts
,
disable_warn_alerts
, or
disable_skipped_test_alerts
. If these are set to
true
, alerts for certain test outcomes (like warnings or skipped tests) will not be generated [Disable vars impact](https://slack.com/archives/C02CTC89LAX/p1688649713861769). #### d. Schema/Configuration Mismatch - If you have custom schema or database naming logic, ensure that Elementary is reading and writing to the correct schema. Sometimes, alerts are written to a different schema than expected due to custom macros or misconfiguration [Schema mismatch issue](https://slack.com/archives/C02CTC89LAX/p1688649713861769). #### e. Sequence of Operations - The recommended sequence is: 1.
dbt run -s elementary
2.
dbt test
3.
edr monitor
- If you skip
dbt run -s elementary
after upgrading the package or making config changes, the necessary tables/views may not be up to date [Command sequence advice](https://slack.com/archives/C02CTC89LAX/p1707906123258189). ### 3. What to Check Next - Check if the test is being executed: Look for this test in your latest
elementary_test_results
. If it’s not there, it’s not being run. - Check for suppression/disable vars: Review your
dbt_project.yml
for any variables that might suppress alerts. - Check for upstream failures: If the model or an upstream dependency failed, the test may be skipped. - Check logs: Review your
edr.log
for any errors or warnings related to this test or alert generation. - Check schema alignment: Make sure the schema where
elementary_test_results
and
alerts_v2
are written matches your expectations. ### 4. If You Need to Trigger a New Alert - Ensure the test is failing or producing a warning in your latest
dbt test
run. - Run
edr monitor
after the test run. - If still no alert, try running:
Copy code
bash   dbt run-operation get_new_alerts --args '{"days_back": 7}'
to see if any new alerts are being picked up. --- If after these checks the issue persists, please share your
edr.log
and relevant configuration with the Elementary support team for further assistance. --- Summary: The most likely reason you are not seeing new alerts is that the test is being skipped (possibly due to upstream failures or suppression settings), or the alerting logic is being suppressed by configuration. Double-check your test execution, config vars, and schema alignment to resolve the issue. --- If you need more targeted help, please provide the output of your latest
dbt test
, the relevant section of your
dbt_project.yml
, and your
edr.log
.