# dagster-cloud

Augustin YAICH

02/02/2023, 2:14 PM
Hello everyone, I'm new to Dagster and I am setting up Dagster Cloud Hybrid with an agent in GKE. I managed to add my code location correctly and to visualize my assets and jobs into the UI. However, when I try to materialize a dbt asset into Bigquery I encounter this error :
Copy code
dagster_dbt.errors.DagsterDbtCliFatalRuntimeError: Fatal error in the dbt CLI (return code 2): Running with dbt=1.3.2 Found 18 models, 0 tests, 0 snapshots, 0 analyses, 319 macros, 0 operations, 0 seed files, 16 sources, 3 exposures, 0 metrics BigQuery adapter: Please log into GCP to continue Encountered an error:
Could not find command, ensure it is in the user's PATH: "gcloud"
I use a service account to authenticate dbt in GCP and I've added the credentials to the environment variables.
Copy code
### profiles.yml

      dataset: dagster_dbt_dev
      job_execution_timeout_seconds: 300
      job_retries: 1
      location: EU
      method: service-account-json
      priority: interactive
      project: dagster-test-bq
      threads: 4
      type: bigquery
        type: "{{ env_var('dbt_sa_type', '') }}"
        project_id: "{{ env_var('dbt_sa_project_id', '') }}"
        private_key_id: "{{ env_var('dbt_sa_private_key_id', '') }}"
        private_key: "{{ env_var('dbt_sa_private_key', '') }}"
        client_email: "{{ env_var('dbt_sa_client_email', '') }}"
        client_id: "{{ env_var('dbt_sa_client_id', '') }}"
        auth_uri: "{{ env_var('dbt_sa_auth_uri', '') }}"
        token_uri: "{{ env_var('dbt_sa_token_uri', '') }}"
        auth_provider_x509_cert_url: "{{ env_var('dbt_sa_auth_provider_x509_cert_url', '') }}"
        client_x509_cert_url: "{{ env_var('dbt_sa_client_x509_cert_url', '') }}"
  target: dev
I can mention that my GKE cluster isn't hosted in the same GCP project as the Bigquery dataset but the service account has rights in both projects. Any ideas on how to fix this? Thanks!

Sean Lopp

02/02/2023, 3:02 PM
Usually I've seen this when the auth silently fails and attempts to fall back. Usually the culprit is the private key is improperly formatted, it can be tricky to get the newlines right I have switched to using this approach ...

Augustin YAICH

02/02/2023, 3:07 PM
Thank you Sean, I'll take a look to your approach