Bug 10740 - Handle exceptions while populating data to transmit using xmlrpc
Summary: Handle exceptions while populating data to transmit using xmlrpc
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 2.3
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.3 M1
Assignee: Sujith H
QA Contact: David Lopez Barriba
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2016-11-29 05:17 UTC by Sujith H
Modified: 2017-01-17 14:07 UTC (History)
5 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sujith H 2016-11-29 05:17:33 UTC
While working for toaster, I came across an incident. A variable which was used for private use was having value as subprocess.Popen. The problem was detected in function: getAllKeysWithFlags from file: bitbake/lib/bb/cooker.py. The error shown was:

ERROR: <Fault 1: "<class 'TypeError'>:cannot marshal <class '_thread.lock'> objects">
Traceback (most recent call last):
  File "/home/sujith/MEL/toaster-latest/poky/bitbake/lib/bb/ui/toasterui.py", line 256, in main
    buildinfohelper.save_build_layers_and_variables()
  File "/home/sujith/MEL/toaster-latest/poky/bitbake/lib/bb/ui/buildinfohelper.py", line 1151, in save_build_layers_and_variables
    data = self.server.runCommand(["getAllKeysWithFlags", ["doc", "func"]])[0]
  File "/usr/lib/python3.4/xmlrpc/client.py", line 1098, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.4/xmlrpc/client.py", line 1437, in __request
    verbose=self.__verbose
  File "/usr/lib/python3.4/xmlrpc/client.py", line 1140, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.4/xmlrpc/client.py", line 1156, in single_request
    return self.parse_response(resp)
  File "/usr/lib/python3.4/xmlrpc/client.py", line 1327, in parse_response
    return u.close()
  File "/usr/lib/python3.4/xmlrpc/client.py", line 657, in close
    raise Fault(**self._stack[0])
xmlrpc.client.Fault: <Fault 1: "<class 'TypeError'>:cannot marshal <class '_thread.lock'> objects">


So if we handle the types which come from the data store as marshallable or at least if we try to have a mechanism to convert non marshallable type objects to str, then this issue could have been suppressed.
Comment 1 Sujith H 2016-11-29 07:32:05 UTC
While investigation it was found that variable v was having object of type v = <subprocess.Popen object at 0x7f56f4964ef0>.
Comment 2 Ross Burton 2016-12-15 12:00:05 UTC
Fixed in bitbake efb0e47479b3526bc047112f7200087c5844bba4.