Bug 3025

Summary: Bad fix for Hob network tests
Product: [Build System, Metadata & Runtime] Hob Reporter: Dave Stewart <david.c.stewart>
Component: hobAssignee: Bogdan Marinescu <bogdan.a.marinescu>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: High CC: alexandru.damian, belen.barros.pena, cristian.iorga, poky.bs.watcher, poky.watcher, sgw, valentin.popa
Version: 1.2.1   
Target Milestone: 1.3 M5   
Hardware: x86   
OS: Multiple   
Whiteboard: Merged (7d95141c5abecbd19fa1f3dccabfbe46aad01192)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
bug 3025 - incorrect network configuration.pdf
none
bug 3025 - error message v3 none

Description Dave Stewart 2012-08-28 14:22:01 UTC
There was an earlier bug against Hob asking that we make the error message clearer. Unfortunately the fix isn't quite right.

What I see now is that when I start Hob for the first time on a system with Proxy not set properly, there is an incredibly long hang, and then I get a clear message which reads like this:

Failed to fetch test data from network. Please ensure your network is configured correctly.

Message could be better (maybe it should hint that you might need to configure a proxy in Settings). But it's the very long hang before the message which is bad. If you are using the Build Appliance, this could be your very first experience with the Yocto Project since there is no way to set the proxy before Hob starts up the first time.

You can fix a number of ways:

* Put up a "testing network connection" message if it takes longer than a second to fetch the test data.

* Don't test network connection when you first start up Hob, but test it in the build progress, just improve the message there. (after all, what if you are doing a no network build?)

Must fix.
Comment 1 Dave Stewart 2012-08-28 17:50:08 UTC
Dumb question... you guys will also fix it in Master too, right?
Comment 2 Jessica 2012-09-04 18:13:04 UTC
The fix needs to go in for both 1.2.2 and master
Comment 3 Saul Wold 2012-09-05 15:45:03 UTC
Dave's comments have a couple of good suggestions

Adding a button to the proxy setting page that runs that sanity test would be valuable, since they can determine right then that it's correct or not

Another option may be to add a dialog box with a cancel button when the tests run saying something like testing the next work, please cancel and use setting -> proxies if behind a firewall

These are ideas, might what to touch base with Belen and user interaction

An option I am considering from the build applaince standpoint is to flat out set the BB_NO_NETWORK which will disable all network access for the build.
Comment 4 Bogdan Marinescu 2012-09-06 14:42:13 UTC
(In reply to comment #3)
> Dave's comments have a couple of good suggestions
> 
> Adding a button to the proxy setting page that runs that sanity test would
> be valuable, since they can determine right then that it's correct or not
> 
> Another option may be to add a dialog box with a cancel button when the
> tests run saying something like testing the next work, please cancel and use
> setting -> proxies if behind a firewall

This would probably be the best solution, but unfortunately it won't work. We did a few straces for programs that were unable to connect to the network because of a bad proxy setting and we found out that the "connect" call simply blocks. And it blocks good, probably somewhere inside the kernel, since the program can't even be stopped by pressing CTRL+C. So the "cancel" button won't be able to do anything useful.
Another idea: check the proxy only once, when it changes value (right after it changes the value in the "settings" dialog). What do you say about this?

> 
> These are ideas, might what to touch base with Belen and user interaction
> 
> An option I am considering from the build applaince standpoint is to flat
> out set the BB_NO_NETWORK which will disable all network access for the
> build.
Comment 5 Dave Stewart 2012-09-06 15:36:37 UTC
Sorry for the dumb question... why can't you spawn a thread to do the connect? (Or is this some Python wrapper for the connect syscall?) That way you are not blocked.
Comment 6 Bogdan Marinescu 2012-09-07 07:09:15 UTC
(In reply to comment #5)
> Sorry for the dumb question... why can't you spawn a thread to do the
> connect? (Or is this some Python wrapper for the connect syscall?) That way
> you are not blocked.

Not a dumb question at all. As I explained in my previous message, our tests showed the lack of a properly configured proxy server seems to block (as in "stuck") the 'connect' call somewhere inside the kernel (at least in the particular case of the Intel network). Thus I don't expect a thread to help here, since it will also be stuck somewhere inside the kernel in the 'connect' call and the scheduler won't be able to put it in a 'blocked' state and switch to another thread. Nevertheless, I'm going to try this anyway.
Comment 7 Belen Barros Pena 2012-09-10 17:18:46 UTC
Created attachment 781 [details]
bug 3025 - incorrect network configuration.pdf

Hi there,

This bug seems to be related to 2338, where we suggested how to handle the initial sanity checks. I've very quickly put something together for the proxy settings case (see attached bug 3025 - incorrect network configuration.pdf).

Let me know what you think.

Belen
Comment 8 Dave Stewart 2012-09-11 14:19:38 UTC
Yes, this looks good to me, let me ask one question Belen: So once you click Save in the Proxy Settings dialog, Hob immediately begins the sanity check again, yes? That works I think. I was hoping there would be an immediate feedback loop like this to see if the settings are correct, and I think this does it.

The other possibility of course is perhaps I truly have a broken network connection, like maybe the wireless is turned off on my laptop or my network cable is unplugged. In this case, Proxy settings won't fix things, but you can always fix your network problem and click Cancel on Proxy settings and be OK.  The most likely cause of network problems is definitely proxy issues.

OK, so long answer... your solution looks good to me. :-)
Comment 9 Belen Barros Pena 2012-09-13 14:13:40 UTC
Hi Dave,

You got it completely right. However, when I proposed the solution, I hadn't seen bug 3026, which asks for a 'test' button in the proxies tab. That button is somehow at odds with the idea of running the checks when you click 'Save'. The fact that we are separating "test" from "save" immediately suggests that "save" will not run the network tests: they will happen only when I choose to do so by clicking the 'Test' button.

So I think we need to choose between the following two alternatives:

1. We add the 'test' button to the proxies tab, and we don't run network tests when user clicks 'save' 

2. We don't add the 'test' button to the proxies tab, and we run network tests whenever a user clicks 'save' after changing their proxy configuration

I somehow prefer option 1: gives more control to the user and it's probably easier to implement. Whichever we go for, I also think we should use a separate progress window to show the progress in the network test, instead of displaying the progress in the Hob primary window.

If you and Bogdan are happy with option 1, I'll make the changes to the design document. 

Thanks!

Belen



(In reply to comment #8)
> Yes, this looks good to me, let me ask one question Belen: So once you click
> Save in the Proxy Settings dialog, Hob immediately begins the sanity check
> again, yes? That works I think. I was hoping there would be an immediate
> feedback loop like this to see if the settings are correct, and I think this
> does it.
> 
> The other possibility of course is perhaps I truly have a broken network
> connection, like maybe the wireless is turned off on my laptop or my network
> cable is unplugged. In this case, Proxy settings won't fix things, but you
> can always fix your network problem and click Cancel on Proxy settings and
> be OK.  The most likely cause of network problems is definitely proxy issues.
> 
> OK, so long answer... your solution looks good to me. :-)
Comment 10 Bogdan Marinescu 2012-09-13 14:22:19 UTC
Hi Belen,

(In reply to comment #9)
> Hi Dave,
> 
> You got it completely right. However, when I proposed the solution, I hadn't
> seen bug 3026, which asks for a 'test' button in the proxies tab. That
> button is somehow at odds with the idea of running the checks when you click
> 'Save'. The fact that we are separating "test" from "save" immediately
> suggests that "save" will not run the network tests: they will happen only
> when I choose to do so by clicking the 'Test' button.
> 
> So I think we need to choose between the following two alternatives:
> 
> 1. We add the 'test' button to the proxies tab, and we don't run network
> tests when user clicks 'save' 
> 
> 2. We don't add the 'test' button to the proxies tab, and we run network
> tests whenever a user clicks 'save' after changing their proxy configuration
> 
> I somehow prefer option 1: gives more control to the user and it's probably
> easier to implement. Whichever we go for, I also think we should use a
> separate progress window to show the progress in the network test, instead
> of displaying the progress in the Hob primary window.
> 
> If you and Bogdan are happy with option 1, I'll make the changes to the
> design document. 

I am OK with option 1.

Thanks,
Bogdan

> 
> Thanks!
> 
> Belen
> 
> 
> 
> (In reply to comment #8)
> > Yes, this looks good to me, let me ask one question Belen: So once you click
> > Save in the Proxy Settings dialog, Hob immediately begins the sanity check
> > again, yes? That works I think. I was hoping there would be an immediate
> > feedback loop like this to see if the settings are correct, and I think this
> > does it.
> > 
> > The other possibility of course is perhaps I truly have a broken network
> > connection, like maybe the wireless is turned off on my laptop or my network
> > cable is unplugged. In this case, Proxy settings won't fix things, but you
> > can always fix your network problem and click Cancel on Proxy settings and
> > be OK.  The most likely cause of network problems is definitely proxy issues.
> > 
> > OK, so long answer... your solution looks good to me. :-)
Comment 11 Saul Wold 2012-09-13 14:55:13 UTC
This will require back port to 1.2.2 when fixed.
Comment 12 Dave Stewart 2012-09-13 15:19:30 UTC
I prefer option 1 too. :-)

Dave
Comment 13 Belen Barros Pena 2012-09-19 13:42:32 UTC
Hi Bogdan,

I thought option 1 might be difficult. We'll make do with a more general error message. What about:

"Hob cannot connect to the network

Please check your network connection. If you are using a proxy server, please make sure it is configured correctly."

I've attached a screenshot (bug 3025 - error message v3.pdf).

I'll ask Scott to review the content. 

Belen

From: <Marinescu>, Bogdan A <bogdan.a.marinescu@intel.com>
Date: Wednesday, 19 September 2012 11:58
To: "Belen Barros Pena (Intel)" <belen.barros.pena@intel.com>
Cc: "Stewart, David C" <david.c.stewart@intel.com>, "Purdie, Richard" <richard.purdie@intel.com>
Subject: Re: Please help with bug #3025

Hi Belen,

On Wed, Sep 19, 2012 at 12:15 PM, Barros Pena, Belen <belen.barros.pena@intel.com> wrote:

Hi Bodgan,

I just checked the fix, I think it is really good! :) I have a couple of comments that came to mind after seeing the interaction:

  1.  I tested your patch by disabling my network connection, which brought up the error message suggesting I should check my proxy settings. I think sometimes the network checks might fail because of lack of connectivity. I am just wondering how difficult would it be to detect those cases and display a different message.

I think that would be pretty difficult at this point. We'd probably need to add code to check proxy connectivity explicitly and I'm not sure how easy it is to integrate something like this into bitbake. A quicker "fix" would be to change the error text, to include the possibility of both a proxy misconfiguration and an actual network problem.

 
  2.  The heading of the error message just says "Error". Could we change it to "Hob cannot connect to the network"? It is more informative and provides a high-level explanation of the problem, which is what the error heading is supposed to do. "Error" is just a bit too generic

Sure, this is easy.
 
  3.  I know I wrote the error text myself, but it might be a bit too categoric: it suggests that we are 100% sure the source of the problem is the proxy settings configuration (which I don't think we are). What about something like: "If you are using a proxy server, please check it is configured correctly".

This is exactly what I had in mind when I replied to 1 above. Yes, we should do this.
 
The message should then display two buttons: "Open proxy settings" on the right and to its left we should have a "Close" button to dismiss the alert window (I've attached an image).

Again, yes. I was going to suggest that myself, but apparently I forgot :) 
 

Paul just mentioned that some some of the network checks are going away. It might not affect the fix for this bug, but you might want to catch up with Richard Purdie about it just in case.

I was not aware of this. I saw a thread about this on bitbake-devel recently, but I didn't follow it. Richard, could you please elaborate on this a bit?
Comment 14 Belen Barros Pena 2012-09-19 13:43:13 UTC
Created attachment 819 [details]
bug 3025 - error message v3
Comment 15 Bogdan Marinescu 2012-09-20 09:09:33 UTC
Implementation under review, will upload patch when I get the final OK.
Comment 16 Bogdan Marinescu 2012-09-25 10:30:40 UTC
Patch uploaded.
Comment 17 Bogdan Marinescu 2012-10-01 08:32:50 UTC
Merged to master.
Comment 18 Belen Barros Pena 2012-10-15 08:51:09 UTC
verified