Niels van Beem
05/19/2025, 8:51 AMkapa.ai
05/19/2025, 8:51 AMkapa.ai
05/19/2025, 8:51 AMmodel_run_results table when running edr report in your AT environment is likely related to how the Elementary dbt package models are materialized and deployed. Here are some key points and troubleshooting steps based on the knowledge sources: 1. model_run_results is a View, Not a Table The model_run_results object in Elementary is typically a view that joins dbt_models and dbt_run_results. If it is missing, it may not have been created due to a misconfiguration or an issue during deployment. If you have global materialization settings (like materialized: table) in your dbt_project.yml, this can override the package defaults and cause issues with view creation, as seen in several user reports. Make sure you do not have a global materialization config that affects the Elementary models. Instead, scope such configs to your own project only, not to Elementary: yaml models: my_project: materialized: table elementary: +schema: 'elementary' [See example and discussion here.](https://slack.com/archives/C02CTC89LAX/p1693825818714329) 2. Re-deploy Elementary Models in AT If the model_run_results view is missing, you should re-run the Elementary dbt models in your AT environment: dbt run --select elementary This should create all required models, including model_run_results, in the correct schema. 3. Check Schema and Profile Configuration Ensure that your profiles.yml and dbt_project.yml are correctly configured for the AT environment, and that the schema where Elementary models are created matches what edr report expects. Sometimes, the report may look in a different schema or database if the profile is misconfigured, leading to missing models even if they exist elsewhere. 4. Legacy or Corrupted Models If you previously had a misconfiguration or an older version of Elementary, you might have legacy or corrupted models. Dropping the Elementary schema in AT and re-running dbt run --select elementary can help resolve this, as seen in user experiences: > "It’s a view that relies on a table that also does not exist in my sandbox... rerunning dbt run --select elementary... that worked! I think I had legacy tables from an earlier version of elementary" [Reference](https://slack.com/archives/C02CTC89LAX/p1678388435753689) 5. Environment Differences If it works in DV but not in AT, double-check that the same versions of the Elementary dbt package and CLI are installed, and that the deployment process is identical in both environments. Summary of steps to fix: - Remove any global materialization configs that might override Elementary's defaults. - Run dbt run --select elementary in your AT environment. - Ensure your profiles.yml and dbt_project.yml are correctly set up for AT. - If issues persist, try dropping and recreating the Elementary schema in AT. If after these steps the issue persists, please check the logs (edr.log and dbt.log) for more details and consider reaching out to the Elementary community for further support. Let me know if you need more specific guidance on any of these steps!