Hi, it's me again, I believe I have found a bug w...
# community-support
s
Hi, it's me again, I believe I have found a bug with Slack alerts. More specifically when I try to run
edr monitor --slack-token SLACK_TOKEN --slack-channel-name SLACK_NAME
and despite having tested my setup, I always get this ERROR (see 🧵 for full message) and this warning that apparently, adn despite being only a warning, prevents the Message from being sent:
Copy code
UserWarning: The top-level `text` argument is missing in the request payload for a chat.postMessage call - It's a best practice to always provide a `text` argument when posting a message. The `text` argument is used in places where content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.
• edr version==0.13.2 • dbt-core==1.8.3 • dbt-biquery==1.8.2 I think I have an idea of where this comes from and how it could be resolved in the Elementary code. Is this something you can help with/look into? I could also try raising an issue if this helps.
Copy code
ERROR — Could not send the alert - be7f3b8d-681d-4f02-a78e-b9bc6b437cca.test.hippocampus.not_null_commops__clc_view_company_size.aebe6fa63a. Full alert: {"id": "be7f3b8d-681d-4f02-a78e-b9bc6b437cca.test.hippocampus.not_null_commops__clc_view_company_size.aebe6fa63a", "alert_class_id": "test.hippocampus.not_null_commops__clc_view_company_size.aebe6fa63a.company_size.generic", "model_unique_id": "model.hippocampus.commops__clc_view", "detected_at": "2024-07-09 18:03:23", "database_name": "pleo-analytics-dev", "schema_name": "dbt_hippocampus_test_stavros_commops", "owners": [], "tags": ["marts", "4hours"], "subscribers": [], "status": "fail", "suppression_interval": 0, "test_unique_id": "test.hippocampus.not_null_commops__clc_view_company_size.aebe6fa63a", "elementary_unique_id": "test.hippocampus.not_null_commops__clc_view_company_size.aebe6fa63a.company_size.generic", "test_name": "not_null_commops__clc_view_company_size", "test_display_name": "Not Null Commops  Clc View Company Size", "severity": "ERROR", "table_name": "commops__clc_view", "table_full_name": "pleo-analytics-dev.dbt_hippocampus_test_stavros_commops.commops__clc_view", "test_type": "dbt_test", "test_sub_type": "generic", "test_sub_type_display_name": "Generic", "test_results_description": "Got 2389 results, configured to fail if != 0", "test_results_query": "select company_size\nfrom `pleo-analytics-dev`.`dbt_hippocampus_test_stavros_commops`.`commops__clc_view`\nwhere company_size is null", "test_short_name": "not_null", "test_description": null, "other": {}, "test_params": {"column_name": "company_size", "model": "{{ get_where_subquery(ref('commops__clc_view')) }}"}, "test_rows_sample": [{"company_size": null}, {"company_size": null}, {"company_size": null}, {"company_size": null}, {"company_size": null}], "column_name": "company_size"}
on 0: /Users/stavros.vlachos/Desktop/Workspace/hippocampus/.venv_test/lib/python3.9/site-packages/slack_sdk/web/internal_utils.py:291: UserWarning: The top-level `text` argument is missing in the request payload for a chat.postMessage call - It's a best practice to always provide a `text` argument when posting a message. The `text` argument is used in places where content cannot be rendered such as: system push notifications, assistive technology such as screen readers, etc.
Actually an update on this. When I run it with edr==0.15.1 I get a different error message:
Copy code
ERROR — Failed to send a message to channel - SLACK_CHANNEL. Error: The request to the Slack API failed. (url: <https://www.slack.com/api/chat.postMessage>)
The server responded with: {'ok': False, 'error': 'invalid_auth'}
Does this give any hint? I ensured that my slack token is correct and that the Elementary Slack app is invited to the channel..
Update on this in case it is helpful for anyone. In order to validate that my token is correct I found the page of the
chat.postMessage
Slack API method where you make test calls. Result My token is valid but as mentioned in the warning of the first log I sent, the
text
field must be populated otherwise the response is:
Copy code
{
  "ok": false,
  "error": "no_text"
}