Hello, I'm having a problem where on `on-run-end` ...
# community-support
c
Hello, I'm having a problem where on
on-run-end
fails during
dbt test
command related to freshness anomalies. Error:
Copy code
on-run-end failed, error:
 002003 (42S02): SQL compilation error:
Object 'REDACTED.REDACTED_ELEMENTARY.TEST_03776CC6DC_ELEMENTARY_FRESHNESS_ANOMALIES_REDACTED___METRICS__TMP_20231124180811829730' does not exist or not authorized.
Similar issue: https://elementary-community.slack.com/archives/C02CTC89LAX/p1692603763973949 (without resolution šŸ˜ž) Versions: EDR=0.12.0 Elementary's dbt package=0.12.1 dbt-snowflake=1.7.0 Full commands:
Copy code
export DBT_ELEMENTARY_ENABLED=true;
dbt --log-format=json source freshness;
edr run-operation upload-source-freshness --project-dir .;
dbt --log-format=json seed;
dbt --log-format=json run -x;
dbt --log-format=json test;
edr monitor -st "$SLACK_TOKEN" -ch "$MONITORING_DEFAULT_SLACK_CHANNEL" --env prod --select resource_types:model --group-by table;
This is causing Elementary to never run any other on-run-end hooks during tests which makes
edr report
not update accordingly. We use day-back 7 days and it's now displaying "No test results" when loading the report, implying that this has been broken for at least 7 days. It's seems to be correlated to when we updated Elementary to its latest version The "Model runs" section of the report are still updating, which is good, but nothing else. More information: • The monitor outputs to Slack when models are failing. Confirming that this piece works. • The Snowflake users has the relevant permissions:
CREATE SCHEMA
,
SELECT - FUTURE TABLE
,
SELECT - FUTURE VIEW
,
USAGE
,
USAGE - FUTURE SCHEMA
• Based on Snowflake documentation, "Note that creating a temporary table does not require the CREATE TABLE privilege on the schema in which the object is created."
i
Hey @CAB, care to share with me your dbt.log?
c
These containers are hosted on ephemeral machines so I have no way to accessing the log file. I may have an idea on how to give you the logs by other means. I'll try and keep you posted!
DMed you the logs!
Hello, we're still having these issues on
0.13.x
We cannot get any test history shown in Elementary because of this. I've attempted to follow up a few times with Idan but got no answers back. Has anyone experienced that issue and has a fix?
To clarify, in Snowflake I see the query failing:
Copy code
SQL compilation error: Object '_REDACTED_.ELEMENTARY_DBT__REDACTED__PRODUCTION.TEST_F11494FC03_ELEMENTARY_ALL_COLUMNS_ANOMALIES_DIM_FACEBOOK_ADS_ACCOUNTS___METRICS__TMP_20240125152310704561' does not exist or not authorized.
The query in question: https://gist.github.com/thisiscab/d7b7f60d3ca2fde71947d2e561328a62 When I copy the query that failed, use the same user with the same role, it succeeds:
Copy code
Table "DATA_MONITORING_METRICS__tmp_20240125153410135928" successfully created.
It feels like there is some kind of chicken-egg problem.
Submitted a bug ticket here: https://github.com/elementary-data/elementary/issues/1389 (for trailing purpose)
n
Hey @CAB! Sorry for the delayed response, Are you running
dbt run --select elementary
before? Is it working well? If not can you please try running it and then trying again? If you tried it and all is working well before, just once, to be sure, can you also try adding the ā€œcreate tableā€ permission and give it another go? Also one last question - I see you added the failing query to the issue you opened which is great, can you verify all the tables in the union there exists (you can take just a few example, no need to go over all of them)? That would also help us understand that other tmp tables were ale to be created
c
Hello, I'll be sure to follow up with you shortly with what you've asked. This has been deprioritized on our side as it's been broken for the past 3 months. I'll try to get this back in our plans.