# \--profiles-dir fails for dbt test and dbt compile

**URL:** <https://discourse.getdbt.com/t/profiles-dir-fails-for-dbt-test-and-dbt-compile/5042>\
**Category:** Help\
**Created:** [October 11, 2022, 2:49pm UTC](https://discourse.getdbt.com/t/profiles-dir-fails-for-dbt-test-and-dbt-compile/5042 "2022-10-11T14:49:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![topo.lora](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/topo.lora/32/714_2.png) [@topo.lora](https://discourse.getdbt.com/u/topo.lora)\
**Post date:** [October 11, 2022, 2:49pm UTC](https://discourse.getdbt.com/t/profiles-dir-fails-for-dbt-test-and-dbt-compile/5042/1 "2022-10-11T14:49:43Z")

</div>

I have a `profiles/profiles.yml` under my dbt project. I am able to do `dbt run --profiles-dir ./profiles`, it’ll successfully create tables at the specified location. However, when I run `dbt test --profiles-dir ./profiles` or `dbt compile --profiles-dir ./profiles`, it fails with the following error message.

```auto
14:33:58 Encountered an error while reading the project:
14:33:58 ERROR: Runtime Error
  Could not find profile named 'avr_heor'

```

I also tried running `dbt debug --profiles-dir ./profiles`, everything is ok.

My dbt version:

```auto
Core:
  - installed: 1.2.1
  - latest: 1.2.2 - Update available!

  Your version of dbt-core is out of date!
  You can find instructions for upgrading here:
  https://docs.getdbt.com/docs/installation

Plugins:
  - bigquery: 1.2.0 - Up to date!
  - snowflake: 1.2.0 - Up to date!
  - redshift: 1.2.1 - Up to date!
  - postgres: 1.2.1 - Update available!

```

---

<div class="post-metadata">

**Author:** ![joellabes](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/joellabes/32/3980_2.png) [@joellabes](https://discourse.getdbt.com/u/joellabes)\
**Post date:** [October 17, 2022, 5:26am UTC](https://discourse.getdbt.com/t/profiles-dir-fails-for-dbt-test-and-dbt-compile/5042/2 "2022-10-17T05:26:37Z")

</div>

I’m not sure - the fact that it works in run and debug but not other commands is very strange. I’d suggest opening an issue about this: [Issues · dbt-labs/dbt-core · GitHub](https://github.com/dbt-labs/dbt-core/issues)
