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

[CT-2743] [Bug] dbt docs serve does not respect new input method for target-path #7953

Closed
2 tasks done
rabidaudio opened this issue Jun 26, 2023 · 3 comments
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@rabidaudio
Copy link

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

DBT 1.5 warns that target-path in dbt_project.yml is deprecated and should be replaced with --target-path or $DBT_TARGET_PATH.

We removed target-path from our dbt_project.yml and dbt debug reports all green:

18:03:06  Running with dbt=1.5.1
18:03:06  dbt version: 1.5.1
18:03:06  python version: 3.9.17
18:03:06  python path: /project/.meltano/transformers/dbt-postgres/venv/bin/python
18:03:06  os info: Linux-4.14.311-233.529.amzn2.x86_64-x86_64-with-glibc2.36
18:03:06  Using profiles.yml file at /project/transform/profiles/postgres/profiles.yml
18:03:06  Using dbt_project.yml file at /project/transform/dbt_project.yml
18:03:06  Configuration:
18:03:06    profiles.yml file [OK found and valid]
18:03:06    dbt_project.yml file [OK found and valid]
18:03:06  Required dependencies:
18:03:06   - git [OK found]

However, when we start the docs server it errors trying to read the target:

18:02:38  Running with dbt=1.5.1
18:02:38  Encountered an error:
[Errno 2] No such file or directory: 'target'
18:02:38  Traceback (most recent call last):
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 86, in wrapper
    result, success = func(*args, **kwargs)
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 71, in wrapper
    return func(*args, **kwargs)
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 142, in wrapper
    return func(*args, **kwargs)
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 168, in wrapper
    return func(*args, **kwargs)
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/requires.py", line 215, in wrapper
    return func(*args, **kwargs)
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/cli/main.py", line 299, in docs_serve
    results = task.run()
  File "/project/.meltano/transformers/dbt-postgres/venv/lib/python3.9/site-packages/dbt/task/serve.py", line 15, in run
    os.chdir(self.config.target_path)
FileNotFoundError: [Errno 2] No such file or directory: 'target'

Putting target-path back resolves the issue, while returning the warning about deprecation:

18:08:58  Running with dbt=1.5.1
18:08:58  [WARNING]: Deprecated functionality
The `target-path` config in `dbt_project.yml` has been deprecated, and will no
longer be supported in a future version of dbt-core. If you wish to write dbt
artifacts to a custom directory, please use the --target-path CLI flag or
DBT_TARGET_PATH env var instead.
Serving docs at 6450
To access from your browser, navigate to: http://localhost:6450



Press Ctrl+C to exit.

Interestingly, dbt docs generate does respect the new target path config, it's only when then serving said config that it breaks.

Expected Behavior

The dbt docs serve command should respond to --target-path and respect $DBT_TARGET_PATH, starting without error if an alternate target path was used to generate.

Steps To Reproduce

  1. Remove target-path: my_target_dir from dbt_project.yml
  2. export DBT_TARGET_PATH=my_target_dir
  3. dbt docs generate (Catalog written to my_target_dir/catalog.json)
  4. dbt docs serve

Relevant log output

No response

Environment

- OS: `python:3.9` Docker Image (Debian 12)
- Python: 3.9
- dbt: 1.5.1

Which database adapter are you using with dbt?

postgres

Additional Context

Possibly related to #7418

@rabidaudio rabidaudio added bug Something isn't working triage labels Jun 26, 2023
@github-actions github-actions bot changed the title [Bug] dbt docs serve does not respect new input method for target-path [CT-2743] [Bug] dbt docs serve does not respect new input method for target-path Jun 26, 2023
@dbeatty10
Copy link
Contributor

Thank you for reporting this @rabidaudio !

I was able to reproduce the same thing you described, and I think this would be solved by us backporting #7647 into the 1.5.latest branch.

I'll initiate a conversation to see if we can get that backported.

@dbeatty10 dbeatty10 removed the triage label Jun 26, 2023
@rabidaudio
Copy link
Author

Thanks! We would just update, but SQLFluff support is keeping us on 1.5

@jtcohen6
Copy link
Contributor

jtcohen6 commented Jun 28, 2023

Backport merged (#7961), this will be included in the next v1.5.x patch (most likely for release in July)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants