CAB
11/24/2023, 9:00 PMon-run-end fails during dbt test command related to freshness anomalies.
Error:
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:
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."Idan Shavit
11/27/2023, 11:39 AMCAB
11/27/2023, 3:17 PMCAB
11/27/2023, 5:12 PMCAB
01/25/2024, 4:32 PM0.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?CAB
01/25/2024, 4:38 PMSQL 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:
Table "DATA_MONITORING_METRICS__tmp_20240125153410135928" successfully created.
It feels like there is some kind of chicken-egg problem.CAB
01/25/2024, 4:53 PMNoa Kurman
02/12/2024, 1:59 PMdbt 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 createdCAB
02/13/2024, 7:14 PM