Discussion:
wrong type of agument... where ?
(too old to reply)
Catonano
2017-12-31 11:39:07 UTC
Permalink
In attempting to test my trytond service wit hthhis line

make check-system TESTS="trytond"

I get this errror

[...]
adding user 'guixbuilder08'...
adding user 'guixbuilder09'...
adding user 'guixbuilder10'...
adding user 'trytond'...
adding user 'postgres'...
registering public key
'/gnu/store/94y24as2zk3n3n39602vlanqb1g5j0c0-guix-0.13.0-12.0a154c1/share/guix/hydra.gnu.org.pub'...
ERROR: In procedure append:
ERROR: In procedure append: Wrong type argument in position 1 (expecting
empty list): "-c en_US.utf8"

Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)>


Where does this -c en_US.utf8 string come from ?
Where is append being called ?

Could I have a slighhtly more verbose error message ?

Thanks
Danny Milosavljevic
2017-12-31 12:23:21 UTC
Permalink
Hi Catonano,

On Sun, 31 Dec 2017 12:39:07 +0100
Post by Catonano
In attempting to test my trytond service wit hthhis line
make check-system TESTS="trytond"
I get this errror
[...]
adding user 'guixbuilder08'...
adding user 'guixbuilder09'...
adding user 'guixbuilder10'...
adding user 'trytond'...
adding user 'postgres'...
registering public key
'/gnu/store/94y24as2zk3n3n39602vlanqb1g5j0c0-guix-0.13.0-12.0a154c1/share/guix/hydra.gnu.org.pub'...
ERROR: In procedure append: Wrong type argument in position 1 (expecting
empty list): "-c en_US.utf8"
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
Where does this -c en_US.utf8 string come from ?
Where is append being called ?
Could I have a slighhtly more verbose error message ?
Write ,bt (including the comma)

I agree, the error message could be better. Let's see where it comes from.

Or is that not an interactive REPL?
Catonano
2017-12-31 13:04:50 UTC
Permalink
Post by Danny Milosavljevic
Hi Catonano,
On Sun, 31 Dec 2017 12:39:07 +0100
Post by Catonano
In attempting to test my trytond service wit hthhis line
make check-system TESTS="trytond"
I get this errror
[...]
adding user 'guixbuilder08'...
adding user 'guixbuilder09'...
adding user 'guixbuilder10'...
adding user 'trytond'...
adding user 'postgres'...
registering public key
'/gnu/store/94y24as2zk3n3n39602vlanqb1g5j0c0-guix-0.13.0-12.0a154c1/
share/guix/hydra.gnu.org.pub'...
Post by Catonano
ERROR: In procedure append: Wrong type argument in position 1 (expecting
empty list): "-c en_US.utf8"
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
Where does this -c en_US.utf8 string come from ?
Where is append being called ?
Could I have a slighhtly more verbose error message ?
Write ,bt (including the comma)
I agree, the error message could be better. Let's see where it comes from.
Or is that not an interactive REPL?
Yes, there iis a REPL but

,bt

doesn't return a prrompt. It remains suspended, like this


[...]
adding user 'guixbuilder08'...
adding user 'guixbuilder09'...
adding user 'guixbuilder10'...
adding user 'trytond'...
adding user 'postgres'...
registering public key
'/gnu/store/94y24as2zk3n3n39602vlanqb1g5j0c0-guix-0.13.0-12.0a154c1/share/guix/hydra.gnu.org.pub'...
ERROR: In procedure append:
ERROR: In procedure append: Wrong type argument in position 1 (expecting
empty list): "-c en_US.utf8"

Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
GNU Guile 2.2.2
Copyright (C) 1995-2017 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> ,bt
Danny Milosavljevic
2017-12-31 14:35:03 UTC
Permalink
Is the tryton test using marionette-operating-system ?

marionette-shepherd-service seems to already try to remote-control the system - but it seems that this case has not been handled?

Check out marionette-shepherd-service in gnu/tests.scm for the general mechanism. Maybe add some (display "XXX") in there in order to find out where it goes off the deep end.
Catonano
2017-12-31 14:48:11 UTC
Permalink
Post by Danny Milosavljevic
Is the tryton test using marionette-operating-system ?
I believe it is

Anyway, here's the definition of the service
https://gitlab.com/humanitiesNerd/guix-hacks/blob/trytonservice/gnu/services/trytond.scm

And here's the test
https://gitlab.com/humanitiesNerd/guix-hacks/blob/trytonservice/gnu/tests/trytond.scm
Post by Danny Milosavljevic
marionette-shepherd-service seems to already try to remote-control the
system - but it seems that this case has not been handled?
Check out marionette-shepherd-service in gnu/tests.scm for the general
mechanism. Maybe add some (display "XXX") in there in order to find out
where it goes off the deep end
I'll take a look
Thanks
Catonano
2017-12-31 23:03:41 UTC
Permalink
I made it

the first trytond test (to check if trytond is running) passed successfully

make check-system TESTS="trytond"

And it's exactly midnight !
Happy New Year !
Post by Catonano
Post by Danny Milosavljevic
Is the tryton test using marionette-operating-system ?
I believe it is
Anyway, here's the definition of the service
https://gitlab.com/humanitiesNerd/guix-hacks/blob/trytonservice/gnu/
services/trytond.scm
And here's the test
https://gitlab.com/humanitiesNerd/guix-hacks/blob/trytonservice/gnu/tests/
trytond.scm
Post by Danny Milosavljevic
marionette-shepherd-service seems to already try to remote-control the
system - but it seems that this case has not been handled?
Check out marionette-shepherd-service in gnu/tests.scm for the general
mechanism. Maybe add some (display "XXX") in there in order to find out
where it goes off the deep end
I'll take a look
Thanks
Danny Milosavljevic
2017-12-31 23:39:18 UTC
Permalink
Try this:

diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..810a0d63f 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,14 @@ to it are lost."
(switch-root "/root")
(format #t "loading '~a'...\n" to-load)

- (primitive-load to-load)
+ (catch #t
+ (lambda ()
+ (primitive-load to-load))
+ (lambda (key . args)
+ (format (current-error-port) "Error: ~a: ~a\n" key args)
+ (reboot))
+ (lambda (key . args)
+ (display-backtrace (make-stack #t) (current-error-port))))

(format (current-error-port)
"boot program '~a' terminated, rebooting~%"
Catonano
2018-01-01 10:54:50 UTC
Permalink
Danny,
Post by Danny Milosavljevic
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..810a0d63f 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,14 @@ to it are lost."
(switch-root "/root")
(format #t "loading '~a'...\n" to-load)
- (primitive-load to-load)
+ (catch #t
+ (lambda ()
+ (primitive-load to-load))
+ (lambda (key . args)
+ (format (current-error-port) "Error: ~a: ~a\n" key args)
+ (reboot))
+ (lambda (key . args)
+ (display-backtrace (make-stack #t)
(current-error-port))))
(format (current-error-port)
"boot program '~a' terminated, rebooting~%"
thank you so much for this !

I don't know if it' s current anymore, though

In fact, I have discovered some errors I made in the code

Now the trytond test succeeds (yay !) and I don't get ushered in a REPL
anymore

There wee seveal problems

First, I hadn't pdated gnulocal.mk with my new files

gnu/services/trytond.scm
gnu/tests/trytond.scm

Also the Gexpression used in my trytond activation was garbled, so the
shepherd serrvice coldn't run

As a consequence, in the test definition this piece of code

(marionette-eval
'(begin
(use-modules (gnu services herd))
(match (start-service 'trytond)
(#f #f)
(('service response-parts ...)
(match (assq-ref response-parts 'running)
((pid) (number? pid))))))
marionette))


didn't succeed. In the match clause, the (#f #f) case ensued (I suppose)

I discovered all this by creating a virtual machine based on my trytond
branch and running it manually

After I fixed all these glitches, the system test run as a charm

So now I'm a bit overwhelmed and I don't know if your suggestion is still
currrent

I can tell you, though, that I feel very reassured by the fact that someone
tried to help me out !

I'll keep your suggestion in mind, should I have any further problems with
the marionette service

Happy New Year !
Ciao
Cato
Danny Milosavljevic
2018-01-01 14:01:24 UTC
Permalink
Hi Catonano,

On Mon, 1 Jan 2018 11:54:50 +0100
Post by Catonano
thank you so much for this !
You're welcome.
Post by Catonano
I don't know if it' s current anymore, though
It's always good to improve the error reporting. I'll try to get it into guix master (bug 29922).
Post by Catonano
Now the trytond test succeeds (yay !) and I don't get ushered in a REPL
anymore
Nice :)

Happy new year!

Cheers,
Danny
Chris Marusich
2018-01-07 01:46:46 UTC
Permalink
Post by Danny Milosavljevic
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..810a0d63f 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,14 @@ to it are lost."
(switch-root "/root")
(format #t "loading '~a'...\n" to-load)
- (primitive-load to-load)
+ (catch #t
+ (lambda ()
+ (primitive-load to-load))
+ (lambda (key . args)
+ (format (current-error-port) "Error: ~a: ~a\n" key args)
+ (reboot))
+ (lambda (key . args)
+ (display-backtrace (make-stack #t) (current-error-port))))
(format (current-error-port)
"boot program '~a' terminated, rebooting~%"
In some other languages (e.g., Java, Python), we get stack traces by
default when an unhandled exception is thrown. Is this not the case in
Guile?
--
Chris
Danny Milosavljevic
2018-01-07 10:46:47 UTC
Permalink
Hi Chris,

On Sat, 06 Jan 2018 17:46:46 -0800
Post by Chris Marusich
Post by Danny Milosavljevic
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm
index 4dd740174..810a0d63f 100644
--- a/gnu/build/linux-boot.scm
+++ b/gnu/build/linux-boot.scm
@@ -507,7 +507,14 @@ to it are lost."
(switch-root "/root")
(format #t "loading '~a'...\n" to-load)
- (primitive-load to-load)
+ (catch #t
+ (lambda ()
+ (primitive-load to-load))
+ (lambda (key . args)
+ (format (current-error-port) "Error: ~a: ~a\n" key args)
+ (reboot))
+ (lambda (key . args)
+ (display-backtrace (make-stack #t) (current-error-port))))
(format (current-error-port)
"boot program '~a' terminated, rebooting~%"
In some other languages (e.g., Java, Python), we get stack traces by
default when an unhandled exception is thrown. Is this not the case in
Guile?
It is the case in Guile, too. But Guile does even more - it automatically drops you into a debugger prompt. Then the tester VM hangs waiting for keyboard input (typing a debugger command) - which we

(1) don't want to provide (we want it to fail the unit test automatically and not only after writing "please fail the unit test already" there) and
(2) can't provide through the Makefile (right now).

Also, we already catch some other exceptions in (guix ui) - and I wanted to pre-empt that.

Also, for some reason, directly modifying (guix ui) (see "call-with-error-handling") to handle our new error doesn't work.

I tried extending (guix ui) to print a message and that message doesn't appear at runtime either for (gnu build linux-boot) - but visual source code inspection says that (gnu build linux-boot) DOES use (guix ui)'s call-with-error-handling. No idea what's up with that. Maybe some not-rebuilding problem.

Every testing round (in this thread, Catonano describes how to test it) takes hours on my computer so if I find a better way it will be by doing a little, from time to time, over weeks. But a quick workaround is the above.

Furthermore, the automatic stack trace printer (which is the same as display-backtrace) does some ellipsizing (to keep the total line length under 78 characters or something) and omits valuable information in the stack trace (cuts strings etc). I don't know what's the idea with omitting half the stuff in information meant only for *programmers* in the first place.

Therefore, I put a better stack trace printer into bug# 29922 - which is otherwise similar in approach to what I did in this thread here.

Also, I think that there's a further bug in Guix in that marionette-operating-system (which is only used for testing) doesn't even exit on guest kernel panic (it just hangs there forever). I've also includes a fix for that in the same patch.

I think it's necessary to improve error handling - errors in error handling drive me up a wall. If some contributor already has to battle his own error, we shouldn't prevent him from finding it by our errors :)
Danny Milosavljevic
2018-01-07 23:22:34 UTC
Permalink
Post by Danny Milosavljevic
Also, for some reason, directly modifying (guix ui) (see "call-with-error-handling") to handle our new error doesn't work.
Aha, it's using a released "guix" package in the test VM. Where can I change that to "guix-devel"?
Danny Milosavljevic
2018-01-08 18:36:46 UTC
Permalink
Post by Danny Milosavljevic
Post by Danny Milosavljevic
Also, for some reason, directly modifying (guix ui) (see "call-with-error-handling") to handle our new error doesn't work.
Aha, it's using a released "guix" package in the test VM. Where can I change that to "guix-devel"?
(services (modify-services (operating-system-user-services %trytond-os)
(guix-service-type config =>
(guix-configuration
(inherit config)
(guix (current-guix)))))))

Loading...