evidence-dev / evidence

Business intelligence as code: build fast, interactive data visualizations in pure SQL and markdown
https://evidence.dev
MIT License
4.47k stars 215 forks source link

[Bug]: DuckDB source fails build with Git LFS #2689

Closed archiewood closed 3 weeks ago

archiewood commented 3 weeks ago

Describe the bug

If you make an evidence project with a large duckdb file (>100MB) and put it in git, then it has to be stored as a git LFS object, which is not a duckdb file, but a pointer file.

This will build locally, but will fail in some (all?) deployment environments. At least Evidence Cloud.

[ ! ] Error connecting to datasource [source_name]: IO Error: 
The file "/path/to/fs/sources/[source_name]/[your_db].duckdb" exists, but it is not a valid DuckDB database file!

This is likely because DuckDB is looking for a duckdb file, but instead it sees a git LFS pointer.

Steps to Reproduce

Severity

serious, but I can work around it

Additional Information, or Workarounds

Store your data in a cloud database.

csjh commented 3 weeks ago

I think the solution here would just be to pull the lfs object itself with git lfs pull --include="path/to/file, not sure if there's anything we can or should do on our end

archiewood commented 3 weeks ago

@Kanishk1802 did your workaround function as expected?

Kanishk1802 commented 3 weeks ago

@archiewood the build is still running on cloud, waiting on it to finish to confirm it works

Kanishk1802 commented 3 weeks ago

tentatively think it has worked as the 'npm run sources' step passed on cloud but I'll verify again once the deployment is completed

Kanishk1802 commented 3 weeks ago

@archiewood my build succeeded, this can be listed as a workaround for this issue: Screenshot 2024-10-28 at 5 02 25 PM

Enable storage of Git LFS objects in archive, for the repo powering build.