GNU bug report logs - #36706
"guix gc --verify" fails with "FOREIGN KEY constraint failed"

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix; Reported by: Ingo Ruhnke <grumbel@HIDDEN>; dated Wed, 17 Jul 2019 17:35:02 UTC; Maintainer for guix is bug-guix@HIDDEN.

Message received at 36706 <at> debbugs.gnu.org:


Received: (at 36706) by debbugs.gnu.org; 21 Jul 2019 23:37:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 21 19:37:14 2019
Received: from localhost ([127.0.0.1]:59688 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hpLOE-0000b5-56
	for submit <at> debbugs.gnu.org; Sun, 21 Jul 2019 19:37:14 -0400
Received: from mail-pf1-f181.google.com ([209.85.210.181]:33121)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cmmarusich@HIDDEN>) id 1hpLOD-0000at-4K
 for 36706 <at> debbugs.gnu.org; Sun, 21 Jul 2019 19:37:13 -0400
Received: by mail-pf1-f181.google.com with SMTP id g2so16466347pfq.0
 for <36706 <at> debbugs.gnu.org>; Sun, 21 Jul 2019 16:37:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=RcsbBrMIFNaK0i411i5wBQGPTHQpdS6NtkTsgeYvNWA=;
 b=qGP1r1QNM5Asn+gR95sGGvde4T0pb4czSxC6fuTNEg3L4BxIGcBiBPq/0B3tpi9qpc
 CULVfSxA11XjHfDY7Rvb+E4/ncKt87obGPc/blbkaQaU+/XCv+kLHjn9S1VVVi7tMUex
 scHm8Pt2BPCFe+OSv7CQzW7YSCIhPU9GJsH+afDypJ1qCt/kjesmCU8v9Y7PzfG5LHHl
 Xss4CDDXl42u02lygOJlQTsP/yy91RhcsQLmS5ccBvHrDVyznk7v253whVQG618j6zvZ
 LL/+R1+NnwjPomLw6vwH6WRocrFQB3CrFsCuq6f/3CYHiqm/MiNjmB9aZPyaRlr9eikr
 KBAg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=RcsbBrMIFNaK0i411i5wBQGPTHQpdS6NtkTsgeYvNWA=;
 b=H46o/ybS+0iEKjKjEGMhlGHReP2ExeFw0+raYLad5tWHeG2m0auTzkrAihWy6VLSFW
 y3HlRjMGk4nF9JNSDXXj3JYR4Ltgu2I/dl9avzRLnT7cMV8NHGbDji60pFNVIBC7gR0g
 0IgAyZVz3pjLj/ycG77Vx2YxYS/KGxqodJDfZwQWqb8BYdRgoIdocdqflg+7UY9OxxrF
 p/6V282YAKTLwOrjJWQ1OvRTE+LG624C3gIpgoB4WOBWvVM35KDoHj6g3wzzfw8/HyOb
 Y1j1vJ3gTiIOYJa6OYSDLGAn7ghXZgov/72p9eckQhpRFK0mRv9Iy/hBAD5DOZBp8DQS
 q6CQ==
X-Gm-Message-State: APjAAAUjsh05l/sPMkG5B3V18I5VmL+WiHLH29Eng4GK79azCU6lI5aC
 Gov5NwI0bK6rJDIg60THedKfTEqV
X-Google-Smtp-Source: APXvYqwFM8GbCrpj1SYydxoeBiwxXG4y6CjOSDsKsXeFUZ8Sc+FrQYqXzTWWjC7EV/DDmbyTVWg02g==
X-Received: by 2002:a65:6552:: with SMTP id a18mr58915486pgw.208.1563752226659; 
 Sun, 21 Jul 2019 16:37:06 -0700 (PDT)
Received: from garuda.local ([2601:601:9d80:25b2::d12])
 by smtp.gmail.com with ESMTPSA id 65sm37729218pff.148.2019.07.21.16.37.04
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Sun, 21 Jul 2019 16:37:05 -0700 (PDT)
From: Chris Marusich <cmmarusich@HIDDEN>
To: Ingo Ruhnke <grumbel@HIDDEN>
Subject: Re: bug#36706: "guix gc --verify" fails with "FOREIGN KEY constraint
 failed"
References: <CAHz1FYjJv-dKKZPmjbrcWNgOUOW-pf0iPmWjwLw49crsQw_y-Q@HIDDEN>
 <874l3kh1kz.fsf@HIDDEN>
 <CAHz1FYgYYMaq1krLMYtLekU5+0muGi0QER7r3AvzwmHB_xuE3A@HIDDEN>
Date: Sun, 21 Jul 2019 16:37:01 -0700
In-Reply-To: <CAHz1FYgYYMaq1krLMYtLekU5+0muGi0QER7r3AvzwmHB_xuE3A@HIDDEN> (Ingo
 Ruhnke's message of "Wed, 17 Jul 2019 23:26:24 +0200")
Message-ID: <87muh7ufhe.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-=";
 micalg=pgp-sha256; protocol="application/pgp-signature"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36706
Cc: 36706 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Ingo Ruhnke <grumbel@HIDDEN> writes:

> On Wed, Jul 17, 2019 at 10:02 PM Ricardo Wurmus <rekado@HIDDEN> wrot=
e:
>
>> This is bad and you cannot recover from it.  The store should *never* be
>> edited manually as it will become inconsistent with the database (which
>> I assume you have not edited).
>>
>
> I recovered it just fine with a quick&dirty:
>
> $ sqlite3 /var/guix/db.sqlite
> delete from Refs where reference in (select id from ValidPaths where path
> glob "*libreof*");
> delete from Refs where referrer in (select id from ValidPaths where path
> glob "*libreof*");
> delete from DerivationOutputs where path glob "*libreof*";
> delete from ValidPaths where path glob "*libreof*";
>
> Which I assume is what `guix gc --verify=3Drepair` was trying to do, but =
it's
> not cleaning up Refs table and thus failing at the FOREIGN KEY constraint.
>
> $ sqlite3 /var/guix/db/db.sqlite
> [...]
> sqlite> .schema
> [...]
> CREATE TABLE Refs (
>     referrer  integer not null,
>     reference integer not null,
>     primary key (referrer, reference),
>     foreign key (referrer) references ValidPaths(id) on delete cascade,
>     foreign key (reference) references ValidPaths(id) on delete restrict
> <-------- this one here
> );

That might work, or it might not.  Since manual manipulation of the
store and the database is not supported, and your Guix installation
might now be in an unknown, invalid state.  At the very least, you
should probably run "guix gc --verify=3Dcontents,repair".  The safest (but
admittedly heavy-handed) thing to do is to reinstall Guix completely.

The guix-daemon is carefully designed to maintain several critical
invariants regarding the state of the store and its database.  If by
manually modifying the store or the database you have accidentally
invalidated one of those invariants (or if you have made a change that
is not detected now but which later on might invalidate one of those
invariants), there is no guarantee you can easily recover.

=2D-=20
Chris

--=-=-=
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAl009x0ACgkQ3UCaFdgi
Rp1FNw//XVzyhnCw8flWgsSgkNRu5tjqPR3sCOdV7oucSpt9pF/lKGGUUEJNOtsr
2bnEBU/tQd+0l1RSSduVH1L9GpyQOAYohwK0zvUo2jlf193XZX3lQ11L41AJm3Wm
N5x4kAL8Fp/NaN/iBpWT2YEAEMORMfZmPGfv72V/nEdoVC+E9KtIPahdkczftBFP
OC+O6/eVTyc3nzl3aUCIiQTppvHu21ricksnLdN1NdgaSu/kKVIPpaiflmBR3ARN
mDmaAo1J0cV81m4M86lfJtrp9saZMaj64/jHPmqBAWf+DORfmYnrUKxcMnF0Quke
+hoS7KUmJQKIN7MF07fbFGkRPKa6EFvAjZ1Q1ae4D9Akzfd8HgWxon+IBqlFlK30
NOUOHkA/5fZ0nls6RI83oCjAcssetCrlQU6fX9zKIzZs92MW0UWH84Ftgi5WF21z
+GK3jOr/HBnNgWLARW/GXcqgyB9zMKilBfwQST1jRyZve+JV9I5Jj+iMHrEvW5Yg
dqm3lb83rDOj0pNFkKvxG7DmqVJb3dyVnNf8aUFPhYjyyxhrQShGI732o5l+po9c
ZN49R6cB53o1ph5B1Vbw6ZSCPY0SochUe38Cl2iHiqCjZ1yhzPE2fNfJVA3jjHQg
6eClT6k8d5IJ3ypqZboFBFOwK6cRhq2D1vBsyTJpmB6eMrcLcaw=
=GeWq
-----END PGP SIGNATURE-----
--=-=-=--




Information forwarded to bug-guix@HIDDEN:
bug#36706; Package guix. Full text available.

Message received at 36706 <at> debbugs.gnu.org:


Received: (at 36706) by debbugs.gnu.org; 17 Jul 2019 21:33:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 17 17:33:23 2019
Received: from localhost ([127.0.0.1]:53111 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hnrYA-0000G3-6L
	for submit <at> debbugs.gnu.org; Wed, 17 Jul 2019 17:33:23 -0400
Received: from mail-lj1-f180.google.com ([209.85.208.180]:35874)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <grumbel@HIDDEN>) id 1hnrRi-0008VZ-1Z
 for 36706 <at> debbugs.gnu.org; Wed, 17 Jul 2019 17:26:42 -0400
Received: by mail-lj1-f180.google.com with SMTP id i21so25138064ljj.3
 for <36706 <at> debbugs.gnu.org>; Wed, 17 Jul 2019 14:26:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
 bh=DMiUFHWQ9lNZSgFw+Nwe6oWB88e/0p6pEtvDWVX3m0g=;
 b=ObPpnb/B4cAy+p6miCq2Ozw87ER1CjSzzknd5Mdf03QzTQVJ2sWg2BeyQ+Gz3KTgjf
 1Yo8hWWoztoyfA1EVjFlFIUDQhsc7e3JCBkSZnwaMlFhEgWCRnw7WtQYNHXe8TmKzXYs
 pXUaUdVZLVy+mTTGTgWPOHPFcqBPQLJ7T5BR/Fk8fU6aDIx7lLuZRCefq662ftw5bru4
 0QlYRl9HNvo1g1P92d1tNlpqw4LCcd+8dEjoGuXjT+9s+BSvWktJFw3Qv8VwU/w1f0YK
 bM2trXmlKQJEAvzoqxliby7QB4cJWRbRWiFtVZKXpxge6wt2djTEl9o3iWkrvWeff01E
 /97g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:references:in-reply-to:from:date
 :message-id:subject:to;
 bh=DMiUFHWQ9lNZSgFw+Nwe6oWB88e/0p6pEtvDWVX3m0g=;
 b=Wff1mjySdRZ8fnxAZ8/XzUS4J10z3oYTdBn1lQpurDgyTgwtRBX0mTlT0JNFGXbdWP
 wXwaCgSqL+KCcEDsX1o3qTjPiP8LPlkIviZ7cyTVj0A7gsGwZMzviKtXeimlYznhpSai
 ny6Ut2MIzTOWz9WH4XDg23y6UN34mUgXyNv+X9ezu05ioLCiFUtNPjrIysg6yGxOGC+w
 OBZ8uJB9WMNRnbKX5Nkfev34+S34TZNVVIsX0cQ2wAoAlZxj8BkY8O7QZo8rEoGOgps+
 lpwoQq193AAovBOy20EyEb+G077dU5qmgsmk4/0hNUOziD+8F1cgwklednyckJvsJDOV
 6Kfg==
X-Gm-Message-State: APjAAAU3/Fll+MR7/AoIrjm+cYEzlIiRA/V1EkLDp+xioTg/WZTts2M3
 5vIpWqp/Q0fbYbRd6W5FAbOsjxEgZsiNncT59IAjPH1mQRQ=
X-Google-Smtp-Source: APXvYqxeO/82vv6vRBQP0K4WTZ8741m9SJJ2Hw/5EVzX2rgQoVXp44rODnSEFpSz2RTZS9nCMEo1ueESiirL7VG7kuE=
X-Received: by 2002:a2e:635d:: with SMTP id x90mr22245513ljb.140.1563398795711; 
 Wed, 17 Jul 2019 14:26:35 -0700 (PDT)
MIME-Version: 1.0
References: <CAHz1FYjJv-dKKZPmjbrcWNgOUOW-pf0iPmWjwLw49crsQw_y-Q@HIDDEN>
 <874l3kh1kz.fsf@HIDDEN>
In-Reply-To: <874l3kh1kz.fsf@HIDDEN>
From: Ingo Ruhnke <grumbel@HIDDEN>
Date: Wed, 17 Jul 2019 23:26:24 +0200
Message-ID: <CAHz1FYgYYMaq1krLMYtLekU5+0muGi0QER7r3AvzwmHB_xuE3A@HIDDEN>
Subject: Re: bug#36706: "guix gc --verify" fails with "FOREIGN KEY constraint
 failed"
To: 36706 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary="000000000000dc5b4f058de72556"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36706
X-Mailman-Approved-At: Wed, 17 Jul 2019 17:33:21 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--000000000000dc5b4f058de72556
Content-Type: text/plain; charset="UTF-8"

On Wed, Jul 17, 2019 at 10:02 PM Ricardo Wurmus <rekado@HIDDEN> wrote:

> This is bad and you cannot recover from it.  The store should *never* be
> edited manually as it will become inconsistent with the database (which
> I assume you have not edited).
>

I recovered it just fine with a quick&dirty:

$ sqlite3 /var/guix/db.sqlite
delete from Refs where reference in (select id from ValidPaths where path
glob "*libreof*");
delete from Refs where referrer in (select id from ValidPaths where path
glob "*libreof*");
delete from DerivationOutputs where path glob "*libreof*";
delete from ValidPaths where path glob "*libreof*";

Which I assume is what `guix gc --verify=repair` was trying to do, but it's
not cleaning up Refs table and thus failing at the FOREIGN KEY constraint.

$ sqlite3 /var/guix/db/db.sqlite
[...]
sqlite> .schema
[...]
CREATE TABLE Refs (
    referrer  integer not null,
    reference integer not null,
    primary key (referrer, reference),
    foreign key (referrer) references ValidPaths(id) on delete cascade,
    foreign key (reference) references ValidPaths(id) on delete restrict
<-------- this one here
);

--000000000000dc5b4f058de72556
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">On Wed, Jul 17, 2019 at 10:02 PM Ricardo =
Wurmus &lt;<a href=3D"mailto:rekado@HIDDEN">rekado@HIDDEN</a>&gt;=
 wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex">This is bad and you cannot recover from it.=C2=A0 The st=
ore should *never* be<br>
edited manually as it will become inconsistent with the database (which<br>
I assume you have not edited).<br></blockquote><div><br></div><div>I recove=
red it just fine with a quick&amp;dirty:</div><div><br></div><div>$ sqlite3=
 /var/guix/db.sqlite<br></div><div>delete from Refs where reference in (sel=
ect id from ValidPaths where path glob &quot;*libreof*&quot;);<br>delete fr=
om Refs where referrer in (select id from ValidPaths where path glob &quot;=
*libreof*&quot;);<br>delete from DerivationOutputs where path glob &quot;*l=
ibreof*&quot;;<br>delete from ValidPaths where path glob &quot;*libreof*&qu=
ot;;<br></div><div><br></div><div>Which I assume is what `guix gc --verify=
=3Drepair` was trying to do, but it&#39;s not cleaning up Refs table and th=
us failing at the FOREIGN KEY constraint.</div><div><br></div><div>$ sqlite=
3 /var/guix/db/db.sqlite<br></div><div>[...]</div><div>sqlite&gt; .schema<b=
r></div><div>[...]</div><div>CREATE TABLE Refs (<br>=C2=A0 =C2=A0 referrer =
=C2=A0integer not null,<br>=C2=A0 =C2=A0 reference integer not null,<br>=C2=
=A0 =C2=A0 primary key (referrer, reference),<br>=C2=A0 =C2=A0 foreign key =
(referrer) references ValidPaths(id) on delete cascade,<br>=C2=A0 =C2=A0 fo=
reign key (reference) references ValidPaths(id) on delete restrict &lt;----=
---- this one here<br>);<br></div><div><br></div></div></div>

--000000000000dc5b4f058de72556--




Information forwarded to bug-guix@HIDDEN:
bug#36706; Package guix. Full text available.

Message received at 36706 <at> debbugs.gnu.org:


Received: (at 36706) by debbugs.gnu.org; 17 Jul 2019 20:02:19 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 17 16:02:19 2019
Received: from localhost ([127.0.0.1]:53071 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hnq83-0006GK-9u
	for submit <at> debbugs.gnu.org; Wed, 17 Jul 2019 16:02:19 -0400
Received: from sender-of-o51.zoho.com ([135.84.80.216]:21294)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <rekado@HIDDEN>) id 1hnq7y-0006G6-6b
 for 36706 <at> debbugs.gnu.org; Wed, 17 Jul 2019 16:02:17 -0400
ARC-Seal: i=1; a=rsa-sha256; t=1563393730; cv=none; d=zoho.com; s=zohoarc; 
 b=npMfkkcZsZzOVZ5iOSUbXdEJ4JR5GjaFX2Pd/WcbG1flmawro1TqPPiZfszzC4qbhqt3KWx6EN68HBzzVzHU+Qr/L3hHXXSnSNavCNKJWkjzPB3BhDMOj4IO8FOEAU28xX6UzywT/MyMVjx/mFi43YMkp3Byvr5zr90uemD1lrM=
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com;
 s=zohoarc; t=1563393730;
 h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results;
 bh=OL7m0IO8ArLl+dsViBg0OFIcNrZHsPvXBdOrq/cjp08=; 
 b=k40yz5DmGtsQUI+uP3vxMpBHgWghsK2DH/JmgSPCxPgolneBTlPOZM0p1zBF2tywJdpGQ5Tw6TUC9AJRCypzu0CWLNI1QwuOS6G9gx9lilZJzqTy6w5fSMwFU2FSZOL2I8pMenpbrXhYfOrlFuNH3HW6Va8g7IMygXdxnwfEdM4=
ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass  header.i=elephly.net;
 spf=pass  smtp.mailfrom=rekado@HIDDEN;
 dmarc=pass header.from=<rekado@HIDDEN> header.from=<rekado@HIDDEN>
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1563393730; 
 s=zoho; d=elephly.net; i=rekado@HIDDEN;
 h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding;
 l=495; bh=OL7m0IO8ArLl+dsViBg0OFIcNrZHsPvXBdOrq/cjp08=;
 b=TOGMt1EUBi+UO3cEB7ro7bOnTBEjei2b2MTO3DSej9aSZ/YpEtqTABb0Ug/4vS9+
 H1gCH3zv5WBIUkW57/kfuSGSmW0gMMFM3mpQ/xc93TPXThwRxnhO5qPobIncxUatbgd
 2kHE52eqmxw98eFfHcFTUdOCogjkD9I11aPY01U4=
Received: from localhost (p54AD4F55.dip0.t-ipconnect.de [84.173.79.85]) by
 mx.zohomail.com with SMTPS id 1563393728174421.7534142944313;
 Wed, 17 Jul 2019 13:02:08 -0700 (PDT)
References: <CAHz1FYjJv-dKKZPmjbrcWNgOUOW-pf0iPmWjwLw49crsQw_y-Q@HIDDEN>
User-agent: mu4e 1.2.0; emacs 26.2
From: Ricardo Wurmus <rekado@HIDDEN>
To: grumbel@HIDDEN
Subject: Re: bug#36706: "guix gc --verify" fails with "FOREIGN KEY constraint
 failed"
In-reply-to: <CAHz1FYjJv-dKKZPmjbrcWNgOUOW-pf0iPmWjwLw49crsQw_y-Q@HIDDEN>
X-URL: https://elephly.net
X-PGP-Key: https://elephly.net/rekado.pubkey
X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
Date: Wed, 17 Jul 2019 22:02:04 +0200
Message-ID: <874l3kh1kz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-ZohoMailClient: External
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 36706
Cc: 36706 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


Ingo Ruhnke <grumbel@HIDDEN> writes:

> I am using guix on Ubuntu 19.04, due to some unrelated BTRFS problems I
> needed to free some space and did a quick:
>
>     $ rm -rv /gnu/store/*libreoff*

This is bad and you cannot recover from it.  The store should *never* be
edited manually as it will become inconsistent with the database (which
I assume you have not edited).

You should use =E2=80=9Cguix gc=E2=80=9D instead to remove unused items fro=
m the store.

--=20
Ricardo





Information forwarded to bug-guix@HIDDEN:
bug#36706; Package guix. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 17 Jul 2019 17:34:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jul 17 13:34:41 2019
Received: from localhost ([127.0.0.1]:52924 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1hnnpA-0001hv-4d
	for submit <at> debbugs.gnu.org; Wed, 17 Jul 2019 13:34:41 -0400
Received: from lists.gnu.org ([209.51.188.17]:60637)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <grumbel@HIDDEN>) id 1hnnTW-0006zp-7G
 for submit <at> debbugs.gnu.org; Wed, 17 Jul 2019 13:12:18 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:35951)
 by lists.gnu.org with esmtp (Exim 4.86_2)
 (envelope-from <grumbel@HIDDEN>) id 1hnnTV-0001zB-94
 for bug-guix@HIDDEN; Wed, 17 Jul 2019 13:12:18 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM,
 HTML_MESSAGE autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <grumbel@HIDDEN>) id 1hnnTU-0008C7-8k
 for bug-guix@HIDDEN; Wed, 17 Jul 2019 13:12:17 -0400
Received: from mail-lj1-x233.google.com ([2a00:1450:4864:20::233]:38039)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <grumbel@HIDDEN>) id 1hnnTU-0008B4-0R
 for bug-guix@HIDDEN; Wed, 17 Jul 2019 13:12:16 -0400
Received: by mail-lj1-x233.google.com with SMTP id r9so24391154ljg.5
 for <bug-guix@HIDDEN>; Wed, 17 Jul 2019 10:12:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=EGzIZwNr7A6jeALyzYTP24CTXTwlcICaRv4kRXpFa1U=;
 b=jw8KAZl13/xv0Iu2NHZMHmC0AY+tY4wcLDiGqDlftj1SfdYmn4qPAWmGR2D86pkiJp
 l6uUHC8FuYnXThjmMIKyLoxSIZE0iSvTGWF9XKXC3vUe53hSYA7Tc2efQtglu/zsmXgG
 3kfqiYs6hYLJHXu2Lh1eEKvbDDImDVw3yKuDg7dgsefSj1HH7NETCtxPP9CB2PPKSJVx
 Rj5hjhYcGPcvddQoz4Aq0FKoHBDwQimh5eOTswPaW5QnteroApo09gT/PlCR6QJ2QzeA
 aMUntm/Z2y93c0YgxA779ciJ67eVWe7DkpoLXSFJTF0bOLqMPSctGml/5LL6YMxSXwU0
 p3gg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=EGzIZwNr7A6jeALyzYTP24CTXTwlcICaRv4kRXpFa1U=;
 b=JsKQ8hFfY+lknAQhpsxpbvLyOpqCrcc3g3iTlcgDjX7ieX2xA+CUuLthAS8Th6rutL
 hVveYBzBNh3lcjDSoJKXWNG4XoILvjIO9kz8eY6OMMdQnnOtUHgRs4lnoh0QgKQ5e7u+
 Vlx15ZECX0YV9/MqrSJW7gEsULi8mjOISks/HCul5Kv6aqNR1xA6Mr7fg+i4ZHpwgZXN
 7eK0ZqTjcwiFCHbIl3/zVLEslPgC2GydI4eki/udJgPjsE5oRq2j6l4Mn6P/+Vuzf0c1
 cdPXQaexSSd/3yFWaJOKsJ13KRKjADjN76CV/hkwDPg7oYNR803HcBGRSDqrm74cdLuD
 cVVw==
X-Gm-Message-State: APjAAAXfQONgQd1VyCmNEXleSOcwiCP8750bGms/4e/EXO4TR1C5uU1O
 2N4ztP83eJNDF/wHbTStOWpGruRVhSfsQagm1qDJvbG0opk=
X-Google-Smtp-Source: APXvYqxuk7lGKOMQNLULi2O6i7f19mzDMXFY9Qq8edhl3d58O2Tce50wZGG4HnxAuPCUEriURnENuRq5wNASNqQY1VA=
X-Received: by 2002:a2e:9701:: with SMTP id r1mr5065801lji.12.1563383533161;
 Wed, 17 Jul 2019 10:12:13 -0700 (PDT)
MIME-Version: 1.0
From: Ingo Ruhnke <grumbel@HIDDEN>
Date: Wed, 17 Jul 2019 19:12:02 +0200
Message-ID: <CAHz1FYjJv-dKKZPmjbrcWNgOUOW-pf0iPmWjwLw49crsQw_y-Q@HIDDEN>
Subject: "guix gc --verify" fails with "FOREIGN KEY constraint failed"
To: bug-guix@HIDDEN
Content-Type: multipart/alternative; boundary="0000000000002451ae058de39851"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2a00:1450:4864:20::233
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 17 Jul 2019 13:34:39 -0400
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--0000000000002451ae058de39851
Content-Type: text/plain; charset="UTF-8"

I am using guix on Ubuntu 19.04, due to some unrelated BTRFS problems I
needed to free some space and did a quick:

    $ rm -rv /gnu/store/*libreoff*

This expectedly confuses guix a little and leads to error messages such as
this which make it impossible to reinstall any packages:

    $ guix install libreoffice
    guix install: warning: Consider running 'guix pull' followed by
    'guix package -u' to get up-to-date packages and security updates.

    guix install: error: opening file
`/gnu/store/kmyp9i01aci0azxwcll41kmn347616q7-libreoffice-orcus.patch.drv':
No such file or directory

However trying to clean up the issue with "guix gc --verify" unexpectedly
fails as well, this time with a failed SQLite constraint, this seems like a
bug:

    $ guix gc --verify
    reading the store...
    checking path existence...
    path
`/gnu/store/96ry03xc73c67xs7aj2pnird7icnk578-libreoffice-6.1.5.2.drv'
disappeared, but it still has valid referrers!
    path
`/gnu/store/a1hnx6vgwlnqf4fshfln9ljnp9d8y9pl-libreoffice-6.1.5.2.drv'
disappeared, removing from database...
    guix gc: error: executing SQLite statement: FOREIGN KEY constraint
failed

    $ guix --version
    guix (GNU Guix) 84d7784afe00dfc23c7feeb7ede6bce73406760b

--0000000000002451ae058de39851
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I am using guix on Ubuntu 19.04, due to some unrelate=
d BTRFS problems I needed to free some space and did a quick:</div><div><br=
></div><div>=C2=A0 =C2=A0 $ rm -rv /gnu/store/*libreoff*<br></div><div><br>=
</div><div>This expectedly confuses guix a little and leads to error messag=
es such as this which make it impossible to reinstall any packages:</div><d=
iv><br></div><div>=C2=A0 =C2=A0 $ guix install libreoffice<br>=C2=A0 =C2=A0=
=C2=A0guix install: warning: Consider running &#39;guix pull&#39; followed =
by<br>=C2=A0 =C2=A0=C2=A0&#39;guix package -u&#39; to get up-to-date packag=
es and security updates.<br>=C2=A0 =C2=A0=C2=A0<br>=C2=A0 =C2=A0=C2=A0guix =
install: error: opening file `/gnu/store/kmyp9i01aci0azxwcll41kmn347616q7-l=
ibreoffice-orcus.patch.drv&#39;: No such file or directory<br></div><div><b=
r></div><div>However trying to clean up the issue with &quot;guix gc --veri=
fy&quot; unexpectedly fails as well, this time with a failed SQLite constra=
int, this seems like a bug:</div><div><br></div>=C2=A0 =C2=A0=C2=A0$ guix g=
c --verify<br>=C2=A0 =C2=A0=C2=A0reading the store...<br>=C2=A0 =C2=A0=C2=
=A0checking path existence...<br>=C2=A0 =C2=A0=C2=A0path `/gnu/store/96ry03=
xc73c67xs7aj2pnird7icnk578-libreoffice-6.1.5.2.drv&#39; disappeared, but it=
 still has valid referrers!<br>=C2=A0 =C2=A0=C2=A0path `/gnu/store/a1hnx6vg=
wlnqf4fshfln9ljnp9d8y9pl-libreoffice-6.1.5.2.drv&#39; disappeared, removing=
 from database...<br>=C2=A0 =C2=A0=C2=A0guix gc: error: executing SQLite st=
atement: FOREIGN KEY constraint failed<div><br></div><div>=C2=A0 =C2=A0 $ g=
uix --version<br>=C2=A0 =C2=A0=C2=A0guix (GNU Guix) 84d7784afe00dfc23c7feeb=
7ede6bce73406760b<br></div></div>

--0000000000002451ae058de39851--




Acknowledgement sent to Ingo Ruhnke <grumbel@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-guix@HIDDEN. Full text available.
Report forwarded to bug-guix@HIDDEN:
bug#36706; Package guix. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

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