Skip to content
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

opfs: error calling db.open #1947

Open
qw-in opened this issue Jan 29, 2025 · 1 comment
Open

opfs: error calling db.open #1947

qw-in opened this issue Jan 29, 2025 · 1 comment

Comments

@qw-in
Copy link

qw-in commented Jan 29, 2025

What happens?

Trying to replicate the following opfs unit test:

const logger = new duckdb.ConsoleLogger(LogLevel.ERROR);
const worker = new Worker(bundle().mainWorker!);
db = new duckdb.AsyncDuckDB(logger, worker);
await db.instantiate(bundle().mainModule, bundle().pthreadWorker);
await db.open({
path: 'opfs://test.db',
accessMode: duckdb.DuckDBAccessMode.READ_WRITE
});
conn = await db.connect();

In this stackblitz playground

I am seeing the this error (open the preview in a new tab):

Error: Opening the database failed with error: {"exception_type":"IO","exception_message":"The file \"opfs://test.db\" exists, but it is not a valid DuckDB database file!"}
    open https://vitejsvitep9xkszdp-2g04--5173--1b4252dd.local-corp.webcontainer.io/node_modules/.pnpm/@[email protected]/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js:1
    onMessage https://vitejsvitep9xkszdp-2g04--5173--1b4252dd.local-corp.webcontainer.io/node_modules/.pnpm/@[email protected]/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js:1
    onmessage https://vitejsvitep9xkszdp-2g04--5173--1b4252dd.local-corp.webcontainer.io/node_modules/.pnpm/@[email protected]/node_modules/@duckdb/duckdb-wasm/dist/duckdb-browser-eh.worker.js:1
duckdb-browser-eh.worker.js:1:729159

Related: #1856

To Reproduce

  1. Open the playground: https://stackblitz.com/edit/vitejs-vite-p9xkszdp?file=src%2Fmain.ts
  2. See the developer tools console on the preview (open preview in a new tab)

Browser/Environment:

Chrome 131.0.6778.265, Firefox 134.0.2

Device:

macOS (M1)

DuckDB-Wasm Version:

1.29.1-dev53.0

DuckDB-Wasm Deployment:

https://stackblitz.com/edit/vitejs-vite-p9xkszdp?file=src%2Fmain.ts (don't really understand this...)

Full Name:

Quinn Blenkinsop

Affiliation:

None

@qw-in qw-in changed the title opfs: opfs: error calling db.open Jan 29, 2025
@bumberboy
Copy link

I'm having this same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants