mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #73] SQLite crashes when importing large number of files from SillyTavern #10
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Limezero on GitHub (Apr 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/73
OS: Windows 10
Node: v20.18.1
Marinara-Engine Release: v1.4.8
Marinara-Engine Build:
0d7d59dWhen trying to use the "Import from SillyTavern" feature with a large SillyTavern instance (2883 chats in this case), node.exe will randomly crash in the middle of the import with error code
0xC0000005 Access Violation (Segmentation Fault)and no error message. This is a pain in the ass to debug since the crash happens before anything has a chance of intercepting it, but WinDbg claims it's coming fromINVALID_POINTER_READ_c0000005_index.node!Unknown.index.nodeis likelyMarinara-Engine\node_modules\.pnpm\@libsql+win32-x64-msvc@0.5.22\node_modules\@libsql\win32-x64-msvc\index.node, i.e. the libsql driver.Adding a timeout of 100ms before every loop or using a transaction does nothing, but forcing a different driver by putting
DATABASE_DRIVER=better-sqlite3into.envseems to fix it. I don't know if this is happening on a different Node version, different OS or different libsql, I don't have the energy to debug this further. Just thought I'd report it, since it might bite somebody in the ass later.As an aside, restarting a failed import like this also duplicates every single card and chatlog, which is very bad UX. You should probably check if an identical entry already exists, otherwise people will end up with 2-3 copies of the same card, potentially with hundreds of branches duplicated across all of them, and no good way of knowing what's linked to what.
@Limezero commented on GitHub (Apr 9, 2026):
Never mind, apparently all of the code is async, so better-sqlite3 doesn't work. No crashes, but none of the chats get imported with it either.
@Limezero commented on GitHub (Apr 9, 2026):
Gemini came up with this:
Removing the transaction and sending everything to the DB one by one fixes it, for whatever reason. The robot claims it's a "Use-After-Free or Race Condition when managing stateful transaction objects on Windows in libSQL", which sounds like a thing that someone who isn't me needs to look into.
@SpicyMarinara commented on GitHub (Apr 16, 2026):
addressed in v1.5.0.
@Limezero commented on GitHub (Apr 16, 2026):
It... doesn't seem to be? I'm not sure what "v1.5.0" is, but the issue is still happening with the latest commit on main (
8ebd810). I've reinstalled and updated Node since then, which hasn't fixed the issue either.@SpicyMarinara commented on GitHub (Apr 16, 2026):
I mean, I'd be surprised if the fix was applied already, given that v1.5.0 is not released yet.