pglite
pglite copied to clipboard
initdb failing to complete in Bun
When attempting to launch PGLite with the specified file path, I encounter an error. However, if PGLite is run in memory, the error does not occur. OS: macOS, Runtime: bun.
Error:
2024-04-02 13:02:37.490 GMT [42] NOTICE: Init WASM shared memory
2024-04-02 13:02:37.492 GMT [42] LOG: database system was interrupted; last known up at 2024-04-02 13:02:37 GMT
2024-04-02 13:02:37.493 GMT [42] DEBUG: checkpoint record is at 0/1000028
2024-04-02 13:02:37.493 GMT [42] DEBUG: redo record is at 0/1000028; shutdown true
2024-04-02 13:02:37.493 GMT [42] DEBUG: next transaction ID: 3; next OID: 12000
2024-04-02 13:02:37.493 GMT [42] DEBUG: next MultiXactId: 1; next MultiXactOffset: 0
2024-04-02 13:02:37.493 GMT [42] DEBUG: oldest unfrozen transaction ID: 3, in database 1
2024-04-02 13:02:37.493 GMT [42] DEBUG: oldest MultiXactId: 1, in database 1
2024-04-02 13:02:37.493 GMT [42] DEBUG: commit timestamp Xid oldest/newest: 0/0
2024-04-02 13:02:37.493 GMT [42] DEBUG: transaction ID wrap limit is 2147483650, limited by database with OID 1
2024-04-02 13:02:37.494 GMT [42] DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
2024-04-02 13:02:37.494 GMT [42] DEBUG: starting up replication slots
2024-04-02 13:02:37.494 GMT [42] LOG: database system was not properly shut down; automatic recovery in progress
2024-04-02 13:02:37.494 GMT [42] DEBUG: resetting unlogged relations: cleanup 1 init 0
2024-04-02 13:02:37.496 GMT [42] LOG: invalid record length at 0/10000A0: wanted 24, got 0
2024-04-02 13:02:37.496 GMT [42] LOG: redo is not required
2024-04-02 13:02:37.496 GMT [42] DEBUG: resetting unlogged relations: cleanup 0 init 1
2024-04-02 13:02:37.498 GMT [42] DEBUG: MultiXactId wrap limit is 2147483648, limited by database with OID 1
2024-04-02 13:02:37.498 GMT [42] DEBUG: MultiXact member stop limit is now 4294914944 based on MultiXact 1
2024-04-02 13:02:37.499 GMT [42] FATAL: could not open file "global/pg_filenode.map": No such file or directory
2024-04-02 13:02:37.499 GMT [42] NOTICE: shutting down
2024-04-02 13:02:37.500 GMT [42] NOTICE: database system is shut down
Code:
import { PGlite } from "@electric-sql/pglite";
export const db = new PGlite("file://pgdata", { debug: 1 });
const res = await db.query("select 'Hello world' as message;");
console.log(res);