# Dbt cloud target error but not in Dbt core

**URL:** <https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878>\
**Category:** Help\
**Tags:** dbt-cloud\
**Created:** [January 2, 2023, 12:52pm UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878 "2023-01-02T12:52:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrivera](https://avatars.discourse-cdn.com/v4/letter/m/ea5d25/32.png) [@mrivera](https://discourse.getdbt.com/u/mrivera)\
**Post date:** [January 2, 2023, 12:52pm UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878/1 "2023-01-02T12:52:09Z")

</div>

Hi, i’m new in dbt .  
I want to run different models with different targets at dbt cloud. I saw the command :  
" dbt run --select model.sql --target dev "  
This command line works in dbt core, but when I tried to do it at dbt cloud , it doesn’t run my model in the target called dev, it takes the default one.

I have tried doing dbt debug --target dev to see the connection but also got errors in dbt cloud (but no at dbt core):

“No matching handler found for rpc method None (which=debug)”

I want to work at dbt cloud because it easier for me to set jobs, so how can I fix it?

Thanks!

---

<div class="post-metadata">

**Author:** ![obar1](https://sea2.discourse-cdn.com/flex020/user_avatar/discourse.getdbt.com/obar1/32/1221_2.png) [@obar1](https://discourse.getdbt.com/u/obar1)\
**Post date:** [January 2, 2023, 4:14pm UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878/2 "2023-01-02T16:14:48Z")

</div>

Hello,  
Modify the value of target in the dbt cloud environments… when you create a new env the target is set to a value equal to default… you can change it to dev  
To handle multiple targets in dbt models you need to use jinja macros

---

<div class="post-metadata">

**Author:** ![Sergio](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sergio](https://discourse.getdbt.com/u/Sergio)\
**Post date:** [April 7, 2023, 10:15pm UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878/3 "2023-04-07T22:15:01Z")

</div>

First, thank you for your answer but as I said, I´m a new developer on dbt and I´d like to understand better about environments… from what you said, or at least, from what I understood, we can only define one schema target per environment? That is, if I need to work with different taget schemas do I have to create an environment for each schema? On the other hand to work with different targets in the same environment I could use jinja macros… but how can I do this? I looked in the documentation and didn’t find anything about this. Is there some variable environment or similar? I´m sorry if my questions are too basic…

---

<div class="post-metadata">

**Author:** ![Sergio](https://avatars.discourse-cdn.com/v4/letter/s/b77776/32.png) [@Sergio](https://discourse.getdbt.com/u/Sergio)\
**Post date:** [April 8, 2023, 3:56am UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878/4 "2023-04-08T03:56:35Z")

</div>

I´ve found a way to solve my problem… first I deleted macro get\_custom\_schema from macro´s directory. Then I create three different outputs for my target in my profile.yml:

```auto
outputs:
    stg:
      type: bigquery
      method: oauth
      project: dw-mkt-stn
      dataset: stage
      threads: 4
      timeout_seconds: 300
      location: US 
      priority: interactive
      retries: 1

    raw:
      type: bigquery
      method: oauth
      project: dw-mkt-stn
      dataset: raw
      threads: 4
      timeout_seconds: 300
      location: US 
      priority: interactive
      retries: 1

    prd:
      type: bigquery
      method: oauth
      project: dw-mkt-stn
      dataset: analytics
      threads: 4
      timeout_seconds: 300
      location: US 
      priority: interactive
      retries: 1

```

I ´ve created 3 main models: marts, staging and raw. When I run the models from marts, I just pass --target prd. In the case of staging, just add the --target stg parameter to the dbt run. But in the case of raw, I have different datasets with “Raw” as the dataset prefix… like: raw\_googleads, raw\_facebookads and so on.  
In this case, for each submodel created below the Raw model, I define the schema:schema\_name and then the dbt understands that I am providing a custom\_schema and creates the dataset using the target\_name that I defined: Raw, adding the schema\_name defined in schema.

I’m sure this might not be the best solution but it’s the one I managed to find and I’m sharing it with you guys. If anyone wants more details or wants to collaborate with other solutions, feel free to comment here.

---

<div class="post-metadata">

**Author:** ![amansoor](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@amansoor](https://discourse.getdbt.com/u/amansoor)\
**Post date:** [January 30, 2025, 12:32am UTC](https://discourse.getdbt.com/t/dbt-cloud-target-error-but-not-in-dbt-core/5878/5 "2025-01-30T00:32:57Z")

</div>

@Sergio Thank you for this, I am getting am error on outputs: where it is saying _property outputs not allowed_
