<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>5059</bug_id>
          
          <creation_ts>2013-08-28 01:10:56 +0000</creation_ts>
          <short_desc>ERROR: PRservice 127.0.0.1:33824 not available</short_desc>
          <delta_ts>2013-10-09 05:57:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>1.5</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jonathan Liu">net147</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>jason.wessel</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>razvanx.ionescu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35964</commentid>
    <comment_count>0</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2013-08-28 01:10:56 +0000</bug_when>
    <thetext>Doing a clean build (new build directory created) of an image for x86, I get the following:
NOTE: Started PRServer with DBfile: /home/user/git/poky/build/cache/prserv.sql
ite3, IP: 127.0.0.1, PORT: 33824, PID: 1702
ERROR: PRservice 127.0.0.1:33824 not available

Summary: There was 1 ERROR message shown, returning a non-zero exit code.
timed out


conf/local.conf contains the following relevant additional options:
BB_NUMBER_THREADS = &quot;8&quot;
PARALLEL_MAKE = &quot;-j 8&quot;
PRSERV_HOST = &quot;localhost:0&quot;

Using poky master 4fd453ef7cd2e7e2b1d72284440dac574603ed27.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35965</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2013-08-28 01:35:33 +0000</bug_when>
    <thetext>I have git bisected the error to http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=da6260f95f4adcca22da9b0d5fb26e93c0a2517f:

commit da6260f95f4adcca22da9b0d5fb26e93c0a2517f
Author: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Date:   Tue Aug 27 15:12:55 2013 -0500

    bitbake: serv.py: Fix hang when spawned dynamically with bitbake</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35966</commentid>
    <comment_count>2</comment_count>
    <who name="Jason Wessel">jason.wessel</who>
    <bug_when>2013-08-28 02:11:14 +0000</bug_when>
    <thetext>Is there any data in the cache/prserv.log?

If there is a traceback, that is the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35967</commentid>
    <comment_count>3</comment_count>
    <who name="Jason Wessel">jason.wessel</who>
    <bug_when>2013-08-28 02:14:37 +0000</bug_when>
    <thetext>diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
index 8a32122..2533782 100644
--- a/lib/prserv/serv.py
+++ b/lib/prserv/serv.py
@@ -146,7 +146,7 @@ class PRServer(SimpleXMLRPCServer):
         # Clear out all log handlers prior to the fork() to avoid calling
         # event handlers not part of the PRserver
         for logger_iter in logging.Logger.manager.loggerDict.keys():
-            logger_iter.handlers = []
+            logging.getLogger(logger_iter).handlers = []
 
         # Ensure logging makes it to the logfile
         streamhandler = logging.StreamHandler()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35968</commentid>
    <comment_count>4</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2013-08-28 02:20:22 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Is there any data in the cache/prserv.log?
&gt; 
&gt; If there is a traceback, that is the problem.

cache/prserve.log contains:
Process ProcessServer-1:
Traceback (most recent call last):
  File &quot;/usr/lib/python2.7/multiprocessing/process.py&quot;, line 258, in _bootstrap
    self.run()
  File &quot;/home/user/git/poky/bitbake/lib/bb/server/process.py&quot;, line 96, in run
    bb.cooker.server_main(self.cooker, self.main)
  File &quot;/home/user/git/poky/bitbake/lib/bb/cooker.py&quot;, line 1261, in server_main
    cooker.pre_serve()
  File &quot;/home/user/git/poky/bitbake/lib/bb/cooker.py&quot;, line 1237, in pre_serve
    self.prhost = prserv.serv.auto_start(self.data)
  File &quot;/home/user/git/poky/bitbake/lib/prserv/serv.py&quot;, line 296, in auto_start
    singleton.start()
  File &quot;/home/user/git/poky/bitbake/lib/prserv/serv.py&quot;, line 178, in start
    self.prserv.start()
  File &quot;/home/user/git/poky/bitbake/lib/prserv/serv.py&quot;, line 101, in start
    pid = self.daemonize()
  File &quot;/home/user/git/poky/bitbake/lib/prserv/serv.py&quot;, line 149, in daemonize
    logger_iter.handlers = []
AttributeError: &apos;str&apos; object has no attribute &apos;handlers&apos;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35969</commentid>
    <comment_count>5</comment_count>
    <who name="Jonathan Liu">net147</who>
    <bug_when>2013-08-28 02:21:29 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; diff --git a/lib/prserv/serv.py b/lib/prserv/serv.py
&gt; index 8a32122..2533782 100644
&gt; --- a/lib/prserv/serv.py
&gt; +++ b/lib/prserv/serv.py
&gt; @@ -146,7 +146,7 @@ class PRServer(SimpleXMLRPCServer):
&gt;          # Clear out all log handlers prior to the fork() to avoid calling
&gt;          # event handlers not part of the PRserver
&gt;          for logger_iter in logging.Logger.manager.loggerDict.keys():
&gt; -            logger_iter.handlers = []
&gt; +            logging.getLogger(logger_iter).handlers = []
&gt;  
&gt;          # Ensure logging makes it to the logfile
&gt;          streamhandler = logging.StreamHandler()

That patch fixes it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36039</commentid>
    <comment_count>6</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2013-08-29 13:40:23 +0000</bug_when>
    <thetext>Resolved with http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=84708a45247fcdd08212b479a0b051281bd41204</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>37763</commentid>
    <comment_count>7</comment_count>
    <who name="Razvan Ionescu">razvanx.ionescu</who>
    <bug_when>2013-10-09 05:57:06 +0000</bug_when>
    <thetext>Verified with: poky:84708a45247fcdd08212b479a0b051281bd41204 .

I have run bitbake many times and each time a different port is open (e.g. localhost:51879, localhost:50064, localhost:50361), PRSERVICE being available everytime.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>