From unknown Mon Aug 18 09:00:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46767: /run/booted-system can be removed by =?UTF-8?Q?=E2=80=98guix?= system =?UTF-8?Q?delete-generations=E2=80=99?= Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 25 Feb 2021 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 46767 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 46767@debbugs.gnu.org X-Debbugs-Original-To: Received: via spool by submit@debbugs.gnu.org id=B.16142436653626 (code B ref -1); Thu, 25 Feb 2021 09:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Feb 2021 09:01:05 +0000 Received: from localhost ([127.0.0.1]:36618 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFCW9-0000wP-Ek for submit@debbugs.gnu.org; Thu, 25 Feb 2021 04:01:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:34826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFCW7-0000wH-Gl for submit@debbugs.gnu.org; Thu, 25 Feb 2021 04:01:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41980) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFCVw-0003uF-VL for bug-guix@gnu.org; Thu, 25 Feb 2021 04:00:59 -0500 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:59754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lFCVl-00064x-Ei for bug-guix@gnu.org; Thu, 25 Feb 2021 04:00:50 -0500 X-IronPort-AV: E=Sophos;i="5.81,205,1610406000"; d="scan'208";a="374051561" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 10:00:35 +0100 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 =?UTF-8?Q?Vent=C3=B4se?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 25 Feb 2021 10:00:34 +0100 Message-ID: <878s7c1pzh.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=192.134.164.104; envelope-from=ludovic.courtes@inria.fr; helo=mail3-relais-sop.national.inria.fr X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) /run/booted-system is not protected from GC. Here=E2=80=99s what I observe= d on a machine with unattended upgrades (which includes automatic removal of old system generations): --8<---------------cut here---------------start------------->8--- ~$ ls -l /run/booted-system=20 lrwxrwxrwx 1 root root 33 Nov 2 16:06 /run/booted-system -> /var/guix/prof= iles/system-68-link ~$ ls -l /var/guix/profiles/system-68-link ls: cannot access '/var/guix/profiles/system-68-link': No such file or dire= ctory ~$ ls -lrt /var/guix/profiles/system-*-link lrwxrwxrwx 1 root root 50 Nov 29 01:34 /var/guix/profiles/system-74-link ->= /gnu/store/ym7bs9pp9lxy0s1pjfrbic0pjjr7svzd-system lrwxrwxrwx 1 root root 50 Dec 6 01:33 /var/guix/profiles/system-75-link ->= /gnu/store/ivxak4d58gqz2xqihkc636nhwhpa1fs4-system lrwxrwxrwx 1 root root 50 Dec 13 01:35 /var/guix/profiles/system-76-link ->= /gnu/store/wqpwlqlfsc4yqm0nypzvan1a8sb9xmcc-system lrwxrwxrwx 1 root root 50 Dec 27 01:33 /var/guix/profiles/system-77-link ->= /gnu/store/y539xw934mbdcqidg6zaxrzq9hy8hm9p-system lrwxrwxrwx 1 root root 50 Jan 4 09:29 /var/guix/profiles/system-78-link ->= /gnu/store/3582jh1v9vn51wasyl1y189ng4vhqiy9-system lrwxrwxrwx 1 root root 50 Jan 10 01:33 /var/guix/profiles/system-79-link ->= /gnu/store/q67avpz4bfhq2zyfhh8ka6q9hpqzc3xj-system lrwxrwxrwx 1 root root 50 Jan 17 01:33 /var/guix/profiles/system-80-link ->= /gnu/store/13bwrvjgsl16sigwpa93yr4r51qnm8zi-system lrwxrwxrwx 1 root root 50 Jan 19 14:23 /var/guix/profiles/system-81-link ->= /gnu/store/v151wf6lj4ivgj3xwysi9fdmva55jzqp-system lrwxrwxrwx 1 root root 50 Jan 24 01:35 /var/guix/profiles/system-82-link ->= /gnu/store/rvarwdsymd94am8bc8b1rx2xdrxcvx6l-system lrwxrwxrwx 1 root root 50 Jan 31 01:33 /var/guix/profiles/system-83-link ->= /gnu/store/0sgd2yb702483zi3hl04wv4r4rn3ibcy-system lrwxrwxrwx 1 root root 50 Feb 7 01:32 /var/guix/profiles/system-84-link ->= /gnu/store/bix4yp9zs2h3vy8zi9ap9mazap727hng-system lrwxrwxrwx 1 root root 50 Feb 14 01:33 /var/guix/profiles/system-85-link ->= /gnu/store/702l59w3gbsc45c7nffsyv89vnaky5zc-system lrwxrwxrwx 1 root root 50 Feb 21 01:34 /var/guix/profiles/system-86-link ->= /gnu/store/qq4rz2fprvnsgqhj24v735hhmp189jl8-system --8<---------------cut here---------------end--------------->8--- This is bad but mostly harmless since all the packages actually in use are GC-protected anyway, via =E2=80=98guix gc --list-busy=E2=80=99. It breaks things like =E2=80=98guix deploy=E2=80=99 though. Specifically, = its remote initrd module check in (gnu machine ssh) looks for /run/booted-system/kernel/lib/modules/KERNEL-VERSION/modules.alias, via =E2=80=98missing-modules=E2=80=99 of (gnu build linux-modules). That code = throws because =E2=80=98modules.alias=E2=80=99 is supposed to exist, which in turn= leads =E2=80=98guix deploy=E2=80=99 to crash badly: --8<---------------cut here---------------start------------->8--- $ guix time-machine -C channels.scm -- deploy deploy.scm The following 1 machine will be deployed: guix-hpc guix deploy: deploying to guix-hpc... substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0% La jenaj derivoj estos konstruataj: /gnu/store/nh0n44vb4i445msj6g6i0kwyp3jgs39c-remote-exp.scm.drv /gnu/store/44271p6fvygx0fa7dvjhmqz7jwnnr9sc-remote-assertion.scm.drv /gnu/store/5nqzxyal9lhhga7bz9qf6hvml5v862xw-remote-assertion.scm.drv 0.0 MB will be downloaded downloading from https://ci.guix.gnu.org/nar/lzip/1q9118pw4d18ihj91csfilbg6= x2x29am-module-import-compiled ... module-import-compiled 8KiB = 1.7MiB/s 00:00 [##################] 100.0% building /gnu/store/44271p6fvygx0fa7dvjhmqz7jwnnr9sc-remote-assertion.scm.d= rv... building /gnu/store/5nqzxyal9lhhga7bz9qf6hvml5v862xw-remote-assertion.scm.d= rv... building /gnu/store/nh0n44vb4i445msj6g6i0kwyp3jgs39c-remote-exp.scm.drv... guix deploy: sending 8 store items (5 MiB) to 'localhost'... FORMAT: error with call: (format #f "missing modules for ~a:~{ ~a~}<=3D=3D= =3D~%" # =3D=3D=3D>#f ) expected a list argument FORMAT: INTERNAL ERROR IN FORMAT-ERROR! destination: #f format string: "missing modules for ~a:~{ ~a~}~%" format args: (# #f) error args: (#f "error in format" () #f) Backtrace: In guix/store.scm: 1305:8 19 (call-with-build-handler # _) In guix/scripts/deploy.scm: 170:14 18 (_) In guix/store.scm: 1346:2 17 (map/accumulate-builds #= _ _) In srfi/srfi-1.scm: 586:17 16 (map1 (#< things: (("/gnu/store/b5nnbpgkvgdpzgvj67= 539ylcaqacj90l-guile-3.0.2.drv" . "out"=E2=80=A6>)) In guix/store.scm: 1305:8 15 (call-with-build-handler # _) In ice-9/boot-9.scm: 1736:10 14 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In guix/scripts/deploy.scm: 144:6 13 (_) In guix/store.scm: 2066:24 12 (run-with-store # _ #:gu= ile-for-build _ #:system _ #:target _) In gnu/machine/ssh.scm: 445:2 11 (_ _) 338:4 10 (_ _) In srfi/srfi-1.scm: 650:11 9 (for-each # _ _) In gnu/machine/ssh.scm: 275:26 8 (_ #f) In ice-9/format.scm: 1546:2 7 (format #f "missing modules for ~a:~{ ~a~}~%" # #f) 571:24 6 (format:format-work "missing modules for ~a:~{ ~a~}~%" (# #f)) In ice-9/boot-9.scm: 1736:10 5 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _) In ice-9/format.scm: 102:10 4 (_) In ice-9/boot-9.scm: 1669:16 3 (raise-exception _ #:continuable? _) 1669:16 2 (raise-exception _ #:continuable? _) 1669:16 1 (raise-exception _ #:continuable? _) 1669:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1669:16: In procedure raise-exception: error in format --8<---------------cut here---------------end--------------->8--- Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 25 04:59:54 2021 Received: (at control) by debbugs.gnu.org; 25 Feb 2021 09:59:54 +0000 Received: from localhost ([127.0.0.1]:36718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFDR4-0002LG-02 for submit@debbugs.gnu.org; Thu, 25 Feb 2021 04:59:54 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:56123) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFDR2-0002L3-Mu for control@debbugs.gnu.org; Thu, 25 Feb 2021 04:59:53 -0500 X-IronPort-AV: E=Sophos;i="5.81,205,1610406000"; d="scan'208";a="494833627" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 10:59:45 +0100 Date: Thu, 25 Feb 2021 10:59:43 +0100 Message-Id: <871rd41n8w.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #46767 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) severity 46767 important quit From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 25 05:00:16 2021 Received: (at control) by debbugs.gnu.org; 25 Feb 2021 10:00:16 +0000 Received: from localhost ([127.0.0.1]:36722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFDRQ-0002dJ-9W for submit@debbugs.gnu.org; Thu, 25 Feb 2021 05:00:16 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:56161) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFDRO-0002U4-7D for control@debbugs.gnu.org; Thu, 25 Feb 2021 05:00:14 -0500 X-IronPort-AV: E=Sophos;i="5.81,205,1610406000"; d="scan'208";a="494833724" Received: from 91-160-117-201.subs.proxad.net (HELO ribbon) ([91.160.117.201]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2021 11:00:05 +0100 Date: Thu, 25 Feb 2021 11:00:05 +0100 Message-Id: <87zgzszcuy.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #46767 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) retitle 46767 /run/booted-system is not protected from GC quit From unknown Mon Aug 18 09:00:43 2025 X-Loop: help-debbugs@gnu.org Subject: bug#46767: /run/booted-system can be removed by =?UTF-8?Q?=E2=80=98guix?= system =?UTF-8?Q?delete-generations=E2=80=99?= Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 25 Feb 2021 10:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46767 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 46767@debbugs.gnu.org Received: via spool by 46767-submit@debbugs.gnu.org id=B46767.161424986729534 (code B ref 46767); Thu, 25 Feb 2021 10:45:01 +0000 Received: (at 46767) by debbugs.gnu.org; 25 Feb 2021 10:44:27 +0000 Received: from localhost ([127.0.0.1]:36767 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFE8A-0007gH-LQ for submit@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60164) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFE89-0007g6-40 for 46767@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:25 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52940) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFE83-0000Vn-U6 for 46767@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:19 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43132 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lFE83-0005Qg-Cj for 46767@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:19 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <878s7c1pzh.fsf@inria.fr> Date: Thu, 25 Feb 2021 11:44:18 +0100 In-Reply-To: <878s7c1pzh.fsf@inria.fr> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Thu, 25 Feb 2021 10:00:34 +0100") Message-ID: <87r1l4zat9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Before rebooting, I had: --8<---------------cut here---------------start------------->8--- $ ls -l /run/{current,booted}-system=20 lrwxrwxrwx 1 root root 33 Nov 2 16:06 /run/booted-system -> /var/guix/prof= iles/system-68-link lrwxrwxrwx 1 root root 50 Feb 21 01:34 /run/current-system -> /gnu/store/qq= 4rz2fprvnsgqhj24v735hhmp189jl8-system --8<---------------cut here---------------end--------------->8--- After rebooting: --8<---------------cut here---------------start------------->8--- $ ls -l /run/{current,booted}-system=20 lrwxrwxrwx 1 root root 33 Feb 25 10:28 /run/booted-system -> /var/guix/prof= iles/system-86-link lrwxrwxrwx 1 root root 33 Feb 25 10:28 /run/current-system -> /var/guix/pro= files/system-86-link --8<---------------cut here---------------end--------------->8--- /run/booted-system is symlinked from /run/current-system in =E2=80=98shepherd-boot-gexp=E2=80=99: --8<---------------cut here---------------start------------->8--- (define (shepherd-boot-gexp config) "Return a gexp starting the shepherd service." (let ((shepherd (shepherd-configuration-shepherd config)) (services (shepherd-configuration-services config))) #~(begin ;; Keep track of the booted system. (false-if-exception (delete-file "/run/booted-system")) (symlink (readlink "/run/current-system") "/run/booted-system") =E2=80=A6))) --8<---------------cut here---------------end--------------->8--- So the solution is to make sure /run/current-system always points to the store item rather than to the /var/guix symlink in the first place. /run/current-system is created from (gnu build activation). When reconfiguring or deploying, the symlink points to $GUIX_NEW_SYSTEM, which is set to the store item in (guix scripts system reconfigure). But when booting, /run/current-system is symlinked to the =E2=80=98--system= =E2=80=99 kernel command-line argument, which is /var/guix/=E2=80=A6. To address tha= t, we need to throw a =E2=80=98canonicalize-path=E2=80=99 call. Done in 412e4f081e9cdf38db9859e1548ef2362cde678e. Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 25 05:44:40 2021 Received: (at control) by debbugs.gnu.org; 25 Feb 2021 10:44:40 +0000 Received: from localhost ([127.0.0.1]:36770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFE8N-0007gl-Ud for submit@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:40 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60306) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lFE8M-0007gX-8h for control@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:38 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:52942) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lFE8H-0000cH-2F for control@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:33 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43134 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lFE8C-0005dL-55 for control@debbugs.gnu.org; Thu, 25 Feb 2021 05:44:29 -0500 Date: Thu, 25 Feb 2021 11:44:27 +0100 Message-Id: <87pn0ozat0.fsf@gnu.org> To: control@debbugs.gnu.org From: =?utf-8?Q?Ludovic_Court=C3=A8s?= Subject: control message for bug #46767 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) tags 46767 fixed close 46767 quit