pkgx icon indicating copy to clipboard operation
pkgx copied to clipboard

attempt to write a readonly database

Open eifr opened this issue 1 year ago • 3 comments
trafficstars

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/[email protected]/vendor/[email protected]/src/util.ts:27:11)
│     at new Statement (https://deno.land/x/[email protected]/vendor/[email protected]/src/statement.ts:110:5)
│     at Database.prepare (https://deno.land/x/[email protected]/vendor/[email protected]/src/database.ts:138:12)
│     at Database.sql (https://deno.land/x/[email protected]/vendor/[email protected]/src/database.ts:185:23)
│     at provides (https://deno.land/x/[email protected]/src/hooks/useSyncCache.ts:84:18)
│     at eventLoopTick (ext:core/01_core.js:168:7)
│     at async _which (https://deno.land/x/[email protected]/src/plumbing/which.ts:31:20)
│     at async which (https://deno.land/x/[email protected]/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 avatar Sep 07 '24 20:09 eifr

Works again after uninstall and reinstall :)

eifr avatar Sep 08 '24 06:09 eifr

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

mxcl avatar Sep 08 '24 09:09 mxcl

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

zack-alex avatar Sep 13 '24 09:09 zack-alex

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.

sporkd avatar Sep 16 '24 22:09 sporkd

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

mxcl avatar Sep 21 '24 16:09 mxcl

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/[email protected]/vendor/[email protected]/src/util.ts:27:11)
│     at new Statement (https://deno.land/x/[email protected]/vendor/[email protected]/src/statement.ts:110:5)
│     at Database.prepare (https://deno.land/x/[email protected]/vendor/[email protected]/src/database.ts:138:12)
│     at Database.sql (https://deno.land/x/[email protected]/vendor/[email protected]/src/database.ts:185:23)
│     at companions (https://deno.land/x/[email protected]/src/hooks/useSyncCache.ts:119:18)
│     at eventLoopTick (ext:core/01_core.js:168:7)
│     at async Object.companions (https://deno.land/x/[email protected]/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 avatar Sep 23 '24 06:09 clanghans

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

clanghans avatar Sep 27 '24 12:09 clanghans

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

mxcl avatar Sep 28 '24 17:09 mxcl

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?

clanghans avatar Sep 29 '24 10:09 clanghans

No longer applies to pkgx^2

mxcl avatar Jan 15 '25 18:01 mxcl