Bug 15008

Summary: 'BitBakeXMLRPCServer' object has no attribute 'set_async_cmd'
Product: [Build System, Metadata & Runtime] BitBake Reporter: Tim Orling <tim.orling>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: poky.bs.watcher, poky.watcher, randy.macleod
Version: 4.2   
Target Milestone: 4.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Tim Orling 2023-01-17 17:29:26 UTC
The async command changes in "bitbake: process/cooker/command: Fix currentAsyncCommand locking/races" lead to breakage in the BitBakeXMLRPCServer.

Bitbake rev: b5215887d2f8ea3f28f1ebda721bd5b8f93ec7f3

(https://git.yoctoproject.org/poky/commit/bitbake?id=165e8b563d400bf54c317659a267db85e8c34006)


NOTE: This might be a bug for toasterui instead?

Error (from crops/toaster-container smoketest which builds quilt-native with "master"):

Traceback (most recent call last):
  File "/home/usersetup/poky/bitbake/bin/bitbake", line 36, in <module>
    sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
  File "/home/usersetup/poky/bitbake/lib/bb/main.py", line 404, in bitbake_main
    return ui_module.main(server_connection.connection, server_connection.events,
  File "/home/usersetup/poky/bitbake/lib/bb/ui/toasterui.py", line 177, in main
    ret, error = server.runCommand(cmdline['action'])
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1109, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1450, in __request
    response = self.__transport.request(
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1153, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1169, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.8/xmlrpc/client.py", line 1341, in parse_response
    return u.close()
  File "/usr/lib/python3.8/xmlrpc/client.py", line 655, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'AttributeError'>:'BitBakeXMLRPCServer' object has no attribute 'set_async_cmd'">
Comment 1 Tim Orling 2023-01-21 23:14:07 UTC
**Very** naively adding the {set,clear,get}_async_cmd to lib/bb/server/xmlrpcserver.py [1] _seems_ to get past this error, but then results in:

`
Bitbake crash
Traceback (most recent call last):
  File ".../workspace-toaster/poky/bitbake/bin/bitbake", line 36, in <module>
    sys.exit(bitbake_main(BitBakeConfigParameters(sys.argv),
  File ".../workspace-toaster/poky/bitbake/lib/bb/main.py", line 404, in bitbake_main
    return ui_module.main(server_connection.connection, server_connection.events,
  File ".../workspace-toaster/poky/bitbake/lib/bb/ui/toasterui.py", line 135, in main
    params.updateToServer(server, os.environ.copy())
  File ".../workspace-toaster/poky/bitbake/lib/bb/cookerdata.py", line 75, in updateToServer
    raise Exception("Unable to update the server configuration with local parameters: %s" % error)
Exception: Unable to update the server configuration with local parameters: Traceback (most recent call last):
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/command.py", line 91, in runCommand
    result = command_method(self, commandline)
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/command.py", line 290, in updateConfig
    command.cooker.updateConfigOpts(options, environment, cmdline)
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/cooker.py", line 540, in updateConfigOpts
    self.reset()
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/cooker.py", line 1776, in reset
    self.initConfigurationData()
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/cooker.py", line 397, in initConfigurationData
    self.databuilder.parseBaseConfiguration()
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/cookerdata.py", line 269, in parseBaseConfiguration
    self.data = self.parseConfigurationFiles(self.prefiles, self.postfiles)
  File ".../workspace-toaster/_toaster_clones/_git___git.yoctoproject.org_poky_master/bitbake/lib/bb/cookerdata.py", line 472, in parseConfigurationFiles
    raise SystemExit(msg)
SystemExit: The BBPATH variable is not set and bitbake did not find a conf/bblayers.conf file in the expected location.
Maybe you accidentally invoked bitbake from the wrong directory?
`

[1] https://git.yoctoproject.org/poky-contrib/commit/?h=timo/toaster-15008&id=0328bc30403e6e8ba4cc3018b70c7552ac9cab7f
Comment 3 Tim Orling 2023-03-08 18:37:57 UTC
Passed crops/toaster-container tests:
https://github.com/crops/toaster-container/actions/runs/4356489265/jobs/7614565651