Topic on Project:Support desk

Uncommitted DB writes from actions such as Undelete, Protect, Move

9
Schiffy (talkcontribs)

So recently I've been encountering a problem where trying to do a select few type of actions has been kicking back errors. When I try to undelete pages, protect pages, and move pages, I am getting a message for a "Database query error". I've looked in the error log and found this in the recent entries:

12-Sep-2014 02:41:59 UTC] PHP Notice:  Uncommitted DB writes (transaction from DatabaseBase::query (DatabaseBase::query)). in .../includes/db/Database.php on line 4147

Naturally, I checked the file and that line in question, and found this on the appropriate lines (4145 - 4148):

public function __destruct() {
		if ( $this->mTrxLevel && $this->mTrxDoneWrites ) {
			trigger_error( "Uncommitted DB writes (transaction from {$this->mTrxFname})." );
		}

I've tried doing things such as setting $wgJobRunRate to 0.01 in my LocalSettings.php, and I'm still getting the error. I'm running version 1.23.3 on grisaiawiki.net, and the hosting providers haven't been able to diagnose the issue yet. If someone has another solution, it would help, as I am still fairly new to controlling a wiki server-side.

Ciencia Al Poder (talkcontribs)

The "Uncommitted DB writes" is not the actual error, but a side-effect. When an error occurs, the execution of the MediaWiki script is aborted and some transactions might be left open, and the "Uncommitted DB writes" error is then triggered, but that's the last error. You should look for the first error.

You should enable error reporting, as explained in Manual:How to debug, to get the original error message. Add this in LocalSettings.php and try again:

error_reporting( -1 );
ini_set( 'display_errors', 1 );

You should see the errors directly on the page.

Schiffy (talkcontribs)

I tried that, but no dice. I should note that the error page doesn't even look like a page on the wiki, but like this instead.

Ciencia Al Poder (talkcontribs)

Set also

$wgShowExceptionDetails = true;
Schiffy (talkcontribs)

I set all four values in that section of the Manual page to true, and what I'm now seeing is what looks like a mess of output, and the following line appears twice at the end of each page:

Title::getRestrictionTypes: applicable restrictions to [[<pagename>]] are {edit,move}

I went to look in Title.php, and what I found almost doesn't seem right. In the function getTitleProtection() I'm seeing this:

// Can't protect pages that exist.
		if ( $this->exists() ) {
			return false;
		}

which is leading me to believe that the only protection I'm able to perform is protection from creation (which, as I just tested, I am able to do). If I'm right, then that identifies at least one problem. However, as far as moving and undeleting, I'm not sure where I would find the code causing this issue.

Jackmcbarn (talkcontribs)

getTitleProtection() is specifically for create protection. Other forms of protection are handled elsewhere.

Schiffy (talkcontribs)

Well in that case.... I have no idea how to solve this error.

Jackmcbarn (talkcontribs)

You didn't enable enough debugging settings. Enable the ones under the "SQL Errors" heading.

Schiffy (talkcontribs)

Well this is new. Everything seems to be giving me "Error: 14 unable to open database file"

A while back I had made a few tables identical to those outlined in Manual:page table, Manual:revision table, and Manual:text table, they never seemed to be able to do anything, and I ended up getting rid of them. If putting them back will fix this, then I'll do that, but they never actually seemed to do anything in the first place.

Reply to "Uncommitted DB writes from actions such as Undelete, Protect, Move"