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

db enters invalid state, causing many subsequent errors and requiring a reload #94

Open
AntonOfTheWoods opened this issue May 24, 2024 · 1 comment

Comments

@AntonOfTheWoods
Copy link

I am using pglite in tandem with electric, while also adding a few tables and views.

In my install procedure I have a few occasions where a read query can be made before the objects (tables, views) are created. I am getting the following kinds of errors:

GoalsWidget.tsx:49 Uncaught (in promise) error: relation "non_fallback_only_view" does not exist

Which are then followed by:

electric-sql_pglite.js:4239 error performing snapshot: error: unrecognized node type: 67143218
...
chunk-OVRU7FYL.js:1 Uncaught (in promise) error: unrecognized node type: 67143218

Subsequent attempts to CREATE VIEWs then cause errors, though it seems indexes can get created... It also seems that most INSERT queries do execute, so my initialisation process can continue. When I get to a CREATE OR REPLACE VIEW, I then get a :

RuntimeError: null function or function signature mismatch
    at postgres.wasm
    at postgres.wasm
...

And

electric-sql_pglite.js:4239 error performing snapshot: Infinity
Uncaught (in promise) Infinity
... many times then
electric-sql_pglite.js:4239 error performing snapshot: RuntimeError: Aborted(). Build with -sASSERTIONS for more info.

If I then reload everything and execute the CREATEs that failed, they all execute fine.

Basically, it appears that any sort of query error puts the db into an invalid state, and causes many things to break after that, with basically everything getting fixed with a complete page reload.

@AntonOfTheWoods
Copy link
Author

I am also getting

RuntimeError: memory access out of bounds
    at postgres.wasm:0x1bae3a
...
    at us (chunk-EKNQE2HU.js?v=f34be11b:4:14038)
    at postgres.wasm:0x491aae

After errors.

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

1 participant