<@U088WCP3B4P> I got an error `could not find prof...
# ask-elementary-ai
r
@kapa.ai I got an error
could not find profile named elementary
I will post full error in thread.
k
A message from kapa.ai
r
Runtime Error 07/10/2025 23442 PM Could not find profile named 'elementary'[0m 07/10/2025 23442 PM {"data": {"exc": "Runtime Error\n Could not find profile named 'elementary'"}, "info": {"category": "", "code": "Z002", "extra": {}, "invocation_id": "4914ee31-4d33-46c1-98dc-92446ca4e3df", "level": "error", "msg": "Encountered an error:\nRuntime Error\n Could not find profile named 'elementary'", "name": "MainEncounteredError", "pid": 12, "thread": "MainThread", "ts": "2025-07-10T203442.630163Z"}} 07/10/2025 23442 PM {"data": {"exc": "Runtime Error\n Could not find profile named 'elementary'"}, "info": {"category": "", "code": "Z002", "extra": {}, "invocation_id": "5ebcb345-e045-4d26-bdfe-19356d2ef9a8", "level": "error", "msg": "Encountered an error:\nRuntime Error\n Could not find profile named 'elementary'", "name": "MainEncounteredError", "pid": 12, "thread": "MainThread", "ts": "2025-07-10T203442.656135Z"}} 07/10/2025 23442 PM [31;20m2025-07-10 203442 — ERROR — Failed to parse Elementary's database and schema.[0m 07/10/2025 23442 PM 2025-07-10 203442 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 3, "invocations_per_test": 720, "disable_passed_test_metrics": true}} --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src --target prod 07/10/2025 23442 PM {"data": {"exc": "Runtime Error\n Could not find profile named 'elementary'"}, "info": {"category": "", "code": "Z002", "extra": {}, "invocation_id": "c6609065-9e9d-43a4-af50-10140588955b", "level": "error", "msg": "Encountered an error:\nRuntime Error\n Could not find profile named 'elementary'", "name": "MainEncounteredError", "pid": 12, "thread": "MainThread", "ts": "2025-07-10T203442.736321Z"}} 07/10/2025 23442 PM [31;20m2025-07-10 203442 — ERROR — Could not generate the report - Error: Failed to run dbt command. 07/10/2025 23442 PM Runtime Error 07/10/2025 23442 PM Could not find profile named 'elementary' 07/10/2025 23442 PM Please reach out to our community for help with this issue.[0m 07/10/2025 23442 PM Traceback (most recent call last): 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/monitor/api/report/report.py", line 84, in get_report_data 07/10/2025 23442 PM tests_api = TestsAPI( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/monitor/api/tests/tests.py", line 52, in init 07/10/2025 23442 PM self.test_results_db_rows = self._get_test_results_db_rows( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/monitor/api/tests/tests.py", line 64, in _get_test_results_db_rows 07/10/2025 23442 PM return self.tests_fetcher.get_all_test_results_db_rows( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/monitor/fetchers/tests/tests.py", line 26, in get_all_test_results_db_rows 07/10/2025 23442 PM run_operation_response = self.dbt_runner.run_operation( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 177, in run_operation 07/10/2025 23442 PM result = self._run_command( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/clients/dbt/command_line_dbt_runner.py", line 114, in _run_command 07/10/2025 23442 PM result = self._inner_run_command( 07/10/2025 23442 PM File "/usr/local/lib/python3.10/site-packages/elementary/clients/dbt/api_dbt_runner.py", line 54, in _inner_run_command 07/10/2025 23442 PM raise DbtCommandError( 07/10/2025 23442 PM elementary.exceptions.exceptions.DbtCommandError: Failed to run dbt command. 07/10/2025 23442 PM Runtime Error 07/10/2025 23442 PM Could not find profile named 'elementary'
k
The error message
could not find profile named elementary
is a common issue when using Elementary Data. This error means that the CLI is unable to locate a dbt profile named elementary in your profiles.yml file. Here are the most common causes and solutions: 1. Missing or Incorrect Profile Name Your profiles.yml file must contain a top-level key named elementary. For example:
Copy code
yaml    elementary:      outputs:        default:          type: snowflake          account: <account>          user: <user>          password: <password>          role: <role>          warehouse: <warehouse>          database: <database>          schema: <schema>          threads: 2
If your profile is named something else, rename it to elementary or use the correct profile name with the CLI if supported. The profile name must match exactly, including case and indentation. This is a frequent cause of the error, as seen in several support threads [Slack thread](https://slack.com/archives/C02CTC89LAX/p1680261939270689). 2. profiles.yml Location By default, dbt and Elementary look for profiles.yml in the ~/.dbt directory. If your profiles.yml is elsewhere, you must specify the location using the --profiles-dir flag:
Copy code
edr report --profiles-dir /path/to/your/profiles
If you are running the command from the directory containing profiles.yml, you can use:
Copy code
edr report --profiles-dir .
[Slack thread](https://slack.com/archives/C02CTC89LAX/p1679232209390069) 3. Profile Content and Indentation Ensure your profiles.yml is correctly indented and contains all required fields for your data warehouse. Indentation errors or missing fields can cause the profile to be unreadable [Slack thread](https://slack.com/archives/C02CTC89LAX/p1660757938346229). 4. Multiple Profiles If you have multiple profiles in your profiles.yml, make sure there is a dedicated elementary profile. Elementary requires its own profile, separate from your main dbt project profile [Slack thread](https://slack.com/archives/C02CTC89LAX/p1686013979045139). 5. Authentication Method For some warehouses (e.g., Snowflake), certain authentication methods like externalbrowser may not work in all environments. If you are using such a method, consider switching to user/password or keyfile authentication if possible [Slack thread](https://slack.com/archives/C02CTC89LAX/p1660757938346229). If you post your full error and your profiles.yml (with sensitive info redacted), I can help you debug further!
r
I have a profile.yml and when I tried to add
--profiles-dir src/slack_report
I got
Copy code
Error: Got unexpected extra arguments (profiles-dir src/slack_report --gcs-bucket-name tmc-dbt --bucket-file-path elementary/sae-report.html --gcs-timeout-limit 4800 --slack-token xoxb-249541362435-2529728678550-n0LyoMz5yVIM9ZnrB3t4LjBN --slack-channel-name dts-test-alerts --disable-passed-test-metrics true --days-back 3 --update-bucket-website false --report-url <https://tmc-elementary-658278252325.us-central1.run.app> --project-name TMC Elementary --env Production -p . -t prod)
thoughts?
Tried adding it and got this
Copy code
2025-07-10 21:37:57 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 3, "invocations_per_test": 720, "disable_passed_test_metrics": true}} --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src --target prod
07/10/2025 3:37:57 PM
{"data": {"exc": "Runtime Error\n  Could not find profile named 'elementary'"}, "info": {"category": "", "code": "Z002", "extra": {}, "invocation_id": "6d2a1619-6cf6-44c5-8146-e02e7490c119", "level": "error", "msg": "Encountered an error:\nRuntime Error\n  Could not find profile named 'elementary'", "name": "MainEncounteredError", "pid": 13, "thread": "MainThread", "ts": "2025-07-10T21:37:57.010694Z"}}
07/10/2025 3:37:57 PM
[31;20m2025-07-10 21:37:57 — ERROR — Could not generate the report - Error: Failed to run dbt command.
@kapa.ai
k
Sorry @Reta Gasser, I'm not sure what you mean. Please try again. 👋
r
@kapa.ai here is the new error I am getting: 2025-07-10 213757 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_test_results", "macro_args": {"days_back": 3, "invocations_per_test": 720, "disable_passed_test_metrics": true}} --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src --target prod 07/10/2025 33757 PM {"data": {"exc": "Runtime Error\n Could not find profile named 'elementary'"}, "info": {"category": "", "code": "Z002", "extra": {}, "invocation_id": "6d2a1619-6cf6-44c5-8146-e02e7490c119", "level": "error", "msg": "Encountered an error:\nRuntime Error\n Could not find profile named 'elementary'", "name": "MainEncounteredError", "pid": 13, "thread": "MainThread", "ts": "2025-07-10T213757.010694Z"}} 07/10/2025 33757 PM [31;20m2025-07-10 213757 — ERROR — Could not generate the report - Error: Failed to run dbt command.
k
A message from kapa.ai
New message text here
r
@kapa.ai that isnt working! any other ideas? Or more info you need to help/
k
A message from kapa.ai
Thank you for clarifying. Based on the knowledge sources, here’s what you can do and what additional info would help: ### What to Check Next 1. Confirm profiles.yml Exists and Is Accessible - Make sure there is a file named
profiles.yml
in
/app/src
(since you are using
--profiles-dir /app/src
). - The file must be named exactly
profiles.yml
(not, for example,
profile.yml
or
Profiles.yml
) [Slack thread](https://slack.com/archives/C02CTC89LAX/p1679232209390069). 2. Check Profile Name and Structure - The file must contain a top-level key named
elementary
. For example:
Copy code
yaml      elementary:        target: prod        outputs:          prod:            type: <warehouse_type>            ...
- The target you specify (
--target prod
) must match a key under
outputs
[Slack thread](https://slack.com/archives/C02CTC89LAX/p1686013979045139). 3. File Formatting - YAML formatting and indentation must be correct. Even a small indentation error can cause dbt to not recognize the profile [Slack thread](https://slack.com/archives/C02CTC89LAX/p1660757938346229). 4. Absolute vs. Relative Paths - If you are using service account files (e.g., for BigQuery), try using the absolute path for the keyfile, as relative paths can sometimes cause issues [Github Issue #1702](https://github.com/elementary-data/elementary/issues/1702). ### Additional Info That Would Help - The (redacted) contents of your
/app/src/profiles.yml
file. - Confirmation that
/app/src/profiles.yml
is readable by the process running the command. - The exact command you are running. - The output of
ls /app/src
to confirm the file is present. ### If All Else Fails If you have confirmed all of the above and it still does not work, the knowledge sources suggest that the most common root causes are: - The profile is not named
elementary
. - The file is not in the directory specified by
--profiles-dir
. - There is a formatting or indentation error in the YAML. If you can share the (redacted) contents of your
profiles.yml
and the exact command you are running, I can help you debug further based on the documented troubleshooting steps. If you have already checked all these and it still fails, the knowledge sources do not provide additional troubleshooting steps beyond what is listed above. Please provide the requested details for more targeted help.
r
Here is the profiles.yml file
Copy code
elementary:
  target: dev
  outputs:
    prod:
      type: "bigquery"
      project: "tmc-data-warehouse"
      dataset: "dbt_elementary"
      method: service-account
      # NOTE - This needs to be the ABSOLUTE path to the Service Account file
      keyfile: "{{ env_var('GOOGLE_APPLICATION_CREDENTIALS') }}"
      threads: 4
@kapa.ai see profiles file above
k
A message from kapa.ai
Thank you for your patience. Based on your previous messages and the knowledge sources, here’s what I can confirm and what I still need: ### What I Can Confirm - The error
Could not find profile named 'elementary'
almost always means that dbt (and thus Elementary) cannot find a profile named elementary in the profiles.yml file at the location specified by --profiles-dir. - The knowledge sources repeatedly confirm that the following must be true: - The file must be named profiles.yml and be located in the directory you specify with --profiles-dir. - The file must contain a top-level key named elementary. - The outputs section under elementary must contain the target you are specifying (e.g., prod). - The YAML must be correctly formatted and indented. - If you are using service account files (e.g., for BigQuery), the path to the keyfile should be absolute, not relative, as this has caused issues for others [Github Issue #1702](https://github.com/elementary-data/elementary/issues/1702). ### What I Still Need You mentioned "see profiles file above," but I do not see the contents of your profiles.yml file in this thread. The knowledge sources and support threads always request to see the (redacted) contents of the profiles.yml file to help debug further, as this is the most direct way to identify issues such as: - Incorrect profile name - Indentation or formatting errors - Missing or mismatched target names ### Next Steps Please paste the (redacted) contents of your
/app/src/profiles.yml
file here.
This will allow me to review it for the common issues described in the knowledge sources and provide specific guidance. If you have already checked all the above and the error persists, the knowledge sources do not provide additional troubleshooting steps without seeing the actual profiles.yml content. Please share that file (with sensitive info removed) so I can help you further.
r
@kapa.ai here is my profiles.yml
Copy code
elementary:
  target: dev
  outputs:
    prod:
      type: "bigquery"
      project: "tmc-data-warehouse"
      dataset: "dbt_elementary"
      method: service-account
      # NOTE - This needs to be the ABSOLUTE path to the Service Account file
      keyfile: "{{ env_var('GOOGLE_APPLICATION_CREDENTIALS') }}"
      threads: 4
k
A message from kapa.ai
Thank you for sharing your
profiles.yml
. Based on the knowledge sources, here are the issues and recommendations: --- ### 1. Mismatch Between Target and Outputs Your profile specifies:
Copy code
yaml elementary:   target: dev   outputs:     prod:       ...
But there is no
dev
output under
outputs
. The
target
value must match one of the keys under
outputs
. In your case, you have
prod
as the only output, but
target
is set to
dev
. This will cause dbt (and Elementary) to fail to find the correct configuration, resulting in the error you are seeing. How to fix: Either change your
target
to `prod`:
Copy code
yaml elementary:   target: prod   outputs:     prod:       type: "bigquery"       project: "tmc-data-warehouse"       dataset: "dbt_elementary"       method: service-account       keyfile: "{{ env_var('GOOGLE_APPLICATION_CREDENTIALS') }}"       threads: 4
Or add a
dev
output if you intend to use a
dev
environment. --- ### 2. Environment Variable for Keyfile Using
{{ env_var('GOOGLE_APPLICATION_CREDENTIALS') }}
for the keyfile is supported by dbt, but several users have reported issues with relative paths or environment variables not being picked up in some environments. If you continue to have issues, try setting the keyfile to an absolute path directly, as this has resolved similar errors for others [Github Issue #1702](https://github.com/elementary-data/elementary/issues/1702), [Slack thread](https://slack.com/archives/C02CTC89LAX/p1731008431456499). --- ### 3. File Location and Naming Ensure that: - The file is named exactly
profiles.yml
. - It is located in
/app/src
(since you are using
--profiles-dir /app/src
). --- ### 4. Summary - The most immediate issue is the mismatch between
target: dev
and the available outputs. Change
target
to
prod
or add a
dev
output. - If you still get a keyfile error, try using the absolute path for the keyfile. - Make sure the file is in the correct location and named correctly. --- These steps are directly supported by the knowledge sources and have resolved similar issues for other users [Oss CLI install & configure](https://docs.elementary-data.com/oss/cli-install), [Slack thread](https://slack.com/archives/C02CTC89LAX/p1680261939270689). If you make these changes and still encounter issues, please share the updated error message for further troubleshooting.