<?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>8215</bug_id>
          
          <creation_ts>2015-08-27 09:28:30 +0000</creation_ts>
          <short_desc>Remote PR server not writing PR values to database</short_desc>
          <delta_ts>2015-11-02 12:27:24 +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.8</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>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Eggleton">bluelightning</reporter>
          <assigned_to name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</assigned_to>
          <cc>alejandro.hernandez</cc>
    
    <cc>alexandru.c.georgescu</cc>
    
    <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="Daniel Istrate">daniel.alexandrux.istrate</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>Unknown (Hard to categorize)</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>53466</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-08-27 09:28:30 +0000</bug_when>
    <thetext>Using poky from master (393bd7496d71eb101f21234c1233a2d18fd2c73e), try the following:

1) Set up a PR server on one machine, assuming 192.168.1.10 is its IP address:
bitbake-prserv --host 192.168.1.10 --port 8585 --start

2) On another machine, set up to run a build using this by adding the following to local.conf, also enabling buildhistory:
PRSERV_HOST = &quot;192.168.1.10:8585&quot;
INHERIT += &quot;buildhistory&quot;
BUILDHISTORY_COMMIT = &quot;1&quot;

3) Build some trivial recipe; in my case I wrote this to test it:

LICENSE = &quot;CLOSED&quot;
INHIBIT_DEFAULT_DEPS = &quot;1&quot;
SUMMARY = &quot;summary&quot;
ALLOW_EMPTY_${PN} = &quot;1&quot;

4) Build the recipe, then look in buildhistory and you&apos;ll note that PKGR is being set to &quot;r0.0&quot; as expected.

5) Edit the recipe and change the SUMMARY value to something different, then build the recipe again and note that in buildhistory the PKGR value has incremented to &quot;r0.1&quot; as expected. (All is well up to this point).

6) Go back to the PR server machine and use &quot;sqlite3 prserv.sqlite3&quot; to examine the database. Note that it contains only a PRMAIN_nohist table which is empty.

7) Stop the PR server with and start it again:
bitbake-prserv --host 192.168.1.10 --port 8585 --stop
bitbake-prserv --host 192.168.1.10 --port 8585 --start

8) Edit the recipe and change the SUMMARY value to something different again, then build the recipe. You will get a QA error noting that the package version has gone backwards from &quot;1.0-r0.1&quot; to &quot;1.0-r0.0&quot;.

It would appear that the PR server isn&apos;t storing the PR value in the database properly under this scenario. Perhaps the transaction we&apos;re beginning isn&apos;t being committed properly? I&apos;m using sqlite 3.8.2 on an Ubuntu 14.04.3 LTS machine in the above test if it makes a difference; Jan-Simon Moeller reports similar behaviour on an openSUSE 13.2 machine.

Nothing by way of an error or warning shows up in prserv.log, just the normal starting/stopping messages. I also tried passing --loglevel=DEBUG when starting the PR server but that doesn&apos;t seem to make it log any more information.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54123</commentid>
    <comment_count>1</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-09-15 23:09:59 +0000</bug_when>
    <thetext>Patch sent to the ML. The problem was the Journal Mode. WAL just work when DB is on the host machine. So changing it to DELETE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54639</commentid>
    <comment_count>2</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-09-24 17:03:49 +0000</bug_when>
    <thetext>Second patch (V2) sent to the list. Journal remain the same (WAL); the problem was that the connection to the DB was closed when starting the daemon, so PR updates were not done. Now connection is closed outside the __del__ class function.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54725</commentid>
    <comment_count>3</comment_count>
    <who name="Leonardo Sandoval Gonzalez">leonardo.sandoval.gonzalez</who>
    <bug_when>2015-09-28 14:06:06 +0000</bug_when>
    <thetext>COMMIT: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=134b267ebbcbf7a7bc43915e204da776530911d4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56086</commentid>
    <comment_count>4</comment_count>
    <who name="Daniel Istrate">daniel.alexandrux.istrate</who>
    <bug_when>2015-11-02 12:27:24 +0000</bug_when>
    <thetext>Verified on master: 370a2916c4559c17952392b872322e8e490b124c

At step 8:
- No QA error is shown
- PKGR is incremented to r0.2
- PR server is storing the PR value in the database properly:
sqlite&gt; select * from PRMAIN_nohist;
testrecipe-1.0-r0|i586|57f4cebfd8e2d1b77800ec343dde7ad6|0
testrecipe-1.0-r0|i586|6eb24890afedb6a38fc50c3135b784b8|1
testrecipe-1.0-r0|i586|077c8033ee3961a2fa56b66e48af648b|2</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>