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

initdb failing to complete in Bun #69

Open
AntsiferovMaxim opened this issue Apr 2, 2024 · 1 comment
Open

initdb failing to complete in Bun #69

AntsiferovMaxim opened this issue Apr 2, 2024 · 1 comment

Comments

@AntsiferovMaxim
Copy link

AntsiferovMaxim commented Apr 2, 2024

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);
@samwillis samwillis changed the title NOTICE: database system is shut down initdb failing to complete in Bun Apr 2, 2024
@samwillis
Copy link
Collaborator

initdb is failing complete when run in bun. Only about half the required work is done, it then fails to start in the next step.

2024-04-02 14:19:49.280 GMT [42] DEBUG:  checkpoint record is at 0/1000028
2024-04-02 14:19:49.280 GMT [42] DEBUG:  redo record is at 0/1000028; shutdown true
2024-04-02 14:19:49.280 GMT [42] DEBUG:  next transaction ID: 3; next OID: 12000
2024-04-02 14:19:49.280 GMT [42] DEBUG:  next MultiXactId: 1; next MultiXactOffset: 0
2024-04-02 14:19:49.280 GMT [42] DEBUG:  oldest unfrozen transaction ID: 3, in database 1
2024-04-02 14:19:49.280 GMT [42] DEBUG:  oldest MultiXactId: 1, in database 1
2024-04-02 14:19:49.280 GMT [42] DEBUG:  commit timestamp Xid oldest/newest: 0/0
2024-04-02 14:19:49.280 GMT [42] DEBUG:  transaction ID wrap limit is 2147483650, limited by database with OID 1
2024-04-02 14:19:49.280 GMT [42] DEBUG:  MultiXactId wrap limit is 2147483648, limited by database with OID 1
2024-04-02 14:19:49.280 GMT [42] DEBUG:  starting up replication slots
2024-04-02 14:19:49.281 GMT [42] DEBUG:  MultiXactId wrap limit is 2147483648, limited by database with OID 1
2024-04-02 14:19:49.281 GMT [42] DEBUG:  MultiXact member stop limit is now 4294914944 based on MultiXact 1
2024-04-02 14:19:49.418 GMT [42] FATAL:  cache lookup failed for index 2664
2024-04-02 14:19:49.418 GMT [42] PANIC:  cannot abort transaction 1, it was already committed
Aborted()

I'm digging into whats changed.

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