evidence-dev / evidence

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

Missing Credentials Error when deploying to Vercel #727

Closed archiewood closed 1 year ago

archiewood commented 1 year ago

Bug Description

When attempting to deploy with duckdb to Vercel, Evidence fails to read in the database configuration.

image

image

Netlify does not have this issue.

Slack thread

Severity

Expected Behavior It should deploy.

Workarounds Use Netlify or Evidence Cloud to deploy.

Environment Information Package versions: v15.0.1

Database:

mcrascal commented 1 year ago

To reproduce:

  1. Building Evidence from a sub directory, called reports (need to confirm it does work in root)
  2. Using duckdb where the database file is checked into the repo, per the docs

Suspicion is that this is a file path issue arising because of the subdirectory setting in vercel and the way we're reading the ddb instance. See below -- @archiewood repro'd without changing root directory.

archiewood commented 1 year ago

I repro'ed the error when building in root last week, using this repo.

archiewood commented 1 year ago

Looked into this in a bit more detail:

if I get vercel to run printenv DATABASE && printenv DUCKDB_FILENAME during the build process, it successfully returns

image

But then later in the build:

image
archiewood commented 1 year ago

reproduced in template project: https://template-azyx44stb-evidence-dev.vercel.app/

vs netlify: https://main--evidence-template.netlify.app/

archiewood commented 1 year ago

This appears to be a duckdb specific issue. Snowflake does not exhibit the same behaviour.

ItsMeBrianD commented 1 year ago

/lib64/libm.so.6: version 'GLIBC_2.29' not found (required by /vercel/path0/node_modules/duckdb/lib/binding/duckdb.node)

Looks like this is related to the environment that vercel is running builds in; I'm not entirely sure how to proceed with this.

archiewood commented 1 year ago

I’d at least try opening an issue with duckdb? They are pretty responsive and helpful.

mcrascal commented 1 year ago

@ItsMeBrianD

Good find

archiewood commented 1 year ago

One thing I don't understand. I'm reasonably sure that duckdb projects used to build on vercel pre SK1.0? ie with v 14.0.0 or similar

ItsMeBrianD commented 1 year ago

I did a test on vercel to see which version of glibc is being used, looks like it's ldd (GNU libc) 2.26; so this might be a "duckdb upgraded their dep", rather than a SK breaking change

ItsMeBrianD commented 1 year ago

We can track this here: duckdb/duckdb-node#15 Going to update docs and move on for the time being