deno-sqlite icon indicating copy to clipboard operation
deno-sqlite copied to clipboard

can't remove journal

Open ralyodio opened this issue 1 year ago • 1 comments

Looks like some internal code is trying to remove a file that doesn't exist:

error: Uncaught (in promise) NotFound: No such file or directory (os error 2), remove 'database.sqlite-journal'
      Deno.removeSync(path);

ralyodio avatar Jul 12 '22 01:07 ralyodio

error: Uncaught (in promise) NotFound: No such file or directory (os error 2), remove 'database.sqlite-journal'
      Deno.removeSync(path);
           ^
    at Object.opSync (deno:core/01_core.js:172:12)
    at Object.removeSync (deno:runtime/js/30_fs.js:150:10)
    at js_delete (https://deno.land/x/[email protected]/build/vfs.js:39:12)
    at denoDelete (wasm://wasm/002a4c4a:1:3036)
    at pager_end_transaction (wasm://wasm/002a4c4a:1:37798)
    at sqlite3BtreeCommitPhaseTwo (wasm://wasm/002a4c4a:1:28832)
    at sqlite3VdbeHalt (wasm://wasm/002a4c4a:1:45083)
    at sqlite3VdbeExec (wasm://wasm/002a4c4a:1:55654)
    at sqlite3_step (wasm://wasm/002a4c4a:1:53139)
    at step (wasm://wasm/002a4c4a:1:4377)

ralyodio avatar Jul 12 '22 01:07 ralyodio

Do you have a minimal example to reproduce the issue?

dyedgreen avatar Aug 23 '22 20:08 dyedgreen

Closing, since I could not reproduce the issue locally.

dyedgreen avatar Sep 04 '22 14:09 dyedgreen

I encouter this issue as well. It's quite often to reproduce, but not deterministic. @dyedgreen

CreatCodeBuild avatar Jun 14 '23 09:06 CreatCodeBuild

I encouter this issue as well. It's quite often to reproduce, but not deterministic. @dyedgreen

+1

Mutefish0 avatar Jul 27 '23 02:07 Mutefish0

I have also seen this issue a few times, but I am unable to reproduce it. When doing back to back inserts, I first see

No such file or directory (os error 2): remove '<mydbname>.db-journal'
    at Object.removeSync (ext:deno_fs/30_fs.js:197:7)
    at js_delete (https://deno.land/x/[email protected]/build/vfs.js:39:12)
    at <anonymous> (wasm://wasm/0027cea2:1:5584)
    at <anonymous> (wasm://wasm/0027cea2:1:86601)
    at <anonymous> (wasm://wasm/0027cea2:1:77100)
    at <anonymous> (wasm://wasm/0027cea2:1:173629)
    at <anonymous> (wasm://wasm/0027cea2:1:92188)
    at <anonymous> (wasm://wasm/0027cea2:1:63017)
    at <anonymous> (wasm://wasm/0027cea2:1:28077)
    at <anonymous> (wasm://wasm/0027cea2:1:114672) {
  name: "NotFound",
  code: "ENOENT"

followed by

RuntimeError: memory access out of bounds
    at <anonymous> (wasm://wasm/0027cea2:1:87936)
    at <anonymous> (wasm://wasm/0027cea2:1:176457)
    at <anonymous> (wasm://wasm/0027cea2:1:63257)
    at <anonymous> (wasm://wasm/0027cea2:1:28077)
    at <anonymous> (wasm://wasm/0027cea2:1:114672)
    at <anonymous> (wasm://wasm/0027cea2:1:4218)
    at <anonymous> (wasm://wasm/0027cea2:1:602494)
    at https://deno.land/x/[email protected]/src/db.ts:399:27
    at setStr (https://deno.land/x/[email protected]/src/wasm.ts:19:20)
    at DB.execute (https://deno.land/x/[email protected]/src/db.ts:396:20)

After this, the inserts appear to succeed but nothing is actually persisted to the database.

I see two issues that might be related: https://github.com/dyedgreen/deno-sqlite/issues/143 and https://github.com/dyedgreen/deno-sqlite/issues/149. Would running with --unstable potentially fix this? It looks like the file locking api might still be unstable https://deno.land/[email protected]?unstable&s=Deno.flock

dpclark4 avatar Aug 04 '23 23:08 dpclark4