content icon indicating copy to clipboard operation
content copied to clipboard

[stackblitz] Cannot start nuxt: SQLITE_BUSY: database is locked

Open Yves852 opened this issue 7 months ago • 1 comments

Environment

(stackblitz)

  • Operating System: Linux
  • Node Version: v20.19.1
  • Nuxt Version: 3.17.5
  • CLI Version: 3.25.1
  • Nitro Version: 2.11.12
  • Package Manager: [email protected]
  • Builder: -
  • User Config: modules, devtools, future, compatibilityDate
  • Runtime Modules: @nuxt/[email protected]
  • Build Modules: -

Version

v3.6.0

Reproduction

https://stackblitz.com/~/github.com/Yves852/nuxtcontent3.6.0-nuxtsitemap7.4.1

Description

I was creating a repro for a different issue.

  • Create a base repro with stackblitz.
  • Use npm install && npm run dev.
  • Maybe unnecessary, modify package.json for example add then remove a dependency.
  • Stop process and relaunch it with npm install && npm run dev again.

Additional context

No response

Logs

npm install && npm run dev

removed 8 packages in 3s

294 packages are looking for funding
  run `npm fund` for details

> dev
> nuxt dev

Nuxt 3.17.5 with Nitro 2.11.12                                                 nuxi 2:21:42 PM
                                                                                    2:21:42 PM
 
              █▀▀▀▀▀▀▀█▀▀▀█▀████▀████▀▀█▀█▀▀█▀▀▀▀▀▀▀█
              █ █▀▀▀█ █ ▄ ▀█▀█▀ ▀▄▄▀▀▄█ ▄█▀ █ █▀▀▀█ █
              █ █   █ █▄▄█▄█▀ ▄ █▄█▄▀▀▀█▄ ▀ █ █   █ █
              █ ▀▀▀▀▀ █ █▀▄ ▄ ▄▀█▀▄ █▀█▀▄ █ █ ▀▀▀▀▀ █
              █▀▀██▀▀▀██▄█▀▄▀ ▀▀ █▄   ▀ ██████▀█▀▀▀▀█
              █ █  ▀█▀ ▀▄▄▀ ▀▀▀████▀▀▄ ▄▄▀ ▄█▀▄ ▀▄ ██
              █▀▀███▀▀▀▄ ▀▄▀ █▄▄ ▄█   ███▄▀█  █▄▄ █ █
              ███▀██ ▀ ▀█ ██▄▄█  ▄█▄█▀   ▄ ▀▀██▄▄▄▄██
              █▀▄█ ▀▄▀ ▄  ▀▄▀ ▀█ ▄▀█ ▀▄▄█▀▀▀▀ ▄█▄ ▄▀█
              ██▄ ▀▄ ▀▄█  ▀ ▀▀▀█▀▀█▄▄█ ▄▀  ▄█▀▀▄▄▄▄██
              ██▀█▀▄▀▀▀ █ ▄▀ █▄  █▄  ▀ ███▀█▀ ▀▄▀  ▀█
              █▄  ▀▀▄▀█▄▀ ██▄▄ ▀▀ █▄▄█   ▄ ▀█▀█▄██▄██
              █▄ ▀▄█▀▀ ███▀▄▀ ▀█ ▄ ▄  ███▄▄▀█▀ ▄▀  ▀█
              █▄█▀▀ █▀▄ ▄▀▀ ▀▀ ▀  █▄▀▄ ▀▀  ▄█▀█  ▀▄██
              █▀▀ ▀██▀▄▄▄▄▄▀ █▄▀ ▄▄   ▄ █▄  ▀ ▀▀█ ▄██
              █▀▀▀▀▀▀▀█▄▄███▄▄ ▀▀▄█ ▀█ ██ █ █▀█ █▀███
              █ █▀▀▀█ █ ██▀▄▀ ▀█ ▄ █ ▀█▄█ █ ▀▀▀ █ ▄ █
              █ █   █ ██ ▄▀ ▀▀ █▀██▄▄█ ▀▀ █▀   ███▄▄█
              █ ▀▀▀▀▀ █ ▀█▄▀ ██▀ ▀▀▄   █▀▄ █▀▀ ▄█  ▀█
              ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
 
  ➜ Network:  https://stackblitz.com/edit/~/github.com/Yves852/nuxtcontent3.6.0-nuxtsitemap7.4.1 [QR code]
  ➜ Local:    http://localhost:3000/


[2:21:48 PM]  ERROR  (node:48) ExperimentalWarning: WASI is an experimental feature and might change at any time
(Use node --trace-warnings ... to show where the warning was created)

  ➜ DevTools: press Shift + Alt + D in the browser (v2.5.0)                         2:21:53 PM


 ERROR  Cannot start nuxt:  SQLITE_BUSY: database is locked                    nuxi 2:21:53 PM

    at sqliteError (node_modules/sqlite3/lib/sqlite3.pure.js:1:94706)
    at 51656 (node_modules/sqlite3/lib/sqlite3.pure.js:1:12557)
    at _emscripten_asm_const_int (node_modules/sqlite3/lib/sqlite3.pure.js:1:84040)
    at ccall (node_modules/sqlite3/lib/sqlite3.pure.js:1:5494)
    at Object.eval (node_modules/sqlite3/lib/sqlite3.pure.js:1:5844)
    at eval (node_modules/sqlite3/lib/pure/database.js:86:26)
    at processTicksAndRejections (node:internal/process/task_queues:196:998)
    at _0x52cf73 (https://nuxtcontent360nuxtsitemap741-so12.w-credentialless-staticblitz.com/blitz.82796488.js:31:537386)

Yves852 avatar Jun 18 '25 12:06 Yves852

This must be a result of some changes in Stackblitz. If you remove .data directory, it will run the server as expected.

However, I downloaded and tested in the local node environment, and there is no issue.

farnabaz avatar Jun 18 '25 14:06 farnabaz

Indeed. Have to delete the folder every time for Stackblitz. I tried to change to pnpm and replace sqlite3 for better-sqlite3 but it doesn't affect it.

Also curiously stackblits demand sqlite3 despite better-sqlite3 behing provided.

Yves852 avatar Jun 18 '25 15:06 Yves852

Also curiously stackblits demand sqlite3 despite better-sqlite3 behing provided.

better-sqlite3 did not work in Stackblitz due to its native bundles. Only sqlite3 works in Stackblitz.

farnabaz avatar Jun 20 '25 08:06 farnabaz

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

github-actions[bot] avatar Aug 19 '25 08:08 github-actions[bot]

This issue was closed because it has been stalled for 30 days with no activity.

github-actions[bot] avatar Sep 18 '25 09:09 github-actions[bot]