Bug 5700

Summary: Hob fails to start if there is an error when parsing a layer
Product: [Build System, Metadata & Runtime] Hob Reporter: Belen Barros Pena <belen.barros.pena>
Component: hobAssignee: Cristian Iorga <cristian.iorga>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Medium CC: belen.barros.pena, cristiana.voicu, georgex.l.musat, jessica.zhang, poky.bs.watcher, poky.watcher, valentin.popa
Version: 1.6   
Target Milestone: 1.8 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
error.png
none
Layer problem error none

Description Belen Barros Pena 2014-01-03 12:35:31 UTC
Created attachment 1703 [details]
error.png

You can reproduce the problem like this:

1. Add the meta-geeksphone layer to Hob (http://layers.openembedded.org/layerindex/branch/master/layer/meta-geeksphone/)

2. Select geeksphone-one as the machine. An error should come up during recipe parsing

3. Dismiss the error and close Hob

4. Launch Hob again

Hob should fail to launch due to a parse error like the one shown in the attached error.png

What we should do: the problem is that the first error message does not provide any corrective action. If Hob encounters a problem with an added layer, the layer should probably be automatically removed, and the users should be told so. Let me know if you are ok with this approach and I'll provide a sample error message.
Comment 1 Irina Patru 2014-02-12 10:03:20 UTC
*** Bug 5751 has been marked as a duplicate of this bug. ***
Comment 2 Irina Patru 2014-02-12 10:22:59 UTC
Hi Belen,

Here is the way I fixed the bug:
http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/commit/?h=ipatru/hob-bug&id=3d117010254d56577650599061cd6148acb7f4b1

Layers are now parsed when changed, so that we can come back to latest layer configuration. Please tell me you opinion.

Thank you,
Irina
Comment 3 Belen Barros Pena 2014-02-20 16:39:10 UTC
Hi Irina,

Sorry for taking so long to look into this. Using you branch, I am not able to add any layers to Hob. Once I click save in the layers dialog, Hob becomes unresponsive.

Any ideas about what could be wrong?

Thanks!
Comment 4 Belen Barros Pena 2014-02-20 16:45:06 UTC
(In reply to comment #3)
> Hi Irina,
> 
> Sorry for taking so long to look into this. Using you branch, I am not able
> to add any layers to Hob. Once I click save in the layers dialog, Hob
> becomes unresponsive.

Scratch that: it came back eventually, but it took quite a while.

After selecting geeksphone-one as the machine, I got the error in Hob as expected. I closed the error, closed Hob, and when I tried to launch it again, Hob failed to launch and I got this error:

ERROR: Traceback (most recent call last):
  File "/home/yocto/poky/bitbake/lib/bb/cookerdata.py", line 163, in wrapped
    return func(fn, *args)
  File "/home/yocto/poky/bitbake/lib/bb/cookerdata.py", line 173, in parse_config_file
    return bb.parse.handle(fn, data, include)
  File "/home/yocto/poky/bitbake/lib/bb/parse/__init__.py", line 99, in handle
    return h['handle'](fn, data, include)
  File "/home/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 151, in handle
    statements.eval(data)
  File "/home/yocto/poky/bitbake/lib/bb/parse/ast.py", line 39, in eval
    statement.eval(data)
  File "/home/yocto/poky/bitbake/lib/bb/parse/ast.py", line 63, in eval
    bb.parse.ConfHandler.include(self.filename, s, self.lineno, data, False)
  File "/home/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 97, in include
    ret = handle(fn, data, True)
  File "/home/yocto/poky/bitbake/lib/bb/parse/__init__.py", line 99, in handle
    return h['handle'](fn, data, include)
  File "/home/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 151, in handle
    statements.eval(data)
  File "/home/yocto/poky/bitbake/lib/bb/parse/ast.py", line 39, in eval
    statement.eval(data)
  File "/home/yocto/poky/bitbake/lib/bb/parse/ast.py", line 61, in eval
    bb.parse.ConfHandler.include(self.filename, s, self.lineno, data, "include required")
  File "/home/yocto/poky/bitbake/lib/bb/parse/parse_py/ConfHandler.py", line 100, in include
    raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
ParseError: ParseError at /home/yocto/poky/meta-smartphone/meta-geeksphone/conf/machine/geeksphone-one.conf:7: Could not include required file conf/machine/include/tune-arm1136j-s.inc

ERROR: Unable to parse conf/bitbake.conf: ParseError at /home/yocto/poky/meta-smartphone/meta-geeksphone/conf/machine/geeksphone-one.conf:7: Could not include required file conf/machine/include/tune-arm1136j-s.inc

> 
> Any ideas about what could be wrong?
> 
> Thanks!
Comment 5 Irina Patru 2014-02-20 16:58:30 UTC
Hi Belen,

What layer did you add? From the changes I made, there shouldn't appear geeksphone-one machine as a possible selection (after you choose meta-geeksphone layer).
And yes, now you have to wait quite a lot when adding a layer because they need parsing. If an error appears, then the machine list is re-updated so you must wait a little bit more to see the final changes (1-2 sec).

Please tell me your steps so I can reproduce it.

Thank you,
Irina
Comment 6 Belen Barros Pena 2014-02-21 12:17:39 UTC
Created attachment 1785 [details]
Layer problem error

(In reply to comment #5)
> Hi Belen,
> 
> What layer did you add? 

meta-geeksphone

From the changes I made, there shouldn't appear
> geeksphone-one machine as a possible selection (after you choose
> meta-geeksphone layer).

It seems to be still there

> And yes, now you have to wait quite a lot when adding a layer because they
> need parsing. If an error appears, then the machine list is re-updated so
> you must wait a little bit more to see the final changes (1-2 sec).

I am not sure this is the right solution. If I want to build for the geeksphone-one machine and I add the meta-geeksphone layer in order to do so, but Hob, very sneakily, removes it without telling me about it, I will be mighty confused, because I was expecting the geeksphone-one machine there, but it is not and I don't know why.

We need to tell people there is a problem with the layer they added and that Hob cannot use it, so it will be removed.

So this is the right sequence of events:

* I add a layer
* I select a machine
* If a problem is encountered with the layer during recipe parsing, show an error to the user saying:

There is a problem with the layer <layer_name> 

Then show the full error message in a textarea like it happens now.

Below the text area we add:

Hob will remove <layer_name> from your list of layers.

And an ok button.

When I click ok we remove the layer.

I have attached a mockup of the error message. 

Let me know if you have any questions.

> 
> Please tell me your steps so I can reproduce it.

I followed the steps I listed when opening the bug. 

> 
> Thank you,
> Irina
Comment 7 Belen Barros Pena 2015-02-12 14:27:29 UTC
We won't be making any further changes to Hob.