guix locate guild results in sqlite3 attempt to write readonly database

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Matt Wette
Owner
unassigned
Submitted by
Matt Wette
Severity
important
M
M
Matt Wette wrote on 18 Oct 2023 17:47
(address . bug-guix@gnu.org)
e9e5c99b-6d81-4243-af18-8765d97b2155@gmail.com
`guix locate guild' fails with attempt to write a readonly sqlite3 database

mwette@bluefin$ strace -o logx guix locate guild
guix locate: indexing files from /gnu/store...
guix locate: traversing local profile manifests...
Backtrace:
          13 (primitive-load "/home/mwette/.config/guix/current/bin/…")
In guix/ui.scm:
   2323:7 12 (run-guix . _)
  2286:10 11 (run-guix-command _ . _)
In ice-9/boot-9.scm:
  1752:10 10 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/locate.scm:
    621:8  9 (_)
    123:8  8 (call-with-database _ _)
In guix/progress.scm:
    71:36  7 (call-with-progress-reporter _ _)
In srfi/srfi-1.scm:
    634:9  6 (for-each #<procedure 7f179a23ca00 at guix/scripts/loc…> …)
In guix/scripts/locate.scm:
    442:2  5 (_ _)
    286:2  4 (insert-files #<<sqlite-db> pointer: #<pointer 0x1f98f…> …)
In srfi/srfi-1.scm:
    634:9  3 (for-each #<procedure 7f179abb3000 at guix/scripts/loc…> …)
In sqlite3.scm:
   637:15  2 (sqlite-fold #<procedure 7f179a23c5a0 at ice-9/boot-9.…> …)
    166:2  1 (_ _)
In ice-9/boot-9.scm:
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `sqlite-error' with args `(#f 8 "attempt to write a
readonly database")'.
indexing 1,654 packages
mwette@bluefin$
Attachment: logx
L
L
Ludovic Courtès wrote on 18 Oct 2023 17:54
(name . Matt Wette)(address . matt.wette@gmail.com)(address . 66612@debbugs.gnu.org)
87wmvk53jl.fsf@gnu.org
Hi,

Matt Wette <matt.wette@gmail.com> skribis:

Toggle quote (6 lines)
> `guix locate guild' fails with attempt to write a readonly sqlite3 database
>
> mwette@bluefin$ strace -o logx guix locate guild
> guix locate: indexing files from /gnu/store...
> guix locate: traversing local profile manifests...

The bug here is that it picked the system-wide database:

openat(AT_FDCWD, "/var/cache/guix/locate/db.sqlite", O_RDONLY|O_NOFOLLOW|O_CLOEXEC) = 14

but later decided that it was too old and that it needed to be
refreshed. But of course, that file is read-only for unprivileged
users.

There’s a bug in the file-choosing logic.

To be continued…

Ludo’.
L
L
Ludovic Courtès wrote on 18 Oct 2023 17:55
control message for bug #66612
(address . control@debbugs.gnu.org)
87v8b453j8.fsf@gnu.org
severity 66612 important
quit
L
L
Ludovic Courtès wrote on 18 Oct 2023 23:13
Re: bug#66612: guix locate guild results in sqlite3 attempt to write readonly database
(name . Matt Wette)(address . matt.wette@gmail.com)(address . 66612-done@debbugs.gnu.org)
87lebz4ot0.fsf@gnu.org
Fixed in commit d0fed2f4df06446eafcc992f0bc7ea154124fdf4, thanks!

Ludo'.
Closed
L
L
Ludovic Courtès wrote on 19 Oct 2023 17:33
(name . Matt Wette)(address . matt.wette@gmail.com)(address . 66612@debbugs.gnu.org)
877cni39vo.fsf@gnu.org
Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (10 lines)
> Matt Wette <matt.wette@gmail.com> skribis:
>
>> `guix locate guild' fails with attempt to write a readonly sqlite3 database
>>
>> mwette@bluefin$ strace -o logx guix locate guild
>> guix locate: indexing files from /gnu/store...
>> guix locate: traversing local profile manifests...
>
> The bug here is that it picked the system-wide database:

The immediate workaround is to run ‘guix locate --update’ once: it’ll
create an up-to-date database under ~/.cache, which will then be used
unconditionally.

Ludo’.
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66612@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66612
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch