From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uDccCNwQGWcYEQAA62LTzQ:P1 (envelope-from ) for ; Wed, 23 Oct 2024 15:06:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id uDccCNwQGWcYEQAA62LTzQ (envelope-from ) for ; Wed, 23 Oct 2024 17:06:04 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=KXty0lli; dkim=fail ("headers rsa verify failed") header.d=fabionatali.com header.s=gm1 header.b=QCjFCPeg; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1729695964; a=rsa-sha256; cv=none; b=sZddBe59GK8HfaSY1EbTQF4uinvunCmuwSnlVglNZUIFxIlVJNI8PSAoVVcD+a0aclDSV8 /9b9RtbDLj/D5nqaius2H7KbKcGDAY7pCJhAGyS1BebZB+qodzXMLBX2tWlTYBm8BYJ1uE E7iZLqIZgJpnLfvuZ+A+uea2UblqQtLyg8NGWaKDMvGOOjqFtLj99wcVBIcURp5ZI7DYDE 7i4jkcez2yd2aheBL/dRevopnQ8Al/Pfg1JWYHF6X2g4GZX3YX38LEL9//wD1w1+KF0In7 kWbib2SjAOus4FgmZQt5BCSj2+SG6OG3ESNUYyTbDK4sPvJNpWkoXsasKiaTfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=KXty0lli; dkim=fail ("headers rsa verify failed") header.d=fabionatali.com header.s=gm1 header.b=QCjFCPeg; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1729695964; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=3Q1UrFttklwYsi8WXG5mGbvHhej6leN2qSWPgFKW4XU=; b=VbMNvgnL58gc3UKW5aabZA6ixeofH5kq9tyMrkPybHoC8trtr6bFJBj68DBrfLcBDF49Fg grGk3PyI78ZrTujPrHkXnVB7a0IHyqSHn07+Jrt5MDx23UJJHdJo/cxbJ4WPVevczKh6JS IS7jlI9hTf2Tad18xHAzYX7NjB4I4I4dYAoU9ngxgx+tqvjJFmGQRhzdvDOMkf6+34pJrA +BItb5FRCHUgWtUWckMuhr/JDdiOfJiNZlp7cAZcewwso2Yr1+7pllZFDpSWBoNgJSahC9 sLoxgTYsBaSlX5Kb3UEwXqV6eVAaB/pI6wExXCU0zucdEZrwA9ETzQosrw7bNA== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 95CB31D1AF for ; Wed, 23 Oct 2024 17:06:03 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t3cvZ-0005O4-V4; Wed, 23 Oct 2024 11:05:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3cvY-0005No-Aj for bug-guix@gnu.org; Wed, 23 Oct 2024 11:05:36 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t3cvW-0002Ge-G2 for bug-guix@gnu.org; Wed, 23 Oct 2024 11:05:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=3Q1UrFttklwYsi8WXG5mGbvHhej6leN2qSWPgFKW4XU=; b=KXty0lliMS0OTPvbGLOfy0pq24YH/3LEF2vpMH6CFrerFqoPL+qZXWUCoyf3qnbr0ibNsnjUOj23Y0EZV4wHzz5zJhZgoFcxTybhGi+35FifcyUbLM9EI0qUcnbKMxkcYd9NKkSN/eEopcI4MJC/hHZckWVMuUxPpdg9uk71eW7jefgORQt73fyCoYnd2+O5afuzNoMRAMNLEnHijbs8/NV9wpR73AnbDD7kGl55mDXHCK1Z/YEN1qPS0g1ryFGjL6528YLJSBexS+RoZ+I0Z0RdC5U2OBMrs3oRYEy7iYbcol4Poh9CM/HuidPl9vAuQV9b36+6l9WDgGmS5zVIbQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1t3cvy-0000DK-Ok for bug-guix@gnu.org; Wed, 23 Oct 2024 11:06:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#73966: 'guix deploy' fails when adding 'elogind-service-type' Resent-From: Fabio Natali Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Wed, 23 Oct 2024 15:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73966 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 73966@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1729695911404 (code B ref -1); Wed, 23 Oct 2024 15:06:02 +0000 Received: (at submit) by debbugs.gnu.org; 23 Oct 2024 15:05:11 +0000 Received: from localhost ([127.0.0.1]:60397 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3cv9-00006S-AS for submit@debbugs.gnu.org; Wed, 23 Oct 2024 11:05:11 -0400 Received: from lists.gnu.org ([209.51.188.17]:44044) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1t3cv7-00006K-Mj for submit@debbugs.gnu.org; Wed, 23 Oct 2024 11:05:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3cud-0005G3-V9 for bug-guix@gnu.org; Wed, 23 Oct 2024 11:04:39 -0400 Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t3cuZ-00020t-Az for bug-guix@gnu.org; Wed, 23 Oct 2024 11:04:39 -0400 Received: by mail.gandi.net (Postfix) with ESMTPSA id 71CEF24000C for ; Wed, 23 Oct 2024 15:04:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1729695870; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=3Q1UrFttklwYsi8WXG5mGbvHhej6leN2qSWPgFKW4XU=; b=QCjFCPeg8v3GAt4dmrWL/tsl3hiO3R1Vwci5ZW6v4vUhdD8p89Nm8RFF0p+8W0dvnbqSND faU2lbc5hW3qCuBUBsrQweGxZAh2TbyT/0fSCLNIRsiZZPEEmsVNEoD1QcxzeG+zszflVT GwqVT/mKcVDpDO1xYzLhxgtuv9ebjDE0SyZ9wNILk9G379QceqkbADPXayuS1bjex1i/3y 2MbFbF2A3FptZXchSTeTEuvBSFcJBNdPxeyYYFdxngUHlQ7+/a6YeqYbl6G34ZRWwEylK/ 5V91GZvwYaaZqJRYzhX7DKpkU69cRLrOW7QQua2KT3DzDMMD1O5dzwJIM1gXhA== Date: Wed, 23 Oct 2024 16:04:28 +0100 Message-ID: <87ed46dfnn.fsf@fabionatali.com> MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: me@fabionatali.com Received-SPF: pass client-ip=2001:4b98:dc4:8::221; envelope-from=me@fabionatali.com; helo=relay1-d.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Fabio Natali From: Fabio Natali via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 0.51 X-Spam-Score: 0.51 X-Migadu-Queue-Id: 95CB31D1AF X-Migadu-Scanner: mx12.migadu.com X-TUID: B4R32RHlZvOA Dear All, This is to briefly report an issue that I encountered yesterday, while reconfiguring one of my servers. The machine is headless and has a minimalist system without desktop-related software. Yesterday I had to install the elogind service, so I add a one-liner to my configuration file and redeploy with 'guix deploy' - which fails badly. 'guix deploy' terminates with this error: --8<---------------cut here---------------start------------->8--- guix deploy: error: failed to deploy host: remote command '/run/setuid-programs/sudo -n -- /gnu/store/xv4cd7qz4yan93zkjisbmbpxfz78hah2-guile-3.0.9/bin/guile --no-auto-compile -L /gnu/store/gai5i4ba2xf084big8h56q6pc0vwx2sj-module-import -C / gnu/store/gai5i4ba2xf084big8h56q6pc0vwx2sj-module-import -c "(begin (use-modules (guix repl)) (send-repl-response (quote (with-output-to-port (current-error-por t) (lambda () (primitive-load \"/gnu/store/gkh9yvyfdlnzpi9j9h8w4df0qz3jim2x-remo te-exp.scm\")))) (current-output-port)) (force-output))"' failed with status 1 --8<---------------cut here---------------end--------------->8--- The system is left in a non-working state. Attempts at opening new terminal sessions fail, with the user being logged out immediately, both when connecting via SSH and when logging in from a TTY. Already established terminal sessions start throwing errors like this: --8<---------------cut here---------------start------------->8--- user@host ~$ sudo su - sudo: pam_open_session: Error in service module sudo: policy plugin failed session initialization Segmentation fault --8<---------------cut here---------------end--------------->8--- I have to use Magic SysRq to reboot and get back to a working system. I initially blamed this to some quirk of this particular machine, but then I was able to reproduce this in a VM. Here are the steps. Start from a system definition 'server.scm', along the lines of: --8<---------------cut here---------------start------------->8--- (use-modules (gnu) (gnu machine) (gnu machine ssh) (gnu services desktop) (gnu services networking) (gnu services ssh)) (define %user-authorized-key (plain-file "user-authorized-key.pub" "ssh-rsa SSH-PUBLIC-KEY")) (define %guix-authorized-key (plain-file "guix-authorized-key.pub" "(public-key (ecc (curve Ed25519) (q GUIX-AUTHORIZED-KEY)))")) (define test-server-operating-system (operating-system (host-name "host") (bootloader (bootloader-configuration (bootloader grub-bootloader) (targets '("/dev/vda")))) (file-systems (cons (file-system (device "/dev/vda1") (mount-point "/") (type "ext4")) %base-file-systems)) (users (list (user-account (name "user") (group "users") (supplementary-groups '("wheel"))))) (sudoers-file (plain-file "sudoers" (string-append (plain-file-content %sudoers-specification) "%wheel ALL = NOPASSWD: ALL"))) (services (cons* (service dhcp-client-service-type) (service openssh-service-type (openssh-configuration (authorized-keys `(("user" ,%user-authorized-key) ("root" ,%user-authorized-key))) (permit-root-login 'prohibit-password))) ;; Enable the elogind service and redeploy to trigger the issue. ;; (service elogind-service-type) (modify-services %base-services (guix-service-type config => (guix-configuration (authorized-keys (cons %guix-authorized-key %default-authorized-guix-keys))))))))) (define test-server-machine (machine-ssh-configuration (host-key "ssh-ed25519 MACHINE-PUBLIC-KEY") (host-name "localhost") (port 2222) (identity "/home/user/.ssh/id_rsa_guix_image") (system "x86_64-linux") (user "user"))) (list (machine (operating-system test-server-operating-system) (environment managed-host-environment-type) (configuration test-server-machine))) test-server-operating-system --8<---------------cut here---------------end--------------->8--- Create an image 'image.qcow2' based on the above definition: --8<---------------cut here---------------start------------->8--- cp `guix system image \ --image-size=20GB \ --image-type=qcow2 \ server.scm` image.qcow2 chmod u+w image.qcow2 --8<---------------cut here---------------end--------------->8--- The image can be run with this incantation or a variation thereof: --8<---------------cut here---------------start------------->8--- guix shell qemu -- qemu-system-x86_64 \ -nic user,model=virtio-net-pci,hostfwd=tcp::2222-:22 \ -enable-kvm -m 4096 -smp 2 \ -device virtio-blk,drive=myhd \ -drive if=none,file=/tmp/image.qcow2,id=myhd --8<---------------cut here---------------end--------------->8--- Everything should look fine so far. Log in as a user, take note of the SSH public key in '/etc/ssh/ssh_host_ed25519_key.pub' which needs to be used as the 'host-key' in the 'machine-ssh-configuration' in 'server.scm'. Now uncomment the line with 'elogind' service and comment out the last line 'test-server-operating-system', so that the system definition can be fed to 'guix deploy'. Run 'guix deploy server.scm', while the QEMU machine is still running. BOOM. This should have triggered the error: the deploy fails and the VM is no longer responsive. Note that this is only triggered if the system definition includes a non-root user. Also note that the reconfiguration succeeds when run from within the machine, i.e. via 'guix system reconfigure ...' (from within the guest) as opposed to 'guix deploy' (from the host). I just wanted to brain-dump this here. It's not blocking for me at the moment but I guess it's good to have it reported. Any idea is welcome. I'll also try and get back to this when time permits. Thanks, cheers, Fabio. -- Fabio Natali https://fabionatali.com