GNU bug report logs - #76141
guix locate --clear tries to write to readonly database

Previous Next

Package: guix;

Reported by: yelninei <at> tutamail.com

Date: Sat, 8 Feb 2025 08:24:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: yelninei <at> tutamail.com
To: bug-guix <at> gnu.org
Subject: guix locate --clear tries to write to readonly database
Date: Sat, 8 Feb 2025 09:19:32 +0100 (CET)
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.




This bug report was last modified 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.