Topic on Project:Support desk

Error: 1 cannot start a transaction within a transaction

11
Dbeidle (talkcontribs)

Since I updated to mediawiki-1.28.0 from mediawiki-1.26.2 yesterday, I've been getting the following error, usually when I save or preview an edited page, and occasionally when I access a page:

Original exception: [a53679567296387f8f2003e6] /~dabeidle/mediawiki-1.28.0/index.php?title=Main_Page&action=submit DBQueryError from line 1054 of /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? Query: BEGIN Function: Database::query (MessageCache::loadFromDB(en)-big) Error: 1 cannot start a transaction within a transaction

If I resubmit the edit page, the changes are saved (usually after the 3rd attempt). On a query, reloading the page works.

One change I made from the previous version was to change the database ownership from _www:_www to my account, with corresponding changes in http.conf. This is a local, private wiki running on macOS Sierra 10.12.1, PHP 5.6.25, SQLite 3.8.10.2 as a personal knowledge base so access from the Internet is not possible.

The questions I have are: "Did I encounter a regression that I need to log as a bug?" in which case I can provide more detail, or "Did I miss something (probably simple) in the upgrade or configuration?"

I followed the upgrade procedure on <http://www.mediawiki.org/wiki/Manual:Upgrading>, including upgrading the SQLite3 database.

Dbeidle (talkcontribs)

I've added the following to my LocalSettings.php file in order to produce more info:

$wgShowExceptionDetails = true;
$wgDebugLogFile = "/tmp/wiki.log";
$wgDebugToolbar = true;
$wgShowDebug = true;
$wgShowSQLErrors = true;
$wgDebugDumpSql = true;
$wgShowDBErrorBacktrace = true;
error_reporting( -1 );
ini_set( 'display_errors', 1 );

A couple of quick tests didn't reproduce the error. More testing to come tomorrow.

Ciencia Al Poder (talkcontribs)

If you reproduce that consistently, try disabling extensions, and see which one is causing the problem. Probably not a missing step in upgrade or configuration.

Dbeidle (talkcontribs)

I started off by disabling all extensions (WikiEditor, SyntaxHiglight_GeSHi, Cite), restarted the Safari browser, and browsed to the main page of the wiki. I got the following error:

'''Fatal error''': Uncaught exception 'Cdb\Exception' with message 'Unable to move the new CDB file into place.' in /Users/dabeidle/Sites/mediawiki-1.28.0/vendor/wikimedia/cdb/src/Writer/DBA.php:60 Stack trace: #0 /Users/dabeidle/Sites/mediawiki-1.28.0/vendor/wikimedia/cdb/src/Writer.php(88): Cdb\Writer\DBA->close() #1 [internal function]: Cdb\Writer->__destruct() #2 {main} thrown in '''/Users/dabeidle/Sites/mediawiki-1.28.0/vendor/wikimedia/cdb/src/Writer/DBA.php''' on line '''60'''

This was an end result of:

'''Warning''': rename(/var/tmp//l10n_cache-en.cdb.tmp.508300813,/var/tmp//l10n_cache-en.cdb): Permission denied in '''/Users/dabeidle/Sites/mediawiki-1.28.0/vendor/wikimedia/cdb/src/Writer/DBA.php''' on line '''59'''

[ec3c25e62192ab4a58132440] /~dabeidle/mediawiki-1.28.0/index.php/Main_Page MWException from line 118 of /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/localisation/LCStoreCDB.php: Unable to move the new CDB file into place.

I noticed that the tmp file in question had an ownership of dabeidle:wheel instead of dabeidle:staff. I'll try removing the tmp file, and then retry the test.

Dbeidle (talkcontribs)

Removing the one /var/tmp file did not help. Failure repeatable. However, when I terminated the browser, deleted everything in /var/tmp, restarted the browser, and browsed to my main page it loaded this time. Testing continues. Will repeat the simple main page load test a couple more times and then start enabling extensions one by one.

Dbeidle (talkcontribs)

Clearing out /var/tmp/* and disabling extensions helped a lot in reducing the occurrence of "cannot start a transaction within a transaction" errors (only saw one while navigating the wiki so far).

I use three of the bundled extensions: WikiEditor, SyntaxHighlight_GeSHi, and Cite. When I enable any one of these three extensions, the occurrence of "cannot start a transaction within a transaction" increases. Reloading the page after such an error usually works in displaying the page. Note: I use the versions distributed with media wiki, I do not use the versions from prior releases.

We can set up a screen sharing session if it'd help.

Dbeidle (talkcontribs)

Not sure if this matters... After I enabled both the Cite and SyntaxHighlight_GeSHi extensions, both Chrome and Safari browsers get a "cannot start a transaction within a transaction" fairly quickly. However, I haven't been able to reproduce the error (yet) on Firefox. Makes one go "Hmmm!"

After enabling the WikiEditor extension and editing s page several times I manage to reproduce the "cannot start a transaction within a transactions" failure consistently on Firefox now.

Ciencia Al Poder (talkcontribs)

I though our MediaWiki continuous integration tests were run on sqlite, but no, devs confirmed they're run on mysql, so a regression may be introduced recently for sqlite, which went unnoticed.

On task T88312 Aaron suggest using CDB files for localization cache on sqlite, which may be the problem in this case.

For that, according to $wgLocalisationCacheConf, be sure you've set $wgCacheDirectory to a writable directory.

Dbeidle (talkcontribs)

Uncommented $wgCacheDirectory = "$IP/cache"; in LocalSettings.php. Firefox seems a bit better (will do more testing and with other browsers). At least it's not leaving a whole bunch of "lessphp_*.lesscache" files in the /var/tmp or cache directories.

Now if I can only get back the sort arrows in my sortable table - they show up occasionally; but mostly not. Showed up under Chrome 55.0.2883.87, but not Firefox 50.0.2 or Safari 10.0.1.

Nope, still getting the "cannot start a transaction with a transaction" failure on Firefox when I edit a page. Reloading (resubmitting) the page shows that the changes were saved.

Ciencia Al Poder (talkcontribs)

Please comment on task T88312 about your issue, in case other developers can take a look, since it looks related.

Dbeidle (talkcontribs)

OK, comment submitted.

Reply to "Error: 1 cannot start a transaction within a transaction"