guix home reconfigure throw error after Shepherd updata

  • Done
  • quality assurance status badge
Details
3 participants
  • Aleksandr Vityazev
  • Ludovic Courtès
  • Nicolas Graves
Owner
unassigned
Submitted by
Aleksandr Vityazev
Severity
important
Merged with
A
A
Aleksandr Vityazev wrote on 8 Apr 2022 01:27
(name . bug-guix)(address . bug-guix@gnu.org)
87h774cw4c.fsf@posteo.org
Hi,

guix home reconfigure config.scm [1], throw error and freezes even
ctrl-c doesn't help

Uncaught exception in task:
In fibers.scm
150:0 9 (_)
In ice-9/boot-9.scm
1747:15 8 (with-exception-handler #<procedure 7c9c7efe1c60> at ic..>
...)
In shepherd.scm
439:9 7 (_)
In ice-9/boot-9.scm
1747:15 8 (with-exception-handler #<procedure 7f9c7efe1ba0> at ic..>
...)
In ice-9/exceptions.scm:
406:15 5 (_)
In ice-9/boot-9.scm:
1752:10 4 (with-exception-handler _ _ #:unwind? _ # _)
In shepherd.scm
502:23 3 (_)
In srfi/srfi-1.scm:
586:17 2 (map1 (#<<service> 7f9c80e0df30>))
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1683:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1683:16 In procedure raise-exception:
Zero values returned to single-valued continuation


[1]
(define-module (config) #:use-module (gnu home) #:use-module (gnu home services) #:use-module (gnu home services fontutils) #:use-module (gnu home services xdg) #:use-module (gnu home services shells) #:use-module (gnu home services shepherd) #:use-module (gnu home services symlink-manager) #:use-module (gnu services) #:use-module (gnu packages) #:use-module (gnu packages glib) #:use-module (gnu packages admin) #:use-module (gnu packages linux) #:use-module (guix gexp) #:use-module (guix packages)) (define (home-dbus-environment-variables-service _) '(("DBUS_SESSION_BUS_ADDRESS" . "unix:path=$XDG_RUNTIME_DIR/dbus.sock"))) (define (home-dbus-shepherd-service _) (list (shepherd-service (provision '(dbus-home)) (stop #~(make-kill-destructor)) (start #~(make-forkexec-constructor (list #$(file-append dbus "/bin/dbus-daemon") "--nofork" "--session" (string-append "--address=" "unix:path=" (getenv "XDG_RUNTIME_DIR") "/dbus.sock")) #:environment-variables (append '("DISPLAY=wayland-0" "WAYLAND_DISPLAY=wayland-0") (environ))))))) (define-public home-dbus-service-type (service-type (name 'home-dbus) (extensions (list (service-extension home-environment-variables-service-type home-dbus-environment-variables-service) (service-extension home-profile-service-type (const (list dbus))) (service-extension home-shepherd-service-type home-dbus-shepherd-service))) (default-value #f) (description "run dbus"))) (define home-env (home-environment (services (list (service home-dbus-service-type) (service home-zsh-service-type (home-zsh-configuration (xdg-flavor? #t) (zshrc (list (plain-file "zshrc" "stty -ixon"))))) (simple-service 'set-guix-env-vars home-environment-variables-service-type `(("GUIX_PROFILE" . "/home/akagi/.guix-profile"))))))) home-env
--
Best regards,
Aleksandr Vityazev
N
N
Nicolas Graves wrote on 14 Apr 2022 09:16
same problem here
(address . 54779@debbugs.gnu.org)
87y208m8ld.fsf@ngraves.fr
Hi !

I do have the same problem here, and have found a temporary fix to allow
finishing the reconfiguration.

If you `herd stop root` before reconfiguring home, the `guix home
reconfigure` should finish, with an error, but allowing the
reconfiguration.

Just in case it might be helpful for developers :
The error happends in the `activate profile` phase, when herd and
shepherd are involved.

The reconfiguration actually works when there is no service-type related
to a herd service in the configuration (here it was the case with dbus I
think).

Good luck,

Nicolas
A
A
Aleksandr Vityazev wrote on 20 Apr 2022 03:37
Re: bug#54779: guix home reconfigure throw error after Shepherd updata
(address . 54779@debbugs.gnu.org)
87pmlc8rhj.fsf@posteo.org
Hi,

it seems that the attached patch should fix this.

--
Best regards,
Aleksandr Vityazev
Toggle diff (14 lines)
diff --git a/gnu/home/services/shepherd.scm b/gnu/home/services/shepherd.scm
index df6bbb30e6..cbb7b17987 100644
--- a/gnu/home/services/shepherd.scm
+++ b/gnu/home/services/shepherd.scm
@@ -84,6 +84,8 @@ (define config
services))))
(if (defined? 'start-in-the-background)
(start-in-the-background services-to-start)
- (for-each start services-to-start)))))
+ (for-each start services-to-start))
+ (redirect-port (open-input-file "/dev/null")
+ (current-input-port)))))

(scheme-file "shepherd.conf" config)))
L
L
Ludovic Courtès wrote on 20 Apr 2022 22:02
control message for bug #54779
(address . control@debbugs.gnu.org)
87bkwvo755.fsf@gnu.org
severity 54779 important
quit
L
L
Ludovic Courtès wrote on 20 Apr 2022 23:52
(address . control@debbugs.gnu.org)
87czhbmngp.fsf@gnu.org
merge 54779 54919
quit
L
L
Ludovic Courtès wrote on 20 Apr 2022 23:53
(address . control@debbugs.gnu.org)
87a6cfmng4.fsf@gnu.org
merge 54779 54919
quit
L
L
Ludovic Courtès wrote on 21 Apr 2022 00:11
Re: bug#54779: guix home reconfigure throw error after Shepherd updata
(name . Aleksandr Vityazev)(address . avityazev@posteo.org)
874k2nmmmf.fsf@gnu.org
Hi,

Aleksandr Vityazev <avityazev@posteo.org> skribis:

Toggle quote (3 lines)
> guix home reconfigure config.scm [1], throw error and freezes even
> ctrl-c doesn't help

Indeed, this can be reproduced like so:

Toggle snippet (26 lines)
$ herd load root /gnu/store/1xx98q22c6ijr0p5pjbq3wnxd5yyxlmy-shepherd.conf
WARNING: Use of `load' in declarative module (#{ g139}#). Add #:declarative? #f to your define-module invocation.
Uncaught exception in task:
In fibers.scm:
150:8 9 (_)
In ice-9/boot-9.scm:
1747:15 8 (with-exception-handler #<procedure 7f52c6b31390 at ic…> …)
In shepherd.scm:
432:9 7 (_)
In ice-9/boot-9.scm:
1747:15 6 (with-exception-handler #<procedure 7f52c6b312d0 at ic…> …)
In ice-9/exceptions.scm:
406:15 5 (_)
In ice-9/boot-9.scm:
1752:10 4 (with-exception-handler _ _ #:unwind? _ # _)
In shepherd.scm:
502:23 3 (_)
In srfi/srfi-1.scm:
586:17 2 (map1 (#<<service> 7f52c8f77f30>))
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1683:16 0 (raise-exception _ #:continuable? _)
ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Zero values returned to single-valued continuation

(‘guix home reconfigure’ invokes the same command as above.)

The problem is that ‘start-in-the-background’ returns zero values, as
indicated above, but shepherd expects user commands to return one value.

So the fix, as you suggest, is to return one value at the end of
shepherd.conf.

You suggested redirecting stdin, which is also a good idea, but for a
different reason. :-) Anyway I’ve done both.

dd2ab92d9d home: shepherd: Redirect input port to /dev/null.
bc867b2ab0 home: shepherd: "shepherd.conf" returns one value.

Thank you!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 54779@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 54779
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch