dbt-labs / dbt-rpc

A server that can compile and run queries in the context of a dbt project. Additionally, it provides methods that can be used to list and terminate running processes.
https://docs.getdbt.com/reference/commands/rpc
Apache License 2.0
19 stars 7 forks source link

[CT-2299] Receiving: ModuleNotFoundError: No module named 'dbt.contracts.graph.nodes' #125

Closed anubhavsharma515 closed 1 year ago

anubhavsharma515 commented 1 year ago

READ UPDATE BELOW

Hey!

I recently upgraded a dbt-core project from v1.0.6 to v1.3.3 (the patch release resulting from this: https://github.com/dbt-labs/dbt-core/issues/7075). As the orchestration of our project utilized dbt-rpc, it was also upgraded from v0.1.1 to v.0.3.0. Since then, our logs have been filled with this error:

from dbt_rpc.__main__ import main
File "/home/wattpad/.local/lib/python3.9/site-packages/dbt_rpc/__main__.py", line 25, in <module>
from dbt_rpc.task.server import RPCServerTask
File "/home/wattpad/.local/lib/python3.9/site-packages/dbt_rpc/task/server.py", line 2, in <module>
from . import sql_commands  # noqa
File "/home/wattpad/.local/lib/python3.9/site-packages/dbt_rpc/task/sql_commands.py", line 12, in <module>
from dbt.contracts.graph.nodes import RPCNode
ModuleNotFoundError: No module named 'dbt.contracts.graph.nodes'

I'm not sure if this is an error with the versions that I upgraded to, but would really appreciate any help with the same!

anubhavsharma515 commented 1 year ago

UPDATE:

From this slack thread, it was identified that the dependency mismatch for dbt-rpc v0.3.0 was causing this.

As per https://github.com/dbt-labs/dbt-rpc/blob/968681953f55a3cee95b88817b14b0382529793e/setup.py#L33, the v0.3.0 of dbt-rpc works for anything dbt-core above v1.3.0. However, this is not the case, and v0.3.0 should only be made available for dbt-core versions >=1.4.0 due to the introduction of contracts and graph.nodes.

jtcohen6 commented 1 year ago

@anubhavsharma515 Glad you were able to get this resolved. We released a newer version of dbt-rpc==0.3.1 with the appropriate pin on dbt-core. Going to close this issue