Chris
08/14/2025, 10:38 PMkapa.ai
08/14/2025, 10:38 PMkapa.ai
08/14/2025, 10:39 PMRuntime Error: Could not find profile named 'default' when running dbt run-operation elementary.generate_elementary_cli_profile in a dbt Cloud or OSS setup typically means that dbt is looking for a profile named default in your profiles.yml, but it cannot find it. Why does this happen? - dbt uses the profiles.yml file to find connection details. By default, it looks for a profile matching your project name, or one explicitly specified via the --profile flag. - If you haven't set up a default profile in your profiles.yml, or if your profiles.yml is missing or in the wrong location, you'll get this error. How to resolve: 1. Check your profiles.yml location: - By default, dbt looks for profiles.yml in ~/.dbt/ (your home directory). If it's elsewhere, use the --profiles-dir flag to specify the directory (not the file itself) [see example](https://slack.com/archives/C02CTC89LAX/p1678710882384149). 2. Ensure the correct profile exists: - Your profiles.yml should contain a profile matching the name dbt expects (often your dbt project name, or default if that's what is referenced). - For Elementary, you will eventually need a profile named elementary as well, but to run the generate_elementary_cli_profile macro, dbt first needs to connect using your existing project profile. Example structure: yaml my_project_name: outputs: dev: type: snowflake ... target: dev 3. If using dbt Cloud: - dbt Cloud does not use a local profiles.yml by default. When running locally, ensure your profiles.yml is set up as above. - When running the macro in dbt Cloud, make sure your environment is configured with the correct connection and target. 4. If you want to specify a different profile: - Use the --profile flag to specify the profile name if it's not default or your project name. Summary: You need to have a valid profiles.yml with a profile named default (or your project name), and it must be in the correct location or referenced with --profiles-dir. Once dbt can find and use this profile, the elementary.generate_elementary_cli_profile macro will work and output the configuration you need for Elementary. For more details and troubleshooting, see the official documentation and Slack threads: - [Elementary CLI Quickstart](https://docs.elementary-data.com/oss/quickstart/quickstart-cli) - [Slack thread on profiles-dir usage](https://slack.com/archives/C02CTC89LAX/p1678710882384149) - [Slack thread on profile not found errors](https://slack.com/archives/C02CTC89LAX/p1686013979045139)