guix locate --clear tries to write to readonly database

  • Open
  • quality assurance status badge
Details
One participant
  • yelninei
Owner
unassigned
Submitted by
yelninei
Severity
normal

Debbugs page

yelninei wrote 1 months ago
(address . bug-guix@gnu.org)
OIZa-vD--F-9@tutamail.com
When a system wide database exists (at /var/cache/guix/locate/db.sqlite) 'guix locate --clear' invoked as an unprivileged user tries to write to it and fail.
Steps to reproduce:
- sudo mkdir -p /var/cache/guix/locate
- sudo touch /var/cache/guix/locate/db.sqlite
- guix locate --clear
Observe the exception:
ice-9/boot-9.scm:1685:16: In procedure raise-exception:
Throw to key `sqlite-error' with args `(sqlite-exec 8 "attempt to write a readonly database")'.

I think the issue is that the 'suitable-database' procedure does not get passed the CREATE?
parameter (indicating that we want a writable db)  when '--clear'  is given.

I discovered this because this caused the guix-locate.sh test to fail in an normal checkout.
The db in /var/cache/guix/locate/db.sqlite is created and updated via the package-database-service-type.

Thanks.
?
Your comment

Commenting via the web interface is currently disabled.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 76141
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help