Issue resolved with 'READ_ONLY' access_mode, as per: duckdb/duckdb#7743 (comment)
This gist showcases how DuckDB on nodejs fails to with "Connection was never established or has been closed already" when running in cluster mode.
Calling (using an in :memory: database)
node cluster.js
outputs the correct result
Forked child
Forked child
Forked child
Forked child
Child done
Child done
Child done
Child done
42
42
42
42
If we use a file database
node cluster.js some-db.duckdb
it'll only run the query once, all other processes in the cluster will fail
Forked child
Forked child
Forked child
Forked child
Child done
Child done
Child done
Child done
42
[Error: Connection Error: Connection was never established or has been closed already] {
errno: -1,
code: 'DUCKDB_NODEJS_ERROR',
errorType: 'Connection'
}