https://dagster.io/ logo
Title
n

Nicolas Gaillard

10/20/2021, 3:51 PM
Hello folks, I'm using dbt 0.20.2, Dagster (which is running inside a container) and dagster-dbt 0.12.4. I am trying to set up the
DbtRpcClient
and everything looks fine when I want to run or test models but when I want to run the
dbt ls
command, I can't get the result on the Dagster side and I have no error on the RPC server :
{'error': {'code': -32000, 'message': 'Server error', 'data': {'type': 'InternalException', 'args': ['No matching handler found for rpc method None (which=list)'], 'message': 'No matching handler found for rpc method None (which=list)'}}, 'id': '38ac7b10-31bb-11ec-a63a-0242ac120004', 'jsonrpc': '2.0'}
I don't understand, the command is normally supported on DBT since if I put a wrong command, I get the following message:
{'error': {'code': -32602, 'message': 'Invalid params', 'data': {'type': 'TypeError', 'args': ["dbt: error: invalid choice: 'foo' (choose from 'docs', 'source', 'init', 'clean', 'debug', 'deps', 'list', 'ls', 'build', 'snapshot', 'rpc', 'run', 'compile', 'parse', 'test', 'seed', 'run-operation')\n"], 'message': "dbt: error: invalid choice: 'foo' (choose from 'docs', 'source', 'init', 'clean', 'debug', 'deps', 'list', 'ls', 'build', 'snapshot', 'rpc', 'run', 'compile', 'parse', 'test', 'seed', 'run-operation')\n"}}, 'id': '79795a54-31bc-11ec-9a83-0242ac120004', 'jsonrpc': '2.0'}
I use this block of code to run DBT ls :
dbt_rpc_client = DbtRpcClient()
ls_command = "ls"
out = dbt_rpc_client .cli(command=ls_command, task_tags={})
I tried to upgrade DBT and nothing happens. All other commands work. Has anyone had this problem? Thank you in advance and have a nice day!
o

owen

10/20/2021, 4:38 PM
hi @Nicolas Gaillard, I was able to replicate this behavior, but I think this is actually an issue on the
dbt
side of things. Even directly sending http requests to the rpc server yields the same response. I think the functionality to be able to run dbt ls commands over rpc is actually somewhat new, so it may be possible that this is just a genuine bug.
n

Nicolas Gaillard

10/20/2021, 4:57 PM
Hi Owen thanks for your quick reply. I will post about it on the dbt slack channel !
1
😛artydagster: 1
Hello @owen, I have tried to send directly http request and it worked... Which request did you send ? Mine on the endpoint
localhost:8580/jsonrpc
:
{
  "jsonrpc": "2.0",
  "method": "list",
  "id": "",
  "params": {
    "resource_types": [
      "snapshot"
    ]
  }
}
o

owen

10/21/2021, 4:06 PM
@Nicolas Gaillard ah ok -- it looks like instead of using the "cli" method and invoking the list command using cli syntax, there is a special-purpose method for list (doesn't seem to be documented on the site, but maybe I'm missing something). we can add that to our resource implementation in next week's release.
n

Nicolas Gaillard

10/22/2021, 11:02 AM
Hi @owen, it would be great ! Do I have to open an issue or do something ?
o

owen

10/22/2021, 3:05 PM
no need — i've actually already merged in the fix, it'll be out in the next release :)