-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Querying MotherDuck does not work in Cube Core and Cube Cloud #8917
Comments
I examined connecting to MotherDuck from Cube Cloud and also from the DuckDB CLI again - there is an additional authentication step after the initial connection with the token - I get prompted to enter a generated 8-character code into web UI before the connection can be established successfully. I am also looking at the source code for the duckdb-driver and trying to run some of the commands in a node process. From node I can connect to a local db using db = new Database(localPath) as well as to MotherDuck using db = new Database('md:motherduck_token=' + token) without needing the second authentication step, but I can only query using db.all(QUERY, (err, res) => ...) whereas the source for the duckdb-driver seems to first create a connection using defaultConnection = db.connect() and then use defaultConnection.exec(QUERY, callback) to run queries. |
Thanks you @akatov, this is very helpful! 🙌 Would you mind contributing a fix? |
I spent some time investigating this issue and found that it was solvable just by installing the ca-certificates apt-get package. Specifically, running this in the exec tab of the running cube container on Docker for mac, then restarting the container results successfully connecting to Motherduck:
I can see that there are a few Dockerfile that include other apt-get install calls and the I also found that the additional authentication step you mention @akatov is actually duck db complaining that it can't find a token at all. If you follow the steps through, it prompts you to create a new token, then sets it (and/or suggests you set it as an environment variable). I noticed that the Related, it seems hard/impossible to set the token once the connection is open:
And when trying to do this
(this mainly comes from my experimentation with the |
I encountered a similar issue described on GitHub: #9273. Do you have any thoughts or solutions for this? The issue isrelated to connecting Cube to MotherDuck with DuckDB, and I am also experiencing problems with the deployment. I would greatly appreciate any suggestions or guidance you can offer. Thank you! |
Describe the bug
If
CUBEJS_DB_DUCKDB_MOTHERDUCK_TOKEN
is specified for theduckdb
driver so that it connects to MotherDuck, then any query would result in an error. In Cube Cloud, the query would run indefinitely. In Cube Core, a container will exit after an interval.To Reproduce
Steps to reproduce the behavior:
Expected behavior
Querying MotherDuck just works.
Screenshots

Minimally reproducible Cube Schema
Setting
CUBEJS_DB_SSL=true
does not change anything.Version:
v1.1.2, both in Cube Core and Cube Cloud
Additional context
Reported by at least two users in Slack: https://cube-js.slack.com/archives/C04NYBJP7RQ/p1723151261882389
The text was updated successfully, but these errors were encountered: