> ## Documentation Index
> Fetch the complete documentation index at: https://docs.elementary-data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshooting

> This section is aimed at collecting common issues users have to provide quick debug solutions.

<Accordion title="I run `edr report` and get an empty report">
  If you get an empty report, there are several steps to understand what went wrong and try and fix it.

  **1. Validate elementary dbt package is deployed and working:**

  * **Check that dbt package version is the latest**

  * Refer to the [dbt package installation guide](/oss/quickstart/quickstart-cli-package#step-by-step-install-elementary-dbt-package), and validate that your version in packages.yml is the one mentioned there. If not, upgrade and run `dbt deps`. Make sure to execute `dbt run --select elementary` for the package tables to be created.

  * **Check if the table `elementary_test_results` exists and has data**

  * If the table does not exist - refer to the [dbt package installation guide](/oss/quickstart/quickstart-cli-package#step-by-step-install-elementary-dbt-package). Make sure to execute `dbt run --select elementary` for the package tables to be created.

  * If the table exists but has no data - Did you execute `dbt test` since deploying the package and creating the models?

  * If yes, make sure the table was created as an incremental table (not a regular table or view).

  * If not, there is a materialization configuration in your `dbt_project.yml` file that overrides the package config. Remove it, and run `dbt run --select elementary --full-refresh` to recreate the tables. After that run `dbt test` again and check if there is data.

  * Still no data in the table? Reach out to the elementary team at [#support](https://elementary-data.com/community) on Slack.

  **2. Validate that the CLI was properly installed**

  * **Check the CLI version is the latest**

  * Use the command `pip show elementary-data` to detect your version, and validate that it is the [latest one](https://github.com/elementary-data/elementary/releases/latest). If not, run
    `pip install elementary-data --upgrade`.

  * **Try to force update the CLI internal packages**

  * Run the CLI with the flag for force updating the packages:
    `edr report -u true`

  **3. Validate that the CLI has a working connection profile in the [right path and format](https://docs.elementary-data.com/oss/cli-install#how-to-create-profiles-yml)**

  * Default path: `HOME_DIR/.dbt/profiles.yml` . If saved elsewhere, make sure to run dbt run and dbt test with `—profiles-dir <profiles.yml path>`
  * Profile name: `elementary`
  * Make sure that the elementary profile is a top-level profile, with the same indentation of the profiles you have already set up
  * Schema name: The schema of the elementary models. The default name is  `<your_dbt_project_schema>_elementary`

  **4. Validate the schema configuration for elementary models in your dbt\_project.yml**

  ```yaml theme={null}
  models:
    jaffle_shop:
      +materialized: table
    elementary:
      +schema: 'elementary'
  ```

  **5. Still not working? Collect the following logs and reach our to the elementary team at [#community-support](https://elementary-data.com/community) on Slack**

  * **edr.log** - Created on the execution folder of the CLI.
  * **dbt.log** - Created under the package location at
    `/site-packages/monitor/dbt_project/logs/dbt.log`
    You can find the full path of the package location using
    `pip show elementary-data`.
</Accordion>

<Accordion title="Error: `cannot insert into a view`">
  Elementary dbt package includes macros that run insert commands to some of the models.
  This error means that these models were materialized as views, and not as tables.
  The reason for the error is probably a configuration on your `dbt_project.yml` file, under the key `materialization`.

  ```
  ## In your dbt_project.yml
  ## This is causing the problem:

  models:
    materialization: <some_config>
  ```

  We recommend moving this config to be strictly for models in your package, or else it will override the materialization of packages:

  ```
  ## Change to this:

  models:
    your_project_name:
      models:
        materialization: <some_config>
  ```
</Accordion>

<Accordion title="Error: `command not found: edr` on macOS">
  In Python on macOS, when you *globally* install a package that has executables, such as Elementary's `edr`, it places the executable in a location that is **not** under the **default** `PATH` which is the environment variable that is used for executable lookups. Here's an example of the warning you might receive upon running `python3 -m pip install elementary-data`.

  ```shell theme={null}
  $ python3 -m pip install elementary-data
  ...
  WARNING: The script edr is installed in '/Users/user/Library/Python/3.8/bin' which is not on PATH.
    Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  ...
  $ edr
  zsh: command not found: edr
  ```

  As you can see, `edr` is not found by default upon installation.
  There are multiple ways to solve this.

  1. Use the absolute path.

  ```shell theme={null}
  $ ~/Library/Python/3.8/bin/edr
      ________                          __
     / ____/ /__  ____ ___  ___  ____  / /_____ ________  __
    / __/ / / _ \/ __ `__ \/ _ \/ __ \/ __/ __ `/ ___/ / / /
   / /___/ /  __/ / / / / /  __/ / / / /_/ /_/ / /  / /_/ /
  /_____/_/\___/_/ /_/ /_/\___/_/ /_/\__/\__,_/_/   \__, /
                                                   /____/

  Usage: edr [OPTIONS] COMMAND [ARGS]...

    Open source data reliability solution (https://docs.elementary-data.com/)
  ...
  ```

  2. Edit your shell's configuration file(`~/.zshrc`) and append Python's library path.

  ```
  export PATH=$PATH:$HOME/Library/Python/3.8/bin
  ```

  3. Use Python's [virtual environment](https://docs.python.org/3/tutorial/venv.html#creating-virtual-environments).
</Accordion>

<Accordion title="Error: `command not found: edr` on Windows">
  If you got a message `Successfully installed elementary-data` but get a `command not found` error, it is probably because of a missing path in your environment variables.

  Look for a warning in your terminal saying:
  `Warning: the script edr.exe is installed in '<path>' which is not on PATH`

  This is the path that needs to be added to your windows env vars, run:

  ```
  set PATH='%PATH%;<path from error message>'
  ```

  After that restart your CMD and try `edr` again.
</Accordion>

<Accordion title="Error: No such command 'monitor'">
  This means the installation was not completed successfully. This is usually a Python dependencies issue.

  Please try installing again on a clean virtual env:

  ```shell theme={null}
  pip install virtualenv
  python3 -m venv virtualenv_elementary
  source virtualenv_elementary/bin/activate
  python3 -m ensurepip --upgrade
  python3 -m pip install --upgrade pip
  python3 -m pip install elementary-data
  python3 -m pip install elementary-data[<adapter>]
  ```
</Accordion>

<Accordion title="WARNING - Installed package 'elementary' is overriding the built-in materialization 'XXX'">
  Starting from dbt 1.8 and above, 3rd party dbt packages cannot override dbt materializations without an explicit configuration from users.
  Elementary utilizes this dbt mechanism to add reporting functionality to non-Elementary tests (such as native dbt tests and expectations):

  * Collection of the total number of failed rows.
  * Collection of failed row samples.

  If you are encountering the warning above though, it means that you have previously added the flag
  `require_explicit_package_overrides_for_builtin_materializations=False` to `dbt-project.yml`.
  This is no longer required!.

  Instead, please add a file named `elementary_materialization.sql` to your macros folder, with the following contents -

  If you use Snowflake:

  ```
  {% materialization test, adapter='snowflake' %}
    {{ return(elementary.materialization_test_snowflake()) }}
  {% endmaterialization %}
  ```

  If you use any other DWH:

  ```
  {% materialization test, default %}
  {{ return(elementary.materialization_test_default()) }}
  {% endmaterialization %}
  ```

  This will ensure Elementary's test materialization is run but will avoid the warning.
</Accordion>

<Accordion title="I changed the training period but the results are the same">
  Elementary tests have a var named `training_period`.
  If you change it after executing elementary tests, you will need to run a full refresh to the metrics collected. This will make the next tests collect data for the new `training_period` timeframe.
  The steps are:

  1. Change var `training_period` in your `dbt_project.yml`.
  2. Full refresh of the model 'data\_monitoring\_metrics' by running ` dbt run --select data_monitoring_metrics --full-refresh`.
  3. Running the elementary tests again.

  If you want the Elementary UI to show data for a longer period of time, use the days-back option of the CLI:
  `edr report --days-back 45`
</Accordion>

<Accordion title="Parallel dbt jobs error when writing to Elementary metadata artifact tables">
  When multiple dbt jobs run in parallel, they can contend on the same Elementary metadata artifact tables.

  **Disable automatic metadata artifact uploads** in `dbt_project.yml`:

  ```yaml dbt_project.yml theme={null}
  vars:
    disable_dbt_artifacts_autoupload: true
  ```

  **Add a separate scheduled job** (daily or hourly) to upload the artifacts:

  ```bash theme={null}
  dbt run --select elementary --vars '{"enable_elementary_models": true}'
  ```

  For the `enable_elementary_models` pattern in `dbt_project.yml`, see [Can I disable / exclude the Elementary models?](/oss/general/faq#can-i-disable-exclude-the-elementary-models). For more context, see [on-run-end hooks](/data-tests/dbt/on-run-end_hooks) and [Reduce on-run-end time](/oss/guides/reduce-on-run-end-time).

  Let us know if you run into anything — we’re responsive on [#community-support](https://elementary-community.slack.com/archives/C02CTC89LAX).
</Accordion>

<Accordion title="Elementary on-run-end hooks are taking a long time">
  The `dbt_columns` table in the Elementary schema can take a while to update, especially for large projects. This table is only used by Elementary Cloud, so if you're not relying on it (or want to speed up your runs), you can disable it safely without affecting any other functionality.

  To skip updating this table, add the following to your dbt\_project.yml:

  ```
  vars:
    columns_upload_strategy: none

  ```

  For more comprehensive strategies to reduce on-run-end hooks time, see the [Reduce On-Run-End Hooks Time guide](/oss/guides/reduce-on-run-end-time).
</Accordion>

<Accordion title="I'm trying to run Elementary with dbt-fusion but encountering issues">
  dbt-fusion support in Elementary is still in beta.

  While most of the core features should work, some features may not work as expected.
  For more details, please click [here](/oss/integrations/dbt-fusion)
</Accordion>

<Accordion title="My problem is not listed here">
  If you're experiencing issues of any kind, reach out on the [#community-support](https://elementary-community.slack.com/archives/C02CTC89LAX) channel. Elementary AI and the team will be happy to help.
</Accordion>

## Other issues?

Ask us on [Slack](https://elementary-data.com/community), we are very responsive!
