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

dagster_dbt.errors.DagsterDbtCliHandledRuntimeError: Handled error in the dbt CLI (return code 1) #26248

Open
danielkroeders opened this issue Dec 3, 2024 · 1 comment
Labels
integration: dbt Related to dagster-dbt type: troubleshooting Related to debugging and error messages

Comments

@danielkroeders
Copy link

What's the issue?

After trying to upgrade to a higher version for dbt-core I get the following error:

dagster_dbt.errors.DagsterDbtCliHandledRuntimeError: Handled error in the dbt CLI (return code 1)
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_core\errors.py", line 287, in user_code_error_boundary
yield
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_grpc\server.py", line 242, in init
loadable_targets = get_loadable_targets(
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_grpc\utils.py", line 50, in get_loadable_targets
else loadable_targets_from_python_module(module_name, working_directory)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_core\workspace\autodiscovery.py", line 35, in loadable_targets_from_python_module
module = load_python_module(
^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_core\code_pointer.py", line 134, in load_python_module
return importlib.import_module(module_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\importlib_init_.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "C:\Users\LENOVO\OneDrive - Rockfeather\Documents\dbt_dagster\dbtproject\dagsterproject\dagsterproject\definitions.py", line 5, in
from . import assets_etl, assets_pbi, assets_staging, assets_dbt
File "C:\Users\LENOVO\OneDrive - Rockfeather\Documents\dbt_dagster\dbtproject\dagsterproject\dagsterproject\assets_dbt.py", line 20, in
dbt_assets = load_assets_from_dbt_project(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_core\decorator_utils.py", line 203, in wrapped_with_pre_call_fn
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_dbt\asset_defs.py", line 608, in load_assets_from_dbt_project
manifest, cli_output = _load_manifest_for_project(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_dbt\asset_defs.py", line 86, in _load_manifest_for_project
cli_output = execute_cli(
^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_dbt\core\utils.py", line 225, in execute_cli
for event in _core_execute_cli(
^^^^^^^^^^^^^^^^^^
File "C:\Users\LENOVO\AppData\Local\Programs\Python\Python312\Lib\site-packages\dagster_dbt\core\utils.py", line 150, in _core_execute_cli
raise DagsterDbtCliHandledRuntimeError(messages=messages)

What did you expect to happen?

I found that dagster tries to find the dbt_cloud file and returns this error:
Encountered an error loading configuration: dbt_cloud.yml credentials file for dbt Cloud not found.

I already followed all instructions by uninstalling dbt and having only valid versions of dbt-core installed, but I still get the same error.

How to reproduce?

No response

Dagster version

dagster==1.7.3

Deployment type

Local

Deployment details

No response

Additional information

No response

Message from the maintainers

Impacted by this issue? Give it a 👍! We factor engagement into prioritization.
By submitting this issue, you agree to follow Dagster's Code of Conduct.

@danielkroeders danielkroeders added the type: bug Something isn't working label Dec 3, 2024
@garethbrickman
Copy link
Contributor

garethbrickman commented Dec 3, 2024

For compatibility, both the dbt Cloud CLI and dbt Core are invoked by running dbt command. This can create path conflicts if your operating system selects one over the other based on your $PATH environment variable (settings).

If you have dbt Core installed locally, either:

  1. Install using the pip3 install dbt pip command.
  2. Install natively, ensuring you either deactivate the virtual environment containing dbt Core or create an alias for the dbt Cloud CLI.
  3. (Advanced users) Install natively, but modify the $PATH environment variable to correctly point to the dbt Cloud CLI binary to use both dbt Cloud CLI and dbt Core together.

You can always uninstall the dbt Cloud CLI to return to using just dbt Core. Note that it’s possible that dbt Cloud CLI is installed outside of pip.

@garethbrickman garethbrickman added integration: dbt Related to dagster-dbt type: troubleshooting Related to debugging and error messages and removed type: bug Something isn't working labels Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration: dbt Related to dagster-dbt type: troubleshooting Related to debugging and error messages
Projects
None yet
Development

No branches or pull requests

2 participants