Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dbt configuration not found on target using modified root_path for workspace #1855

Open
nfishe opened this issue Oct 23, 2024 · 1 comment
Open
Labels
Bug Something isn't working DABs DABs related issues

Comments

@nfishe
Copy link

nfishe commented Oct 23, 2024

Describe the issue

Attempting to create a pr based flow without git sources using the dbt task. The pr should create a bundle that is unique to the feature branch. When running the ci target the files synced from bundle do not seem to exist. dbt debug will execute fine iin dev target.

Configuration

Please provide a minimal reproducible configuration for the issue

bundle:
  name: dbt_project

include:
  - resources/*.yml

variables:
  prod_catalog:
    description: Prod catalog name
    default: ${workspace.current_user.short_name}_prod
  prep_catalog:
    description: Prep catalog name
    default: ${workspace.current_user.short_name}_prep

  raw_catalog:
    description: Raw catalog name
    default: tent_raw

  job_cluster_policy_id:
    lookup:
      cluster_policy: "dbt Compute"

  git_branch:
    description: Pass the git branch

targets:
  dev:
    default: true
    mode: development
    workspace:
      host: https:/xxxx.azuredatabricks.net

  ci:
    presets:
      name_prefix: 'ci_'
      tags:
        git_branch: ${var.git_branch}
    workspace:
      host: https://xxx.azuredatabricks.net
      root_path: /Workspace/Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}-${var.git_branch}
    resources:
      jobs:
        dbt_project_job:
          run_as:
            service_principal_name: xxxx

  prod:
    mode: production
    workspace:
      host: https://xxxx.azuredatabricks.net

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

All run in build pipeline for azure devops...

  1. set BUNDLE_VAR_* vars
  2. Run databricks bundle deploy --target ci
  3. Run databricks bundle run dbt_project_job --target ci
  4. See error

Expected Behavior

Clear and concise description of what should have happened

The dbt job has two commands dbt debug and dbt compile. The compile job should run or failure at least appear.

Actual Behavior

Clear and concise description of what actually happened

Failure on finding project and profiles dir

Output of job
+ dbt debug
02:22:07  Running with dbt=1.8.7
02:22:07  dbt version: 1.8.7
02:22:07  python version: 3.10.12
02:22:07  python path: /local_disk0/.ephemeral_nfs/cluster_libraries/python/bin/python
02:22:07  os info: Linux-5.15.0-1073-azure-x86_64-with-glibc2.35
02:22:07  Using profiles dir at /tmp/tmp-dbt-run-701529871603869/dbt_profiles
02:22:07  Using profiles.yml file at /tmp/tmp-dbt-run-701529871603869/dbt_profiles/profiles.yml
02:22:07  Using dbt_project.yml file at /tmp/tmp-dbt-run-701529871603869/dbt_project.yml
02:22:07  Configuration:
02:22:07    profiles.yml file [ERROR not found]
02:22:07    dbt_project.yml file [ERROR not found]
02:22:07  Required dependencies:
02:22:07   - git [OK found]

02:22:07  Connection test skipped since no profile was found
02:22:07  2 checks failed:
02:22:07  dbt looked for a profiles.yml file in /tmp/tmp-dbt-run-701529871603869/dbt_profiles/profiles.yml, but did
not find one. For more information on configuring your profile, consult the
documentation:

https://docs.getdbt.com/docs/configure-your-profile


02:22:07  Project loading failed for the following reason:
 project path </tmp/tmp-dbt-run-701529871603869/dbt_project.yml> not found

OS and CLI version

Please provide the version of the CLI (eg: v0.1.2) and the operating system (eg: windows). You can run databricks --version to get the version of your Databricks CLI

Ubuntu 22.04
v0.221.1

Is this a regression?

Did this work in a previous version of the CLI? If so, which versions did you try?

Not previous versions...but other targets in the same bundle...

Debug Logs

Output logs if you run the command with debug logs enabled. Example: databricks bundle deploy --log-level=debug. Redact if needed

+ export BUNDLE_VAR_git_branch=compile-job
+ BUNDLE_VAR_git_branch=compile-job
+ export BUNDLE_VAR_prod_catalog=tent_prod_clone_720
+ BUNDLE_VAR_prod_catalog=tent_prod_clone_720
+ export BUNDLE_VAR_prep_catalog=tent_prep_clone_720
+ BUNDLE_VAR_prep_catalog=tent_prep_clone_720
+ export BUNDLE_VAR_raw_catalog=raw
+ BUNDLE_VAR_raw_catalog=raw
+ case "$1" in
+ shift
+ bundleCacheCompile ci
+ local target=ci
++ databricks bundle run dbt_project_job --target ci --log-level=trace --output json
02:16:36  INFO start pid=4589 version=0.221.1 args="databricks, bundle, run, dbt_project_job, --target, ci, --log-level=trace, --output, json"
02:16:36 DEBUG Found bundle root at /agent/_work/1/s (file /agent/_work/1/s/databricks.yml) pid=4589
02:16:36 DEBUG Apply pid=4589 mutator=load
02:16:36  INFO Phase: load pid=4589 mutator=load
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=EntryPoint
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=scripts.preinit
02:16:36 DEBUG No script defined for preinit, skipping pid=4589 mutator=load mutator=seq mutator=scripts.preinit
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=ProcessRootIncludes
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=ProcessRootIncludes mutator=seq mutator=ProcessInclude(resources/dbt_project_job.yml)
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=VerifyCliVersion
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=EnvironmentsToTargets
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=InitializeVariables
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=DefineDefaultTarget(default)
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=LoadGitDetails
02:16:36 DEBUG Apply pid=4589 mutator=load mutator=seq mutator=SelectTarget(ci)
02:16:36 DEBUG Apply pid=4589 mutator=<func>

...
@nfishe nfishe added the DABs DABs related issues label Oct 23, 2024
@pietern
Copy link
Contributor

pietern commented Oct 24, 2024

Thanks for reporting the issue.

Looking at the job output, I suspect you're using a Git source for your jobs. Can you include your job configuration as well?

Btw, the most recent version of the CLI is v0.231.0. The one you're using is a few months old.

@pietern pietern added the Bug Something isn't working label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working DABs DABs related issues
Projects
None yet
Development

No branches or pull requests

2 participants