Closed cboden closed 1 year ago
The "malformed database schema" error seems to be happening when connecting to the database file. Can you try using a SQL client program to connect to it and see if you get the same error? You can try the sqlite3 CLI or a program like DBeaver, DataGrip, TablePlus, etc. If you get the same error, it suggests your database file might be corrupted and in need of repair. (As always, make backups of everything before any repairs)
Along the same lines, if you have backups of the sqlite db file from prior to this error, you can try seeing if the job runs with that old copy.
Another possibility is some kind of version mismatch between your system's SQLite library (if it was upgraded as part of an OS update or something) and the version of the file.
Can you try dropping that view in the error message and seeing if dbt will at least successfully establish a connection to the db?
I dropped all views, same error
Bizarre. Try renaming the database file so that dbt-sqlite creates a brand new one, and see what happens.
Otherwise, I'm out of troubleshooting idea, sorry. I can't think of anything in dbt-sqlite that would suddenly fail in this way. If you do figure it out, please let me know!
Same error ☹️
Whoa. I would double check all your paths, and any nfs/samba mounts, and make sure your dbt config is pointing to the files you think they're pointing to.
No networking magic. Failure on macOS 13.2 and OS X 10.14.6. I double checked all paths (copy/pasted) values, all present (expected, as I changed nothing).
I ran the following commands as well: dbt clean && dbt deps && dbt debug
. debug still resulted in same error. dbt parse
gives same error.
Figured it out. I accidentally backed up the database file in the same directory on both machines 🤦♂️. I think dbt-sqlite was loading all db files in the schema_directory as schemas and got mad that some tables were the same name. My bad. Thank you for your prompt replies in assisting my troubleshooting!
Ahh, I forgot about that behavior of loading all the files in schema_directory. Good catch! Relieved you figured this out.
I'm sure this is a weird issue...dbt started failing this morning on multiple independent machines.
With dbt-sqlite I have a cron job that runs
dbt run
every hour and has been for months. This morning it started failing. I started debugging and it's gotten weird...when I hit a wall, I opened up the project on another machine that had a backup from yesterday. When runningdbt run
I got the same error.dbt run
was run on this version of the database multiple times since yesterday without issue on the original machine. My working theory here was there was some newly ingested data causing issues, but this seems to have ruled that out.I haven't changed anything in days...no source code, no models, no binaries, no system update, no system reboot, etc. It's been on a server running in the background. The only thing I changed, after the error started happening I updated the config to not report metrics back to dbt in hopes a network problem was causing it, but that didn't help.
Here's the output of
dbt debug
:Here is the output from dbt.log while running
dbt debug
:I'm bewildered and don't know where to go from here. Any help would be greatly appreciated.