unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35941: Newt installer failure when wifi name is #f
@ 2019-05-28  8:59 Pierre Neidhardt
  2019-05-28  9:15 ` Danny Milosavljevic
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2019-05-28  8:59 UTC (permalink / raw)
  To: 35941; +Cc: Mathieu Othacehe

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

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:

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

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?

-- 
Pierre Neidhardt
https://ambrevar.xyz/

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

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  8:59 bug#35941: Newt installer failure when wifi name is #f Pierre Neidhardt
@ 2019-05-28  9:15 ` Danny Milosavljevic
  2019-05-28  9:46   ` Pierre Neidhardt
  2019-05-28  9:17 ` Mathieu Othacehe
  2019-05-28 15:19 ` Ludovic Courtès
  2 siblings, 1 reply; 11+ messages in thread
From: Danny Milosavljevic @ 2019-05-28  9:15 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Mathieu Othacehe, 35941

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

Hi Pierre,

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

> 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?

> 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 ?

> 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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  8:59 bug#35941: Newt installer failure when wifi name is #f Pierre Neidhardt
  2019-05-28  9:15 ` Danny Milosavljevic
@ 2019-05-28  9:17 ` Mathieu Othacehe
  2019-05-28 10:00   ` Pierre Neidhardt
  2019-05-28 10:02   ` Pierre Neidhardt
  2019-05-28 15:19 ` Ludovic Courtès
  2 siblings, 2 replies; 11+ messages in thread
From: Mathieu Othacehe @ 2019-05-28  9:17 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35941


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, 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---

Thanks,

Mathieu

> 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?

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  9:15 ` Danny Milosavljevic
@ 2019-05-28  9:46   ` Pierre Neidhardt
  0 siblings, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2019-05-28  9:46 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: Mathieu Othacehe, 35941

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

Danny Milosavljevic <dannym@scratchpost.org> writes:

>> --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.

>> 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.

> 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
https://ambrevar.xyz/

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

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  9:17 ` Mathieu Othacehe
@ 2019-05-28 10:00   ` Pierre Neidhardt
  2019-05-28 10:02   ` Pierre Neidhardt
  1 sibling, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2019-05-28 10:00 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35941

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

Mathieu Othacehe <m.othacehe@gmail.com> writes:

> 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.

> 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:

--8<---------------cut here---------------start------------->8---
G wifi_d...
--8<---------------cut here---------------end--------------->8---

In full:

--8<---------------cut here---------------start------------->8---
# connmanctl services

boitealternative_2.4G wifi_d...
--8<---------------cut here---------------end--------------->8---

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:

--8<---------------cut here---------------start------------->8---
for s in $(connmanctl services | awk '{print $NF}'); do ...
--8<---------------cut here---------------end--------------->8---

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/

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

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  9:17 ` Mathieu Othacehe
  2019-05-28 10:00   ` Pierre Neidhardt
@ 2019-05-28 10:02   ` Pierre Neidhardt
  1 sibling, 0 replies; 11+ messages in thread
From: Pierre Neidhardt @ 2019-05-28 10:02 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 35941

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

Mathieu Othacehe <m.othacehe@gmail.com> writes:

> 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
https://ambrevar.xyz/

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

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28  8:59 bug#35941: Newt installer failure when wifi name is #f Pierre Neidhardt
  2019-05-28  9:15 ` Danny Milosavljevic
  2019-05-28  9:17 ` Mathieu Othacehe
@ 2019-05-28 15:19 ` Ludovic Courtès
  2019-05-28 17:51   ` Pierre Neidhardt
  2 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-05-28 15:19 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: Mathieu Othacehe, 35941

Hi Pierre,

Pierre Neidhardt <mail@ambrevar.xyz> skribis:

> 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
<https://issues.guix.gnu.org/issue/35620>.

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’.

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28 15:19 ` Ludovic Courtès
@ 2019-05-28 17:51   ` Pierre Neidhardt
  2019-05-29  7:50     ` Mathieu Othacehe
  0 siblings, 1 reply; 11+ messages in thread
From: Pierre Neidhardt @ 2019-05-28 17:51 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Mathieu Othacehe, 35941

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

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
https://ambrevar.xyz/

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

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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-28 17:51   ` Pierre Neidhardt
@ 2019-05-29  7:50     ` Mathieu Othacehe
  2019-05-29  9:03       ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Mathieu Othacehe @ 2019-05-29  7:50 UTC (permalink / raw)
  To: Pierre Neidhardt; +Cc: 35941

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


Hey,

> 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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-installer-Fix-wifi-menu-crash-with-hidden-SSIDs.patch --]
[-- Type: text/x-diff, Size: 1564 bytes --]

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(-)

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


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

* bug#35941: Newt installer failure when wifi name is #f
  2019-05-29  7:50     ` Mathieu Othacehe
@ 2019-05-29  9:03       ` Ludovic Courtès
  2019-05-29  9:46         ` bug#35620: " Mathieu Othacehe
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2019-05-29  9:03 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: Pierre Neidhardt, 35941

Mathieu Othacehe <m.othacehe@gmail.com> skribis:

> 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’.

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

* bug#35620: bug#35941: Newt installer failure when wifi name is #f
  2019-05-29  9:03       ` Ludovic Courtès
@ 2019-05-29  9:46         ` Mathieu Othacehe
  0 siblings, 0 replies; 11+ messages in thread
From: Mathieu Othacehe @ 2019-05-29  9:46 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 35941-done, Pierre Neidhardt, 35620-done


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

Done and pushed.

Mathieu

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

end of thread, other threads:[~2019-05-29  9:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28  8:59 bug#35941: Newt installer failure when wifi name is #f Pierre Neidhardt
2019-05-28  9:15 ` Danny Milosavljevic
2019-05-28  9:46   ` Pierre Neidhardt
2019-05-28  9:17 ` Mathieu Othacehe
2019-05-28 10:00   ` Pierre Neidhardt
2019-05-28 10:02   ` Pierre Neidhardt
2019-05-28 15:19 ` Ludovic Courtès
2019-05-28 17:51   ` Pierre Neidhardt
2019-05-29  7:50     ` Mathieu Othacehe
2019-05-29  9:03       ` Ludovic Courtès
2019-05-29  9:46         ` bug#35620: " Mathieu Othacehe

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).