Unhandled FTP exception when using GNU importer

  • Done
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxim Cournoyer
  • zimoun
Owner
unassigned
Submitted by
Maxim Cournoyer
Severity
normal
M
M
Maxim Cournoyer wrote on 10 Aug 2020 20:33
(name . bug-guix)(address . bug-guix@gnu.org)
87eeoeic59.fsf@gmail.com
Here I naively tried importing libsocketcan, which isn't a GNU project:

Toggle snippet (29 lines)
guix import gnu libsocketcan
Backtrace:
10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
In guix/ui.scm:
2046:12 9 (run-guix-command _ . _)
In guix/scripts/import.scm:
116:11 8 (guix-import . _)
In ice-9/boot-9.scm:
1736:10 7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
1731:15 6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
In guix/import/gnu.scm:
111:2 5 (gnu->guix-package "libsocketcan" #:key-download _)
In guix/gnu-maintenance.scm:
364:20 4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
In guix/ftp-client.scm:
233:6 3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
In srfi/srfi-1.scm:
460:18 2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
In guix/ftp-client.scm:
74:8 1 (_ _ _)
In ice-9/boot-9.scm:
1669:16 0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
libsocketcan" 550 "Failed to change directory.\r")'.


The error should be handled and a more appropriate message should be
displayed to the user.

Maxim
L
L
Ludovic Courtès wrote on 2 Feb 2021 13:58
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)(address . 42802-done@debbugs.gnu.org)
87wnvqeid5.fsf@gnu.org
Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

Toggle quote (32 lines)
> Here I naively tried importing libsocketcan, which isn't a GNU project:
>
> guix import gnu libsocketcan
> Backtrace:
> 10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
> In guix/ui.scm:
> 2046:12 9 (run-guix-command _ . _)
> In guix/scripts/import.scm:
> 116:11 8 (guix-import . _)
> In ice-9/boot-9.scm:
> 1736:10 7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
> 1731:15 6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
> In guix/import/gnu.scm:
> 111:2 5 (gnu->guix-package "libsocketcan" #:key-download _)
> In guix/gnu-maintenance.scm:
> 364:20 4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
> In guix/ftp-client.scm:
> 233:6 3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
> In srfi/srfi-1.scm:
> 460:18 2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
> In guix/ftp-client.scm:
> 74:8 1 (_ _ _)
> In ice-9/boot-9.scm:
> 1669:16 0 (raise-exception _ #:continuable? _)
>
> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
> Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
> libsocketcan" 550 "Failed to change directory.\r")'.
>
> The error should be handled and a more appropriate message should be
> displayed to the user.

I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.

Ludo’.
Closed
Z
Z
zimoun wrote on 2 Feb 2021 15:09
(address . 42802-done@debbugs.gnu.org)
CAJ3okZ0p+QUzHV8h_Lt_mJYk_xpNW28FcF0OxdNxQ5GLpXLEGQ@mail.gmail.com
Hi,

On Tue, 2 Feb 2021 at 13:59, Ludovic Courtès <ludo@gnu.org> wrote:

Toggle quote (5 lines)
> > The error should be handled and a more appropriate message should be
> > displayed to the user.
>
> I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.

Ah sorry, I missed this bug and so report it in the commit message.

Cheers,
simon
M
M
Maxim Cournoyer wrote on 2 Feb 2021 15:12
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 42802-done@debbugs.gnu.org)
874kiur225.fsf@gmail.com
Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (40 lines)
> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Here I naively tried importing libsocketcan, which isn't a GNU project:
>>
>> guix import gnu libsocketcan
>> Backtrace:
>> 10 (primitive-load "/home/maxim/.config/guix/current/bin/guix")
>> In guix/ui.scm:
>> 2046:12 9 (run-guix-command _ . _)
>> In guix/scripts/import.scm:
>> 116:11 8 (guix-import . _)
>> In ice-9/boot-9.scm:
>> 1736:10 7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
>> 1731:15 6 (with-exception-handler #<procedure 7f19d6ef7270 at ice-9/boot-9.scm:1815:7 (exn)> _ #:unwind? _ #:unwind-for-type _)
>> In guix/import/gnu.scm:
>> 111:2 5 (gnu->guix-package "libsocketcan" #:key-download _)
>> In guix/gnu-maintenance.scm:
>> 364:20 4 (latest-ftp-release "libsocketcan" #:server _ #:directory _ #:keep-file? _ #:file->signature _ #:ftp-open _ #:ftp-close _)
>> In guix/ftp-client.scm:
>> 233:6 3 (ftp-list #<<ftp-connection> socket: #<input-output: socket 16> addrinfo: #(32 2 1 6 #(2 3509828628 21) #f)> _ #:timeout _)
>> In srfi/srfi-1.scm:
>> 460:18 2 (fold #<procedure 7f19d6ef71b0 at guix/ftp-client.scm:187:10 (dir result)> _ _)
>> In guix/ftp-client.scm:
>> 74:8 1 (_ _ _)
>> In ice-9/boot-9.scm:
>> 1669:16 0 (raise-exception _ #:continuable? _)
>>
>> ice-9/boot-9.scm:1669:16: In procedure raise-exception:
>> Throw to key `ftp-error' with args `(#<input-output: socket 16> "CWD
>> libsocketcan" 550 "Failed to change directory.\r")'.
>>
>> The error should be handled and a more appropriate message should be
>> displayed to the user.
>
> I believe this is fixed by be84fc600e76e3962123b94bf14baea4a2e4f442.
>
> Ludo’.

./pre-inst-env guix import gnu libsocketcan
guix import: error: failed to determine latest release of GNU libsocketcan

Thanks for the fix; that's much nicer than a backtrace. It would be
even better if it said:

'guix import: error: No GNU package found for "libsocketcan"'

Thanks!

Maxim
Closed
Z
Z
zimoun wrote on 2 Feb 2021 15:31
(name . Maxim Cournoyer)(address . maxim.cournoyer@gmail.com)
CAJ3okZ3wKDBp5uO=K1nv3B2NJ4HaF6hTjGFgU+884EamgM0_kA@mail.gmail.com
Hi Maxim

On Tue, 2 Feb 2021 at 15:13, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

Toggle quote (8 lines)
> ./pre-inst-env guix import gnu libsocketcan
> guix import: error: failed to determine latest release of GNU libsocketcan
>
> Thanks for the fix; that's much nicer than a backtrace. It would be
> even better if it said:
>
> 'guix import: error: No GNU package found for "libsocketcan"'

Yeah, replace the message sounds good. The one you are proposing
works for both cases: "guix import gnu hello@1.2.3" and "guix import
gnu not-gnu-package". Even if version is not supported, another
story.
Attached the trivial patch in case.


Cheers,
simon
From 16030b867b9f0e70f3811026ed451d2bba1299d2 Mon Sep 17 00:00:00 2001
From: zimoun <zimon.toutoune@gmail.com>
Date: Tue, 2 Feb 2021 15:30:22 +0100
Subject: [PATCH] import: gnu: Fix error message.

* guix/import/gnu.scm (gnu->guix-package): Fix error message.
---
guix/import/gnu.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/import/gnu.scm b/guix/import/gnu.scm
index c26faff04b..2fa63cb184 100644
--- a/guix/import/gnu.scm
+++ b/guix/import/gnu.scm
@@ -123,7 +123,7 @@ details.)"
(gnu-package->sexp info release #:key-download key-download)))))
(_
(raise (formatted-message
- (G_ "failed to determine latest release of GNU ~a")
+ (G_ "no GNU package found for ~a")
name)))))
;;; gnu.scm ends here
--
2.28.0
Closed
M
M
Maxim Cournoyer wrote on 2 Feb 2021 19:50
(name . zimoun)(address . zimon.toutoune@gmail.com)
87czxipamr.fsf@gmail.com
Hi Simon,

zimoun <zimon.toutoune@gmail.com> writes:

Toggle quote (19 lines)
> Hi Maxim
>
> On Tue, 2 Feb 2021 at 15:13, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> ./pre-inst-env guix import gnu libsocketcan
>> guix import: error: failed to determine latest release of GNU libsocketcan
>>
>> Thanks for the fix; that's much nicer than a backtrace. It would be
>> even better if it said:
>>
>> 'guix import: error: No GNU package found for "libsocketcan"'


> Yeah, replace the message sounds good. The one you are proposing
> works for both cases: "guix import gnu hello@1.2.3" and "guix import
> gnu not-gnu-package". Even if version is not supported, another
> story.
> Attached the trivial patch in case.

There was more to it than just the message; some code was already in
place to address this case but was not exercised.

See commit 889f425b35, which fixes it.

Thanks!

Maxim
Closed
?