Extending postgresql-role-service-type as shown in manual leads to crash

  • Open
  • quality assurance status badge
Details
2 participants
  • Josselin Poiret
  • Maxim Cournoyer
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 27 Jan 03:14 +0100
(name . bug-guix)(address . bug-guix@gnu.org)
87a5or1q0g.fsf@gmail.com
Hi,

We have this example in the manual, in (info "(guix) Database
Services"):

Toggle snippet (6 lines)
(service-extension postgresql-role-service-type
(const (postgresql-role
(name "alice")
(create-database? #t))))

Unfortunately, it doesn't seem to work as intended. Adding the
following to my configuration:

Toggle snippet (13 lines)
(service postgresql-service-type)
(service postgresql-role-service-type
(postgresql-role-configuration
(roles
(list (postgresql-role
(name "maxim")
(create-database? #t))))))
(service-extension postgresql-role-service-type
(const (postgresql-role
(name "cuirass")
(create-database? #t))))

I get the following error upon reconfiguration:

Toggle snippet (37 lines)
Backtrace:
18 (primitive-load "/home/maxim/.config/guix/current/bin/g…")
In guix/ui.scm:
2324:7 17 (run-guix . _)
2287:10 16 (run-guix-command _ . _)
In ice-9/boot-9.scm:
1752:10 15 (with-exception-handler _ _ #:unwind? _ # _)
In guix/status.scm:
859:3 14 (_)
839:4 13 (call-with-status-report _ _)
In guix/scripts/system.scm:
1305:4 12 (_)
In ice-9/boot-9.scm:
1752:10 11 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
661:37 10 (thunk)
1300:8 9 (call-with-build-handler #<procedure 7f446c6d5c90 at g…> …)
2180:25 8 (run-with-store #<store-connection 256.99 7f44768a8a00> …)
In guix/scripts/system.scm:
847:2 7 (_ _)
721:8 6 (_ #<store-connection 256.99 7f44768a8a00>)
In gnu/system.scm:
1295:19 5 (operating-system-derivation _)
In gnu/services.scm:
1166:6 4 (instantiate-missing-services _)
In srfi/srfi-1.scm:
460:18 3 (fold #<procedure 7f446a968960 at gnu/services.scm:116…> …)
In gnu/services.scm:
1167:27 2 (_ #<<service-extension> target: #<service-type postgr…> …)
In ice-9/boot-9.scm:
1685:16 1 (raise-exception _ #:continuable? _)
1685:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure service-kind: Wrong type argument: #<<service-extension> target: #<service-type postgresql-role 7f4471875640> compute: #<procedure 7f446afc63a0 at ice-9/boot-9.scm:809:2 _>>

--
Thanks,
Maxim
J
J
Josselin Poiret wrote on 30 Jan 23:18 +0100
87plxizcrl.fsf@jpoiret.xyz
Hi Maxim,

I guess this is not explained that well, but the service-extension
snippet is supposed to go under the (extensions ...) field of a
<service-type> record. If you want to extend this in your system
config, you want (simple-service ...) instead, with e.g.

Toggle snippet (6 lines)
(simple-service 'alice-role postgresql-role-service-type
(postgresql-role
(name "alice")
(create-database? #t)))

Best,
--
Josselin Poiret
-----BEGIN PGP SIGNATURE-----

iQHEBAEBCAAuFiEEOSSM2EHGPMM23K8vUF5AuRYXGooFAmW5dZ4QHGRldkBqcG9p
cmV0Lnh5egAKCRBQXkC5FhcaikyLC/0cSblNRGRy3Pu+S92FQXjYWIQo4/hJ/2jY
4CWkyL9/07KjC3ZbSe84QoDzL39ONadTFq/8FTWySAQmmxhodUSH1Lvj2lT/Nelo
z1P9fZBe4+NdlguIVbH51Qc5illsbCf7IrX5pbShsQUw2XIpplh98xbk1x0U/7cd
I5mnukBDvFCtfV8J1wte2B11biMHWYAE0nf8Lq+M+hLIBKpMZf0z2iDSwHKpxs7p
hbLALTIUo/aSp5gOEaDLTk8nuj5uHDP/FKWvl1Yy6y60UFVxFYAe/36o9RMA5ZY7
nD1FwyAMRqH3RFjEWDVuaOC9p8cXH3iYQUFsoNQnZiISmo9lX35LEEQlhXkSASqh
2cYMzMw5se+rONdD7O1Udyzktw7bNcsfsBLe3YarArXQWsSXsU31WD4gzkJwTt2a
U07YQxJuGbX3k86+widQLO91Y87TdiH0l6eKoMIIKPLu0mqPA0IoZGSwg44Is22X
xrodPm+uGB1k+s0AO3dTTkJZ9uBHzrI=
=oYmy
-----END PGP SIGNATURE-----

?