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
Another "FATAL ERROR: v8::ToLocalChecked Empty MaybeLocal" error #842
Comments
FWIW Node 12 is EOL (and has for several months, and several security issues have not been back-patched to that series). Can you reproduce on a current Node and the latest version of this project? |
Yeah I'm aware of that - unfortunately it's a constraint of the project for the time being 🥲 don't think i specifically tested it locally but I think our CI (which runs this test on Node 12, 14, and 16) encountered the same issue. will try to upgrade the module and see if that helps. stay tuned... |
The stack trace is helpful, but unfortunately I can't diagnose the problem much without a reproducible example. The code path that's failing is working perfectly in all our tests. |
I'll try to spend some time attempting to repro it, although I'm traveling for a bit soon so may be a while 😅 |
Not a minimal repro but just for me to look back on - here's a snippet from what i'm working with that currently fails (not all the time, but maybe ~50%): const deleteStyleTransaction = db.transaction(() => {
// Some stuff before this...
db.prepare(
`
CREATE VIEW DeletableTilesetIds AS
SELECT SourceToTilesetIdOuter.value AS tilesetId, Style.id AS styleId
FROM Style, json_each(Style.sourceIdToTilesetId, '$') AS SourceToTilesetIdOuter
JOIN (
SELECT SourceToTilesetIdInner.value AS tilesetId, COUNT(SourceToTilesetIdInner.value) AS freq
FROM Style, json_each(Style.sourceIdToTilesetId, '$') AS SourceToTilesetIdInner
GROUP BY SourceToTilesetIdInner.value
) AS TilesetIdFreq ON SourceToTilesetIdOuter.value = TilesetIdFreq.tilesetId
WHERE freq = 1;
`
).run()
db.prepare(
'DELETE FROM Tile WHERE tilesetId ' +
'IN (SELECT tilesetId FROM DeletableTilesetIds WHERE styleId = ?)'
).run(id)
/**
* Deleting this specific statement seems to prevent the issue from happening 🤔
*/
db.prepare(
'DELETE FROM Tileset WHERE id ' +
'IN (SELECT tilesetId FROM DeletableTilesetIds WHERE styleId = ?)'
).run(id)
db.prepare('DROP VIEW DeletableTilesetIds').run()
// Some stuff after this...
})
deleteStyleTransaction() |
Looks like I'm running into a similar error. Apologies for potential redundancy (seem to be quite a few issues with this error message but with different causes)
Node version: 12.18.3
better-sqlite3 version: 7.5.3
OS: MacOS 11.6.7 (Big Sur), Intel
Haven't figured out a minimal reproduction but can make note of the thing that seems to cause it. I have a set of 4 statements that are run within a transaction (better-sqlite3 transaction, not hardcoded). There are other statements in this transaction, but this set seems to be causing issues. The nature of the statements are as follows:
json_each
stuffOther important notes:
Entirely possible that this is a red herring. Also, could be approaching this in a non-idiomatic way and maybe there's a better way of doing the above that avoids the issue. Maybe using a CTE might be a better approach, although it seemed to be much slower than using a view since it has to be run for each deletion statement.
Apologies for not having a minimum repro available, but will try for a bit and see if I can create one
Originally posted by @achou11 in #281 (comment)
The text was updated successfully, but these errors were encountered: