Newt installer failure when wifi name is #f

  • Done
  • quality assurance status badge
Details
4 participants
  • Danny Milosavljevic
  • Ludovic Courtès
  • Mathieu Othacehe
  • Pierre Neidhardt
Owner
unassigned
Submitted by
Pierre Neidhardt
Severity
normal
P
P
Pierre Neidhardt wrote on 28 May 2019 10:59
(address . bug-guix@gnu.org)(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87h89fj6p3.fsf@ambrevar.xyz
I've tried the installer today and it failed at the wifi selection,
printing a stack trace which allowed me to investigate. Since I could
not save it (shouldn't we dump it to a file by the way?), I've noted
down the following, roughly:

Toggle snippet (8 lines)
In /gnu/installer/newt/wifi.scm:
204: (run-wifi-page)
(filter ...:145 (service)...
(#<<service> name: "foo" type: "wifi" path: "wifi_d..." ...)
147: (_ #<<service name: #f ...)
(string-null? #f)

Apparently it fails because a wifi service name is #f.

I can think of two fixes (untested). In wifi.scm:

Toggle snippet (8 lines)
@@ -144,6 +144,7 @@ of <service-item> records present in LISTBOX."
(let ((services (connman-services)))
(filter (lambda (service)
(and (string=? (service-type service) "wifi")
+ (service-name service)
(not (string-null? (service-name service)))))
services)))
Or, more directly in connman.scm:

Toggle snippet (12 lines)
@@ -108,7 +108,8 @@
(define-record-type* <service>
service make-service
service?
- (name service-name) ; string
+ (name service-name
+ (default ""))
(type service-type) ; string
(path service-path) ; string
(strength service-strength) ; integer

Thoughts?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlzs+FgACgkQm9z0l6S7
zH8YZggAlngA++B+PkbVOB9aku9vJAQSdI3y5+Fclza5rn13FtbkGITzBKQD+mr0
MGkF6vgTib74Z3Q8Lfy2Aitsr3H+nm1VdlUvPMrNuC88JEmZsE3HPtlbK/uMYqBo
uTD94589+BGEPuGy/hV/AJKnam2+dYhCEcbrK4FVgmHoDyBVbIqVzb/Fd/AawcjW
V8pfYtplMKK5TUxE64jx5SBO5WiZZbl9s1L4Iv4JCnU+yW6u+2Abt2A682tXxKXU
0MclWGlc+UAkYSzVvHJ4WRZ414eMd6DxOohqeP5XeEYnOUmZeI+NiStXfVv60pqq
yBkf6rhspR2P6bFb3wJbhanvTwrNeg==
=02pu
-----END PGP SIGNATURE-----

D
D
Danny Milosavljevic wrote on 28 May 2019 11:15
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
20190528111519.2fa1ec58@scratchpost.org
Hi Pierre,

On Tue, 28 May 2019 10:59:04 +0200
Pierre Neidhardt <mail@ambrevar.xyz> wrote:

Toggle quote (4 lines)
> I've tried the installer today and it failed at the wifi selection,
> printing a stack trace which allowed me to investigate. Since I could
> not save it (shouldn't we dump it to a file by the way?),

I think it's in /tmp/last-installer-error, isn't it?

Toggle quote (15 lines)
> Or, more directly in connman.scm:
>
> --8<---------------cut here---------------start------------->8---
> @@ -108,7 +108,8 @@
> (define-record-type* <service>
> service make-service
> service?
> - (name service-name) ; string
> + (name service-name
> + (default ""))
> (type service-type) ; string
> (path service-path) ; string
> (strength service-strength) ; integer
> --8<---------------cut here---------------end--------------->8---

How would that help? The default is only used if NAME is missing in the
constructor call, right? Or is it also used if NAME is present but #f ?

Toggle quote (2 lines)
> Thoughts?

Have you checked whether you can then still connect to that nameless Wifi?

(since apparently connman.scm passes service-path to connman, it should
be fine. But still good to test it)

I think there are some "security" settings on Wifi routers that allow
you to hide the SSID or something, so I guess that's how this problem
sprung up.
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEds7GsXJ0tGXALbPZ5xo1VCwwuqUFAlzs/CcACgkQ5xo1VCww
uqWhGAgAicpKjEqoP9vS0ujcfPvK9MTYVnT+NNbECfJvl6gpbZ+1HjzZy+vm+hRk
RXVgnDrNL27oPx8ZoVRRbwvO2bts69Z59UdFdH0UiF9zCmE4g2NV6pdnUrc8D0tS
N2dZQrySDtK/MlP/rvObc7jF6htlgRFobjdavmdI4K8i9OkW/eLANDm+L1/aGsVL
fA1mzE4cuu0QNIaZGZX/fc0fDcWEBdsU+q5ewAJfIL9KZPS/Zxe1g+wl1IHz678q
NtSbYYKlH1GnCcyutF9xuMUV0+wkU41OffoFIaJRAKvCoU+kfypg5NXPn4iUlGvM
x7Jg05widgOAcE/i8UgWXgtw/M32HA==
=F8tX
-----END PGP SIGNATURE-----


M
M
Mathieu Othacehe wrote on 28 May 2019 11:17
Re: Newt installer failure when wifi name is #f
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)(address . bug-guix@gnu.org)
87sgsz9bv8.fsf@gmail.com
Hey Pierre,

You can find the backtrace in /tmp/last-installer-error file.

About the bug itself, it has been reported here:

Both patches seems fine to me, but I'd like to understand why the regex
fails. Could you run this command and report the result:

Toggle snippet (3 lines)
for s in $(connmanctl services | cut -c 25- | grep wifi) ; do connmanctl service $s ; done

Thanks,

Mathieu

Toggle quote (30 lines)
> Apparently it fails because a wifi service name is #f.
>
> I can think of two fixes (untested). In wifi.scm:
>
> --8<---------------cut here---------------start------------->8---
> @@ -144,6 +144,7 @@ of <service-item> records present in LISTBOX."
> (let ((services (connman-services)))
> (filter (lambda (service)
> (and (string=? (service-type service) "wifi")
> + (service-name service)
> (not (string-null? (service-name service)))))
> services)))
> --8<---------------cut here---------------end--------------->8---
>
> Or, more directly in connman.scm:
>
> --8<---------------cut here---------------start------------->8---
> @@ -108,7 +108,8 @@
> (define-record-type* <service>
> service make-service
> service?
> - (name service-name) ; string
> + (name service-name
> + (default ""))
> (type service-type) ; string
> (path service-path) ; string
> (strength service-strength) ; integer
> --8<---------------cut here---------------end--------------->8---
>
> Thoughts?
P
P
Pierre Neidhardt wrote on 28 May 2019 11:46
Re: bug#35941: Newt installer failure when wifi name is #f
(name . Danny Milosavljevic)(address . dannym@scratchpost.org)
87ef4ikj2u.fsf@ambrevar.xyz
Danny Milosavljevic <dannym@scratchpost.org> writes:

Toggle quote (16 lines)
>> --8<---------------cut here---------------start------------->8---
>> @@ -108,7 +108,8 @@
>> (define-record-type* <service>
>> service make-service
>> service?
>> - (name service-name) ; string
>> + (name service-name
>> + (default ""))
>> (type service-type) ; string
>> (path service-path) ; string
>> (strength service-strength) ; integer
>> --8<---------------cut here---------------end--------------->8---
>
> How would that help? The default is only used if NAME is missing in the
> constructor call, right? Or is it also used if NAME is present but #f ?

Good point! I haven't tested, that was just a thought, but you are
right, it won't help.

Toggle quote (4 lines)
>> Thoughts?
>
> Have you checked whether you can then still connect to that nameless Wifi?

Yes, I can connect manually, but I'm not connecting to the nameless Wifi
anyways.

To clarify, the installer fails to _list_ the wifi networks. So if one
network happens to not disclose the SSID (which is rather common), I
suspect that the installer will always fail.

Toggle quote (4 lines)
> I think there are some "security" settings on Wifi routers that allow
> you to hide the SSID or something, so I guess that's how this problem
> sprung up.

Absolutely.

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlztA2kACgkQm9z0l6S7
zH+LgQgAlBv+IqqLH/yTtt0ls5HYe1rmS2rzz+ylA2j9Q3oyzazt08N9RIBfeta9
Sst7t/PkH/CcXrXV763X7j4wmAECpYe0F8BtEFxk74zugKXUKR/pXbIUz3Euxkxe
/Q8XVRfrPaK00eI9Fa22VJ9rY/e5EuRtIdU7Ctlj4r7SacyiH+QvBirLG4/Bdumg
4jNRjKXLcimmT9H9fBusKBVCL4fuEYz8ey4HuTgv8AnDUexvCgnlHOMV8S+fbSoP
FfPnvQuQvt6gvWT3rfc0aujFPI39HHc8oJOfUzMY0biteGMnU2NgnlLerBtjco1S
O6Bps36qj6Ezl3uNfUvs/frrsfFpJg==
=0/9H
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 28 May 2019 12:00
Re: Newt installer failure when wifi name is #f
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . bug-guix@gnu.org)
87blzmkiet.fsf@ambrevar.xyz
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (9 lines)
> Hey Pierre,
>
> You can find the backtrace in /tmp/last-installer-error file.
>
> About the bug itself, it has been reported here:
> https://issues.guix.gnu.org/issue/35622
>
> Both patches seems fine to me,

As Danny pointed out, my connman patch might not work.

Toggle quote (7 lines)
> but I'd like to understand why the regex
> fails. Could you run this command and report the result:
>
> --8<---------------cut here---------------start------------->8---
> for s in $(connmanctl services | cut -c 25- | grep wifi) ; do connmanctl service $s ; done
> --8<---------------cut here---------------end--------------->8---

It doesn't know `connmanctl service` :/

Anyways, `connmanctl services | cut -c 25-` makes it clear. This one
line is different:

Toggle snippet (3 lines)
G wifi_d...

In full:

Toggle snippet (5 lines)
# connmanctl services

boitealternative_2.4G wifi_d...

The "cut -c ..." is not what you want because connman does not truncate
the wifi name at column 25.

If all you want is the last string, maybe the following would work
better:

Toggle snippet (3 lines)
for s in $(connmanctl services | awk '{print $NF}'); do ...

Cheers!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlztBsoACgkQm9z0l6S7
zH+ZIggAlcus89s4CiuY3fjcUgRmVZxOi/CmoTOgL86Awj0YqO3bwh5Q31fnR16T
GG6M8g8chlXzfoAdyo0Z4eHKsakuAl8TOlnjlbwWqXbNZFP8GxpVoGw20L1RNsAK
C3AOV3AdNilspegyehHIqV57sAobZOe7r6IOL2qlHlps21ft3ieIavD0Z04X0yKs
B3hBGzeQZPVDQ4t0sqkHTIgQGs0WBgIwVAqA/VJSThc2tM11N7EBf1NdPMKBx3/m
IDMVtQTmCNLXt409lvjk9pYWnWWznhKU4DdsD+aeEnFq6+1sNJEHEvjnEoQJ4clf
lxQbW5hpE8tVcRi16EQLdSOKKMZVgA==
=pPdg
-----END PGP SIGNATURE-----

P
P
Pierre Neidhardt wrote on 28 May 2019 12:02
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)(address . bug-guix@gnu.org)
878suqkic1.fsf@ambrevar.xyz
Mathieu Othacehe <m.othacehe@gmail.com> writes:

Toggle quote (2 lines)
> You can find the backtrace in /tmp/last-installer-error file.

Maybe I missed it, but are we reporting this location to the user from
the Newt interface?

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlztBy4ACgkQm9z0l6S7
zH/yswgAi9cHRcN0/oZAfOFYbpk3Nvv2cZBgQs2W8zoPNXAplpignPV0xS/6nUOR
F9D3UMwOUKytqrlxzQFBl0VEuZvzaTsbzWqwKZG0z7j2AlV5Hm0JNhVoK9baThDR
DyPQ/YaMwnRGJSxdOp0Gz66CxXQ9j+vP5P/t5GPst56BIXLSejg1AfH1DjKsWqz+
P8nJ79m4Zgf6glzTPXwYfWCxtpW33pHpCzicZBfMm80jBvWxZwdTMxoQPxSD55/6
cpDF167YjRwyDHDxVSHy07MEzX28SBdUBPiugyVpWTHZnwQecJLvovjGzNUDDJVA
7F57vDwueI/L8PSz9aiCcHhMWgbEoA==
=PC+P
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 28 May 2019 17:19
Re: bug#35941: Newt installer failure when wifi name is #f
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
8736kywqr2.fsf@gnu.org
Hi Pierre,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

Toggle quote (15 lines)
> I've tried the installer today and it failed at the wifi selection,
> printing a stack trace which allowed me to investigate. Since I could
> not save it (shouldn't we dump it to a file by the way?), I've noted
> down the following, roughly:
>
> In /gnu/installer/newt/wifi.scm:
> 204: (run-wifi-page)
> (filter ...:145 (service)...
> (#<<service> name: "foo" type: "wifi" path: "wifi_d..." ...)
> 147: (_ #<<service name: #f ...)
> (string-null? #f)
>
>
> Apparently it fails because a wifi service name is #f.

I believe this is the same bug as

Could you follow-up on the questions I asked there? That would allow us
to understand exactly why you end up with an empty or #f service name.

Thanks,
Ludo’.
P
P
Pierre Neidhardt wrote on 28 May 2019 19:51
(name . Ludovic Courtès)(address . ludo@gnu.org)
8736kyii1r.fsf@ambrevar.xyz
I tried with `connmanctl services some-hidden-wifi-path`:
the key-value pairs it returns does not include any

Name =

Out of 44 SSIDs around me, only 2 are hidden and they are the only 2 ones
for which connmanctl does not report the "Name = " line.

That should fix the issue!

Cheers!

--
Pierre Neidhardt
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEUPM+LlsMPZAEJKvom9z0l6S7zH8FAlztdSAACgkQm9z0l6S7
zH+oEwf/YFfzw+ncW2JQ/YvCELB7GDPEhi2yOuB6eqA8qGEWp3Nm1PXie0fx/Q46
4gSz+OQ0s1Vav7Vr+d4MHu6iZ7wfkO6sl2d1/rx42bGyR9X2EzbtcByROx8rZDht
P1mwki0nDNjpztYoNenpGq7aM5m6bjkOHI8aacGB3zJUZvcYZkixxAfL3G9yW8uM
+0n9bMZIqjCMGiqAiu6z0v2YJGTEsrf2aMzBU+eH7AT1qEGZSVJ3aiKc5UINketb
kLY+jEbjmfPp50Zc63akqJ33d1Q8/ymMvFBKmkeMMl2Uo/Ni8ot4Dq1+pqNqMRkX
XIdx9Bd1uTWRYYeVi90G2ZS/pgxnlg==
=0lKk
-----END PGP SIGNATURE-----

M
M
Mathieu Othacehe wrote on 29 May 2019 09:50
(name . Pierre Neidhardt)(address . mail@ambrevar.xyz)
877ea9u2bv.fsf@gmail.com
Hey,

Toggle quote (5 lines)
> Out of 44 SSIDs around me, only 2 are hidden and they are the only 2 ones
> for which connmanctl does not report the "Name = " line.
>
> That should fix the issue!

Thanks for the investigation ! I guess the attached patch should fix the
issue then :)

Mathieu
From dd212927d50eeed9b8d16beed1f98228299c8633 Mon Sep 17 00:00:00 2001
From: Mathieu Othacehe <m.othacehe@gmail.com>
Date: Wed, 29 May 2019 09:44:44 +0200
Subject: [PATCH] installer: Fix wifi menu crash with hidden SSIDs.

* gnu/installer/connman.scm (<service>): Mention that name may be false.
* gnu/installer/newt/wifi.scm (wifi-services): Filter out wifi services
without name.

Co-authored by: Pierre Neidhardt <mail@ambrevar.xyz>
---
gnu/installer/connman.scm | 2 +-
gnu/installer/newt/wifi.scm | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)

Toggle diff (27 lines)
diff --git a/gnu/installer/connman.scm b/gnu/installer/connman.scm
index ef8cca3952..7f47b9af77 100644
--- a/gnu/installer/connman.scm
+++ b/gnu/installer/connman.scm
@@ -108,7 +108,7 @@
(define-record-type* <service>
service make-service
service?
- (name service-name) ; string
+ (name service-name) ; string or #f
(type service-type) ; string
(path service-path) ; string
(strength service-strength) ; integer
diff --git a/gnu/installer/newt/wifi.scm b/gnu/installer/newt/wifi.scm
index da2f0b56d0..1cb2ef2df3 100644
--- a/gnu/installer/newt/wifi.scm
+++ b/gnu/installer/newt/wifi.scm
@@ -144,6 +144,7 @@ of <service-item> records present in LISTBOX."
(let ((services (connman-services)))
(filter (lambda (service)
(and (string=? (service-type service) "wifi")
+ (service-name service)
(not (string-null? (service-name service)))))
services)))
--
2.17.1
L
L
Ludovic Courtès wrote on 29 May 2019 11:03
(name . Mathieu Othacehe)(address . m.othacehe@gmail.com)
87d0k1vdi3.fsf@gnu.org
Mathieu Othacehe <m.othacehe@gmail.com> skribis:

Toggle quote (11 lines)
> From dd212927d50eeed9b8d16beed1f98228299c8633 Mon Sep 17 00:00:00 2001
> From: Mathieu Othacehe <m.othacehe@gmail.com>
> Date: Wed, 29 May 2019 09:44:44 +0200
> Subject: [PATCH] installer: Fix wifi menu crash with hidden SSIDs.
>
> * gnu/installer/connman.scm (<service>): Mention that name may be false.
> * gnu/installer/newt/wifi.scm (wifi-services): Filter out wifi services
> without name.
>
> Co-authored by: Pierre Neidhardt <mail@ambrevar.xyz>

LGTM! (Please add a “Fixes …” line to the commit log for future
reference.)

Thank you!

Ludo’.
M
M
Mathieu Othacehe wrote on 29 May 2019 11:46
(name . Ludovic Courtès)(address . ludo@gnu.org)
875zpttwyr.fsf@gmail.com
Toggle quote (3 lines)
> LGTM! (Please add a “Fixes …” line to the commit log for future
> reference.)

Done and pushed.

Mathieu
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 35941
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