unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#68747: Extending postgresql-role-service-type as shown in manual leads to crash
@ 2024-01-27  2:14 Maxim Cournoyer
  2024-01-30 22:18 ` Josselin Poiret via Bug reports for GNU Guix
  0 siblings, 1 reply; 2+ messages in thread
From: Maxim Cournoyer @ 2024-01-27  2:14 UTC (permalink / raw)
  To: 68747

Hi,

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

--8<---------------cut here---------------start------------->8---
          (service-extension postgresql-role-service-type
                             (const (postgresql-role
                                     (name "alice")
                                     (create-database? #t))))
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
      (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))))
--8<---------------cut here---------------end--------------->8---

I get the following error upon reconfiguration:

--8<---------------cut here---------------start------------->8---
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 _>>
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#68747: Extending postgresql-role-service-type as shown in manual leads to crash
  2024-01-27  2:14 bug#68747: Extending postgresql-role-service-type as shown in manual leads to crash Maxim Cournoyer
@ 2024-01-30 22:18 ` Josselin Poiret via Bug reports for GNU Guix
  0 siblings, 0 replies; 2+ messages in thread
From: Josselin Poiret via Bug reports for GNU Guix @ 2024-01-30 22:18 UTC (permalink / raw)
  To: Maxim Cournoyer, 68747

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]

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.

--8<---------------cut here---------------start------------->8---
(simple-service 'alice-role postgresql-role-service-type
                (postgresql-role
                 (name "alice")
                 (create-database? #t)))
--8<---------------cut here---------------end--------------->8---

Best,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-01-30 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-27  2:14 bug#68747: Extending postgresql-role-service-type as shown in manual leads to crash Maxim Cournoyer
2024-01-30 22:18 ` Josselin Poiret via Bug reports for GNU Guix

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).