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
Serverside Rendering on Vercel fails; missing GLIBC_2.29 #15
Comments
@Mause we're using the NodeJS client - we're not sure, but perhaps this is new in 0.7.1? |
Which version does it work with? We can check for changes |
As Vercel is running on AWS Lambda as far as I know, I'm having a hard time imagining that this has worked before, as Lambda environments are currently based on Amazon Linux 2, which uses GLIBC 2.26. See https://repost.aws/questions/QUrXOioL46RcCnFGyELJWKLw/glibc-2-27-on-amazon-linux-2 I guess you could download my DuckDB for Lambda layer, and extract the build artifacts: https://github.com/tobilg/duckdb-nodejs-layer#arns |
Experiencing similar error on Vercel with both node 18.x and 16.x. https://github.com/pgzmnk/openb |
I therefor created https://www.npmjs.com/package/duckdb-lambda-x86 which should solve the actual issue. |
@archiewood any updates? |
I've encountered the same problem as described. Specifically, I'm using Environment:
Steps to Reproduce: docker run --rm -it node:14 bash In node:14 container mkdir app && cd app
yarn init -y
yarn add duckdb@0.7.1
cd node_modules/duckdb
npm test Are there any necessary packages that I need to install? Tranlated by ChatGPT. Sorry for my english is not good. I hope there's no offense. |
@hanshino the default |
Here's a wrapper over // lib/duckdb.ts
let _query: Promise<(query: string) => any>
_query = import("duckdb-async")
.then(duckdb => duckdb.Database)
.then(Database => Database.create(":memory:"))
.then((db: any) => ((query: string) => db.all(query)))
.catch(async error => {
console.log("duckdb init error:", error)
let duckdb = await import("duckdb-lambda-x86");
let Database: any = await duckdb.Database;
const db = new Database(":memory:")
const connection = db.connect()
return (query: string) => {
return new Promise((resolve, reject) => {
connection.all(query, (err: any, res: any) => {
if (err) reject(err);
resolve(res);
})
})
}
})
export { _query } Sample API endpoint that uses it: // /api/query.ts
import { _query } from "@/lib/duckdb"
import { NextApiRequest, NextApiResponse } from "next";
// Convert BigInts to numbers
function replacer(key: string, value: any) {
if (typeof value === 'bigint') {
return Number(value)
} else {
return value;
}
}
export default async function handler(
req: NextApiRequest,
res: NextApiResponse,
) {
const { body: { path } } = req
const query = await _query
const rows = await query(`select * from read_parquet("${path}")`) // 🚨 unsafe / SQLi 🚨
res.status(200).send(JSON.stringify(rows, replacer))
} |
FYI for others who run into this. I ended up using @tobilg's |
What happens?
When attempting to deploy some Javascript project to Vercel that leverages SSR and DuckDB; the build fails.
The error message being presented by DuckDB is
/lib64/libm.so.6: version 'GLIBC_2.29' not found (required by /vercel/path0/node_modules/duckdb/lib/binding/duckdb.node
.This has worked previously.
To Reproduce
This repo has a simple reproduction of the issue; simply create a vercel project based on this (or a fork), and the build will fail with the error message
https://github.com/ItsMeBrianD/duckdb-vercel-repro
OS:
Vercel
DuckDB Version:
0.7.1
DuckDB Client:
node
Full Name:
Brian Donald
Affiliation:
Evidence
Have you tried this on the latest
master
branch?Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
The text was updated successfully, but these errors were encountered: