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

attempt to write a readonly database #1035

Open
eifr opened this issue Sep 7, 2024 · 9 comments
Open

attempt to write a readonly database #1035

eifr opened this issue Sep 7, 2024 · 9 comments

Comments

@eifr
Copy link

eifr commented Sep 7, 2024

after updating to 1.2.0 im getting this error for whaterver im trying to run:

~ pkgx deno --version
× unexpected error attempt to write a readonly database
│ Error: attempt to write a readonly database
│     at unwrap (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/util.ts:27:11)
│     at new Statement (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/statement.ts:110:5)
│     at Database.prepare (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/database.ts:138:12)
│     at Database.sql (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/database.ts:185:23)
│     at provides (https://deno.land/x/libpkgx@v0.19.0/src/hooks/useSyncCache.ts:84:18)
│     at eventLoopTick (ext:core/01_core.js:168:7)
│     at async _which (https://deno.land/x/libpkgx@v0.19.0/src/plumbing/which.ts:31:20)
│     at async which (https://deno.land/x/libpkgx@v0.19.0/src/plumbing/which.ts:10:20)
│     at async default (file:///tmp/deno-compile-pkgx/pkgx/src/prefab/resolve-arg0.ts:7:14)
│     at async find_arg0 (file:///tmp/deno-compile-pkgx/pkgx/src/modes/x.ts:96:15)
╰─➤ https://github.com/pkgxdev/pkgx/issues/new
@eifr
Copy link
Author

eifr commented Sep 8, 2024

Works again after uninstall and reinstall :)

@mxcl
Copy link
Member

mxcl commented Sep 8, 2024

Thanks for the heads up, we'll monitor. Nothing occurs for why this would happen currently, especially since reinstall worked unexpectedly.

@tekhnus
Copy link

tekhnus commented Sep 13, 2024

For me it started happening right after I interrupted an installation with Ctrl+C

@sporkd
Copy link

sporkd commented Sep 16, 2024

Just started experiencing this as well sometimes when I cd into a dev dir. Additionally, once it happens, it will keep happening even when I open a new terminal, which indicates to me it can even get triggered by pkgx --shellcode. I can fix with pkgx --sync but it keeps coming back.

@mxcl
Copy link
Member

mxcl commented Sep 21, 2024

I have yet to experience it. If I do I'll be able to figure it out. Until then I’ll keep noodling.

@clanghans
Copy link

currently experience the same thing with a slightly different log message in pkgx version 1.2.1

❯ dev
× unexpected error attempt to write a readonly database
│ Error: attempt to write a readonly database
│     at unwrap (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/util.ts:27:11)
│     at new Statement (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/statement.ts:110:5)
│     at Database.prepare (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/database.ts:138:12)
│     at Database.sql (https://deno.land/x/libpkgx@v0.19.0/vendor/sqlite3@0.10.0/src/database.ts:185:23)
│     at companions (https://deno.land/x/libpkgx@v0.19.0/src/hooks/useSyncCache.ts:119:18)
│     at eventLoopTick (ext:core/01_core.js:168:7)
│     at async Object.companions (https://deno.land/x/libpkgx@v0.19.0/src/hooks/usePantry.ts:72:16)
│     at async Promise.all (index 0)
│     at async default (file:///tmp/deno-compile-pkgx/pkgx/src/prefab/install.ts:9:25)
│     at async default (file:///tmp/deno-compile-pkgx/pkgx/src/modes/internal.activate.ts:26:25)

a pkgx --sync seemed to fix it. We'll see for how long

@clanghans
Copy link

clanghans commented Sep 27, 2024

I can reproduce the issue now. It happens when I request a package which is not existing and canceling the process while syncing.
After deleting the ~/.pkgx directory the issue is gone.
Log is attached.

log.txt

@mxcl
Copy link
Member

mxcl commented Sep 28, 2024

Unfortunately I cannot reproduce, but this does give me ammunition to try and figure it out. Thanks.,

@clanghans
Copy link

clanghans commented Sep 29, 2024

Unfortunately I cannot reproduce, but this does give me ammunition to try and figure it out. Thanks.,

You are on Mac, right? Is the cleanup/signal handling different than on Linux?

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

5 participants