Last modified: 2013-02-20 22:42:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T44370, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 42370 - PHP 5.4: Undefined property DatabasePostgres::$mTrxDoneWrites stops database writes using pgbouncer
PHP 5.4: Undefined property DatabasePostgres::$mTrxDoneWrites stops database ...
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.20.x
PC Linux
: High blocker (vote)
: 1.20.x release
Assigned To: Aaron Schulz
:
: 42592 (view as bug list)
Depends on:
Blocks: 42592
  Show dependency treegraph
 
Reported: 2012-11-23 00:53 UTC by Hugh Davenport
Modified: 2013-02-20 22:42 UTC (History)
9 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hugh Davenport 2012-11-23 00:53:40 UTC
Hi,

I've installed media wiki from git, using the REL1_20 branch.

My setup is as follows (debian versions on second line in brackets, running debian wheezy):

Web server:
nginx version: nginx/1.2.1
 (1.5.2-4)
PHP 5.4.4-9 (fpm-fcgi) (built: Oct 26 2012 13:10:40)
 (1.5.2-4)

Database server:
stunnel 4.53 on x86_64-pc-linux-gnu platform
 (1.5.2-4)
pgbouncer version 1.5.2 (compiled by <cbe@benz> at 2012-11-02 10:29:46)
 (1.5.2-4)
postgresql 9.1.6
 (9.1+134wheezy2)

The error I got in in my error log was:
PHP message: PHP Notice:  Undefined property: DatabasePostgres::$mTrxDoneWrites in /var/www/wiki.example.com/includes/db/Database.php on line 512

The error in the pgbouncer logs was:
2012-11-22 10:07:54.054 17899 LOG C-0xafec38: wiki_example_com/wiki.example.com@unix:6432 closing because: client close request (age=0)
2012-11-22 10:07:54.054 17899 LOG S-0xae16c0: wiki_example_com/wiki.example.com@unix:5432 closing because: unclean server (age=0)

What I was trying to do, for example, was send a confirmation email to confirm the email, which tries to write the confirmation key to the database. This was not correctly written to the database, and so the link did not work.

When I add this patch (not final product! just to get it working) it works fine.
diff --git a/includes/db/Database.php b/includes/db/Database.php
index eca684a..4ef5f72 100644
--- a/includes/db/Database.php
+++ b/includes/db/Database.php
@@ -509,7 +509,7 @@ abstract class DatabaseBase implements DatabaseType {
         * @return bool
         */
        public function writesOrCallbacksPending() {
-               return $this->mTrxLevel && ( $this->mTrxDoneWrites || $this->mTrxIdleCallbacks );
+               return true || $this->mTrxLevel && ( $this->mTrxDoneWrites || $this->mTrxIdleCallbacks );
        }
 
        /**

I think it could just be because of my funky setup with pgbouncer as well, but there is an undefined property which should probably get tracked down. When I get some free time I will write up a patch for it.

If you need more details like config etc, let me know.

Cheers,

Hugh
Comment 1 Kevin Israel (PleaseStand) 2012-11-30 08:45:26 UTC
This bug is not Postgres-specific. I can reproduce this bug on my local installation (which uses MySQL), and the notice stopped appearing after I reverted commit 60cc0607084b5f71945956fa100abf6050684a20.

Because there are user reports (at Project:Support desk) mentioning two different versions of PHP 5.3 (and also both MySQL 5.1 and 5.5), I'm removing the "newphp" tag.

I'm thinking that change I3f1dd5fd may need to be backported to 1.20 as well, as it's the change that introduces the "private $mTrxDoneWrites = false;" line.
Comment 2 Andre Klapper 2012-11-30 13:12:19 UTC
(In reply to comment #1)
> I'm thinking that change I3f1dd5fd may need to be backported to 1.20 as well,
> as it's the change that introduces the "private $mTrxDoneWrites = false;" line.

Aaron: Could you consider backporting?
Comment 3 Aaron Schulz 2012-11-30 18:38:55 UTC
https://gerrit.wikimedia.org/r/36220
Comment 4 Nemo 2012-12-02 20:51:33 UTC
(In reply to comment #3)
> https://gerrit.wikimedia.org/r/36220

Did it work? See bug 42592.
Comment 5 Andre Klapper 2012-12-03 18:32:01 UTC
*** Bug 42592 has been marked as a duplicate of this bug. ***
Comment 6 Andre Klapper 2012-12-03 18:33:47 UTC
Note: Bug 42592 comment 11 states "This probably justifies a 1.20.2 release."
Comment 7 Hugh Davenport 2012-12-03 20:55:19 UTC
Hi all,

2c6cba79c6e1a49a7858cbad61a01d2a79a4a383 appears to fix it. As Aaron says, it looks like https://gerrit.wikimedia.org/r/#/c/24655/ will also do the same. Aaron, if you don't have time to backport it, I would be keen on giving it a go.

Cheers,

Hugh
Comment 8 Andre Klapper 2012-12-07 17:36:52 UTC
Chris: Are there plans to provide a new 1.20.2 tarball?
Comment 9 Andre Klapper 2012-12-07 17:38:34 UTC
Urgh. Ignore my last comment, obviously I miseed tarball release announcements.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links