# dbt found two models with the name? Give me solution

**URL:** https://discourse.getdbt.com/t/dbt-found-two-models-with-the-name-give-me-solution/8559
**Category:** Help
**Created:** [June 4, 2023, 5:50pm UTC](https://discourse.getdbt.com/t/dbt-found-two-models-with-the-name-give-me-solution/8559 "2023-06-04T17:50:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Ramkumar](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@Ramkumar](https://discourse.getdbt.com/u/Ramkumar)
#### Post date: [June 4, 2023, 5:50pm UTC](https://discourse.getdbt.com/t/dbt-found-two-models-with-the-name-give-me-solution/8559/1 "2023-06-04T17:50:42Z")

</div>

Hello, Expert.

I’m doing dbt compile in my project model, after the code that was compiled target folder is created inside my model folder, and then I compile once again.I get the message “dbt found two models with the name”.

Note: I don’t have a duplicate model name .  
problem is target folder has been created within my model folder.

---

<div class="post-metadata">

### Author: ![leoebfolsom](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/leoebfolsom/32/867_2.png) [@leoebfolsom](https://discourse.getdbt.com/u/leoebfolsom)
#### Post date: [June 5, 2023, 6:07am UTC](https://discourse.getdbt.com/t/dbt-found-two-models-with-the-name-give-me-solution/8559/2 "2023-06-05T06:07:15Z")

</div>

> target folder has been created within my model folder

It would help to know more details about this. Would you be able to share a screenshot of the relevant parts of your file tree, showing where the `target` folder is created?

Did you _intend_ for your target folder to be where it is? If not, you could delete it and recreate a target folder in th standard location using a `dbt compile` command.

Finally, if you review your full error message (not only the “dbt found two models with the name” part, but the specification of the relevant model name) I believe that might point you in the right direction.

This similar question might also help: [Compilation Error dbt found two models with the name](https://discourse.getdbt.com/t/compilation-error-dbt-found-two-models-with-the-name/4581)

---

<div class="post-metadata">

### Author: ![ardbegneo](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@ardbegneo](https://discourse.getdbt.com/u/ardbegneo)
#### Post date: [August 28, 2023, 5:19pm UTC](https://discourse.getdbt.com/t/dbt-found-two-models-with-the-name-give-me-solution/8559/3 "2023-08-28T17:19:15Z")

</div>

New to dbt, just started today 🙂 got this error too. For me it was because the target ( and dbt\_packages) dirs get created in whatever dir you are in when you run the dbt run command. ( Least in v 1.5.0 )

Given that i was in the models dir when i did a dbt run… then that’s where they ended up causing the duplicate model.

Just delete the two dirs and do a dbt run from inside the project dir not any of the sub dirs 😃  
Hope that helps anybody else starting out…
