Bug 14077

Summary: devtool doesn't handle server failing to startup gracefully
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ross Burton <ross.burton>
Component: devtools / tool chainAssignee: Ross Burton <ross.burton>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher, randy.macleod, richard.purdie, stacygaikovaia
Version: 3.3   
Target Milestone: 3.4 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: backport to 3.2
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2020-10-06 04:36:04 UTC
I tried to use devtool:

$ devtool modify u-boot
NOTE: Starting bitbake server...
NOTE: No reply from server in 30s
^C
Traceback (most recent call last):
  File "/home/ross/Yocto/poky/scripts/lib/devtool/__init__.py", line 109, in setup_tinfoil
    tinfoil.prepare(config_only)
  File "/home/ross/Yocto/poky/bitbake/lib/bb/tinfoil.py", line 409, in prepare
    config_params.updateToServer(self.server_connection.connection, os.environ.copy())
  File "/home/ross/Yocto/poky/bitbake/lib/bb/cookerdata.py", line 73, in updateToServer
    ret, error = server.runCommand(["updateConfig", options, environment, sys.argv])
  File "/home/ross/Yocto/poky/bitbake/lib/bb/server/process.py", line 402, in runCommand
    raise bb.BBHandledException()
bb.BBHandledException

How odd, I thought.  Did a normal build:

$ bitbake m4
ERROR: ParseError at /home/ross/Yocto/meta-arm/meta-arm-bsp/conf/machine/include/corstone700.inc:3: Could not include required file conf/machine/include/tune-cortexa32.inc
$

So the server wasn't starting because it was failing to parse, but devtool didn't know that.
Comment 1 Randy MacLeod 2020-10-08 07:45:30 UTC
relates to 13993
Comment 2 Richard Purdie 2020-10-09 09:53:14 UTC
Stacy: I have another bug, #14054 which I worked on today. I don't think it will totally fix this one but it may help or be related. Patches for that are in master-next and on bitbake-devel.
Comment 3 Stacy Gaikovaia 2020-10-09 10:09:07 UTC
(In reply to comment #2)
> Stacy: I have another bug, #14054 which I worked on today. I don't think it
> will totally fix this one but it may help or be related. Patches for that
> are in master-next and on bitbake-devel.

Thanks, Richard, I'll pull that branch down.
Comment 4 Stacy Gaikovaia 2020-10-13 10:53:57 UTC
(In reply to comment #0)
> I tried to use devtool:
> 
> $ devtool modify u-boot
> NOTE: Starting bitbake server...
> NOTE: No reply from server in 30s
> ^C
> Traceback (most recent call last):
>   File "/home/ross/Yocto/poky/scripts/lib/devtool/__init__.py", line 109, in
> setup_tinfoil
>     tinfoil.prepare(config_only)
>   File "/home/ross/Yocto/poky/bitbake/lib/bb/tinfoil.py", line 409, in
> prepare
>     config_params.updateToServer(self.server_connection.connection,
> os.environ.copy())
>   File "/home/ross/Yocto/poky/bitbake/lib/bb/cookerdata.py", line 73, in
> updateToServer
>     ret, error = server.runCommand(["updateConfig", options, environment,
> sys.argv])
>   File "/home/ross/Yocto/poky/bitbake/lib/bb/server/process.py", line 402,
> in runCommand
>     raise bb.BBHandledException()
> bb.BBHandledException
> 
> How odd, I thought.  Did a normal build:
> 
> $ bitbake m4
> ERROR: ParseError at
> /home/ross/Yocto/meta-arm/meta-arm-bsp/conf/machine/include/corstone700.inc:
> 3: Could not include required file conf/machine/include/tune-cortexa32.inc
> $
> 
> So the server wasn't starting because it was failing to parse, but devtool
> didn't know that.


Hi Ross, 
If I hide conf/machine/indlude/tune-cortexa32.inc file and try to run `devtool modify u-boot`, I dont' get a server hang like you described. Intentionally introducing errors into the u-boot recipe or corstone700.inc also doesn't give me the error. Could you include some more details about your envrionment? 

Thank you, 
Stacy
Comment 5 Ross Burton 2020-10-15 07:57:05 UTC
Sorry for not noticing your comment!  I shall try and replicate today.
Comment 6 Ross Burton 2020-10-15 10:00:55 UTC
Note to self: include the poky commit I'm breaking on.

If I go back to a commit I thought was breaking then I can't replicate this anymore.  With master I can't replicate this anymore.

As I can't rule out a broken setup on my machine, I suggest we keep this open for a bit in case it happens again, but it's definitely not a release blocker.
Comment 7 Randy MacLeod 2021-04-22 18:58:17 UTC
Ross, I think the ball is in your court, right?
Comment 8 Randy MacLeod 2021-04-29 15:22:08 UTC
Ross, look, ball!
Comment 9 Ross Burton 2021-06-01 09:56:05 UTC
Can't replicate easily, closing.