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>

To reply to this bug, email your comments to 76141 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#76141; Package guix. (Sat, 08 Feb 2025 08:24:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to yelninei <at> tutamail.com:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sat, 08 Feb 2025 08:24:02 GMT) Full text and rfc822 format available.

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.




Information forwarded to bug-guix <at> gnu.org:
bug#76141; Package guix. (Sun, 13 Apr 2025 09:27:04 GMT) Full text and rfc822 format available.

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

From: yelninei <at> tutamail.com
To: 76141 <76141 <at> debbugs.gnu.org>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Christopher Baines <guix <at> cbaines.net>
Date: Sun, 13 Apr 2025 11:26:23 +0200 (CEST)
[Message part 1 (text/plain, inline)]
Something like this fixes my issue.
[0001-locate-Request-writable-db-for-clear.patch (text/x-patch, attachment)]

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 15 Apr 2025 15:03:02 GMT) Full text and rfc822 format available.

Notification sent to yelninei <at> tutamail.com:
bug acknowledged by developer. (Tue, 15 Apr 2025 15:03:03 GMT) Full text and rfc822 format available.

Message #13 received at 76141-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: yelninei <at> tutamail.com
Cc: Josselin Poiret <dev <at> jpoiret.xyz>,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, 76141 <76141-done <at> debbugs.gnu.org>,
 Christopher Baines <guix <at> cbaines.net>
Subject: Re: none
Date: Tue, 15 Apr 2025 15:10:15 +0200
yelninei <at> tutamail.com writes:

> From c6333e210b6fd38b710800d9fc9b898f9b4409e2 Mon Sep 17 00:00:00 2001
> Message-ID: <c6333e210b6fd38b710800d9fc9b898f9b4409e2.1744535776.git.yelninei <at> tutamail.com>
> From: Yelninei <yelninei <at> tutamail.com>
> Date: Sun, 13 Apr 2025 09:08:39 +0000
> Subject: [PATCH] locate: Request writable db for --clear.
> 
> Fixes https://issues.guix.gnu.org/76141.
> 
> * guix/scripts/locate.scm (guix-locate): Use writable db when --clear is given.
> 
> Change-Id: I2e4e945cef022b08dd6af4c252e67c2a4d5bf38c

Applied, thanks!

Ludo’.




This bug report was last modified 9 days ago.

Previous Next


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