Page MenuHomePhabricator

DatabaseSqlite / Error in BEGIN query: There is already an active transaction
Closed, ResolvedPublic

Description

MediaWiki 1.24.1
SQLite 3.7.7.1
PHP 5.4.7

MW now and then fails with:

[0ee128ad] /mw-1241-sq/index.php/Main_Page Exception from line 721 of ...\includes\db\DatabaseSqlite.php: Error in BEGIN query: There is already an active transaction

Backtrace:

#0 ...\includes\db\Database.php(3514): DatabaseSqlite->doBegin(string)
#1 ...\includes\db\Database.php(1088): DatabaseBase->begin(string)
#2 ...\includes\db\Database.php(1650): DatabaseBase->query(string, string)
#3 ...\includes\db\Database.php(1739): DatabaseBase->select(string, array, array, string, array, array)
#4 ...\includes\cache\LocalisationCache.php(1156): DatabaseBase->selectRow(string, array, array, string)
#5 ...\includes\cache\LocalisationCache.php(346): LCStoreDB->get(string, string)
#6 ...\includes\cache\LocalisationCache.php(257): LocalisationCache->loadItem(string, string)
#7 ...\languages\Language.php(3187): LocalisationCache->getItem(string, string)
#8 ...\includes\specialpage\SpecialPageFactory.php(644): Language->getSpecialPageAliases()
#9 ...\includes\specialpage\SpecialPage.php(69): SpecialPageFactory::getLocalNameFor(string, string)

or

Original exception: [16bdabd7] /mw-1241-sq/index.php?title=SetParserTemplateUsage&action=purge Exception from line 721 of ...\includes\db\DatabaseSqlite.php: Error in BEGIN query: There is already an active transaction
Backtrace:
#0 ...\includes\db\Database.php(3514): DatabaseSqlite->doBegin(string)
#1 ...\includes\db\Database.php(1088): DatabaseBase->begin(string)
#2 ...\includes\db\Database.php(1650): DatabaseBase->query(string, string)
#3 [internal function]: DatabaseBase->select(string, string, array, string)
#4 ...\includes\db\LoadBalancer.php(1216): call_user_func_array(array, array)
#5 ...\includes\jobqueue\JobQueueDB.php(617): DBConnRef->__call(string, array)
#6 ...\includes\jobqueue\JobQueueDB.php(617): DBConnRef->select(string, string, array, string)
#7 ...\includes\jobqueue\JobQueue.php(666): JobQueueDB->doGetSiblingQueuesWithJobs(array)
#8 ...\includes\jobqueue\JobQueueGroup.php(284): JobQueue->getSiblingQueuesWithJobs(array)
#9 ...\includes\jobqueue\JobQueueGroup.php(265): JobQueueGroup->getQueuesWithJobs()
#10 ...\includes\MediaWiki.php(650): JobQueueGroup->queuesHaveJobs(integer)
#11 ...\includes\MediaWiki.php(446): MediaWiki->triggerJobs()
#12 ...\index.php(46): MediaWiki->run()
#13 {main}

Event Timeline

mwjames created this task.Feb 2 2015, 7:31 PM
mwjames raised the priority of this task from to Needs Triage.
mwjames updated the task description. (Show Details)
mwjames added a subscriber: mwjames.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 2 2015, 7:31 PM
Aklapper triaged this task as Low priority.Feb 2 2015, 8:04 PM
Aklapper added a project: MediaWiki-Rdbms.
Aklapper set Security to None.

Happens pretty frequently for me when uploading photos or editing their File: pages -- maybe 50% of the time.

(MediaWiki 1.24.2, PHP 5.5.20, SQLite 3.8.4.3, Mac OS X 10.10.3; extensions incude Semantic MediaWiki 2.2.1)

My error report:

MediaWiki internal error.

Original exception: [e0aca50e] /wiki/File:SomePhoto.jpg Exception from line 721 of [path to root]/w/includes/db/DatabaseSqlite.php: Error in BEGIN query: There is already an active transaction
Backtrace:
#0 [path to root]/w/includes/db/Database.php(3514): DatabaseSqlite->doBegin(string)
#1 [path to root]/w/includes/db/Database.php(1088): DatabaseBase->begin(string)
#2 [path to root]/w/includes/db/Database.php(1650): DatabaseBase->query(string, string)
#3 [path to root]/w/includes/cache/LinkBatch.php(207): DatabaseBase->select(string, array, string, string)
#4 [path to root]/w/includes/cache/LinkBatch.php(132): LinkBatch->doQuery()
#5 [path to root]/w/includes/cache/LinkBatch.php(120): LinkBatch->executeInto(LinkCache)
#6 [path to root]/w/includes/skins/Skin.php(260): LinkBatch->execute()
#7 [path to root]/w/includes/skins/Skin.php(173): Skin->preloadExistence()
#8 [path to root]/w/skins/Vector/SkinVector.php(49): Skin->initPage(OutputPage)
#9 [path to root]/w/includes/skins/SkinTemplate.php(272): SkinVector->initPage(OutputPage)
#10 [path to root]/w/includes/OutputPage.php(2226): SkinTemplate->outputPage()
#11 [path to root]/w/includes/MediaWiki.php(594): OutputPage->output()
#12 [path to root]/w/includes/MediaWiki.php(435): MediaWiki->main()
#13 [path to root]/w/index.php(46): MediaWiki->run()
#14 {main}

Exception caught inside exception handler: [345453ea] /wiki/File:SomePhoto.jpg Exception from line 721 of [path to root]/w/includes/db/DatabaseSqlite.php: Error in BEGIN query: There is already an active transaction
Backtrace:
#0 [path to root]/w/includes/db/Database.php(3514): DatabaseSqlite->doBegin(string)
#1 [path to root]/w/includes/db/Database.php(1088): DatabaseBase->begin(string)
#2 [path to root]/w/includes/db/Database.php(1650): DatabaseBase->query(string, string)
#3 [path to root]/w/includes/db/Database.php(1739): DatabaseBase->select(string, array, array, string, array, array)
#4 [path to root]/w/includes/cache/LocalisationCache.php(1156): DatabaseBase->selectRow(string, array, array, string)
#5 [path to root]/w/includes/cache/LocalisationCache.php(382): LCStoreDB->get(string, string)
#6 [path to root]/w/includes/cache/LocalisationCache.php(280): LocalisationCache->loadSubitem(string, string, string)
#7 [path to root]/w/languages/Language.php(2471): LocalisationCache->getSubitem(string, string, string)
#8 [path to root]/w/includes/cache/MessageCache.php(827): Language->getMessage(string)
#9 [path to root]/w/includes/cache/MessageCache.php(754): MessageCache->getMessageFromFallbackChain(Language, string, string, boolean)
#10 [path to root]/w/includes/Message.php(1039): MessageCache->get(string, boolean, Language)
#11 [path to root]/w/includes/Message.php(674): Message->fetchMessage()
#12 [path to root]/w/includes/Message.php(766): Message->toString()
#13 [path to root]/w/includes/exception/MWException.php(120): Message->text()
#14 [path to root]/w/includes/exception/MWException.php(177): MWException->msg(string, string)
#15 [path to root]/w/includes/exception/MWException.php(186): MWException->getPageTitle()
#16 [path to root]/w/includes/exception/MWException.php(238): MWException->reportHTML()
#17 [path to root]/w/includes/exception/MWExceptionHandler.php(45): MWException->report()
#18 [path to root]/w/includes/exception/MWExceptionHandler.php(141): MWExceptionHandler::report(DBUnexpectedError)
#19 [path to root]/w/includes/MediaWiki.php(449): MWExceptionHandler::handle(DBUnexpectedError)
#20 [path to root]/w/index.php(46): MediaWiki->run()
#21 {main}
aaron added a subscriber: aaron.Jul 15 2015, 7:36 AM

I'd advice using the CDB or LCStoreArray classes instead of LCStoreDB when using Sqlite.

DBeidle added a subscriber: DBeidle.EditedDec 10 2016, 4:55 AM

I have a wiki, based on mediawiki-1.26.2, that I use as a personal knowledge base for the various projects I have worked on. Access is limited to the localhost. I use Sqlite3 as the database engine since I don’t permit intranet or internet access, it’s simple, and easy to back up. It worked quite well at this version.

Since upgrading to mediawiki-1.28.0, I have consistently been getting the following error, particularly when trying to save or preview my changes:

MediaWiki internal error.

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

Backtrace:
#0 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(912): Database->reportQueryError(string, integer, string, string, boolean)
#1 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/DatabaseSqlite.php(741): Database->query(string, string)
#2 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(2704): DatabaseSqlite->doBegin(string)
#3 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(851): Database->begin(string, string)
#4 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(1254): Database->query(string, string)
#5 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(480): Database->select(string, string, array, string)
#6 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(403): MessageCache->loadFromDB(string, NULL)
#7 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(325): MessageCache->loadFromDBWithLock(string, array, NULL)
#8 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(927): MessageCache->load(string)
#9 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(858): MessageCache->getMsgFromNamespace(string, string)
#10 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(826): MessageCache->getMessageForLang(Language, string, boolean, array)
#11 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(767): MessageCache->getMessageFromFallbackChain(Language, string, boolean)
#12 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(1188): MessageCache->get(string, boolean, Language)
#13 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(802): Message->fetchMessage()
#14 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(939): Message->toString()
#15 /Users/dabeidle/Sites/mediawiki-1.28.0/languages/Language.php(3470): Message->escaped()
#16 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/EditPage.php(859): Language->truncate(string, integer)
#17 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/EditPage.php(526): EditPage->importFormData(WebRequest)
#18 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/actions/EditAction.php(59): EditPage->edit()
#19 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/actions/SubmitAction.php(38): EditAction->show()
#20 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/MediaWiki.php(495): SubmitAction->show()
#21 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/MediaWiki.php(289): MediaWiki->performAction(Article, Title)
#22 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/MediaWiki.php(851): MediaWiki->performRequest()
#23 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/MediaWiki.php(512): MediaWiki->main()
#24 /Users/dabeidle/Sites/mediawiki-1.28.0/index.php(43): MediaWiki->run()
#25 {main}

Exception caught inside exception handler: [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

Backtrace:
#0 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(912): Database->reportQueryError(string, integer, string, string, boolean)
#1 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/DatabaseSqlite.php(741): Database->query(string, string)
#2 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(2704): DatabaseSqlite->doBegin(string)
#3 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(851): Database->begin(string, string)
#4 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/libs/rdbms/database/Database.php(1254): Database->query(string, string)
#5 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(480): Database->select(string, string, array, string)
#6 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(403): MessageCache->loadFromDB(string, NULL)
#7 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(325): MessageCache->loadFromDBWithLock(string, array, NULL)
#8 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(927): MessageCache->load(string)
#9 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(858): MessageCache->getMsgFromNamespace(string, string)
#10 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(826): MessageCache->getMessageForLang(Language, string, boolean, array)
#11 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/cache/MessageCache.php(767): MessageCache->getMessageFromFallbackChain(Language, string, boolean)
#12 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(1188): MessageCache->get(string, boolean, Language)
#13 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(802): Message->fetchMessage()
#14 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/Message.php(902): Message->toString()
#15 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/OutputPage.php(906): Message->text()
#16 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/OutputPage.php(954): OutputPage->setHTMLTitle(Message)
#17 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/OutputPage.php(2369): OutputPage->setPageTitle(string)
#18 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/exception/MWExceptionRenderer.php(162): OutputPage->prepareErrorPage(string)
#19 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/exception/MWExceptionRenderer.php(50): MWExceptionRenderer::reportHTML(DBQueryError)
#20 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/exception/MWExceptionHandler.php(71): MWExceptionRenderer::output(DBQueryError, integer)
#21 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/exception/MWExceptionHandler.php(137): MWExceptionHandler::report(DBQueryError)
#22 /Users/dabeidle/Sites/mediawiki-1.28.0/includes/MediaWiki.php(540): MWExceptionHandler::handleException(DBQueryError)
#23 /Users/dabeidle/Sites/mediawiki-1.28.0/index.php(43): MediaWiki->run()
#24 {main}

Sometimes I get this error by just navigating (e.g., Special pages ->Version).

Reloading the page, or backing up a page and resubmitting the save/preview action, is generally successful though it may take up to 3 tries to be successful.

The installed software is:

  • macOS Sierra 10.12.1 (localhost provisioning the wiki)
  • PHP 5.6.25
  • SQLite 3.8.10.2 (apache2handler)
  • MediaWiki 1.28.0
  • Safari 10.0.1
  • Firefox 50.0.2
  • Chrome 55.0.2883.87

The installed extensions from the 1.28.0 distribution are:

  • Cite
  • SyntaxHighlight_GeSHi 2.0
  • WikiEditor

I verified that I followed the update procedure; though one change was to change the ownership of the wiki from _www:_www to dabeidle:staff to avoid changing the ownership of the images directory and contents.

Disabling the extensions and clearing out /var/tmp/* helped in reducing the occurrence of the error. When I enable any one of the extensions, the occurrence of the error increases.

Per Cienca Al Poder’s suggestion, I uncommented '$wgCacheDirectory = "$IP/cache";' in LocalSettings.php. This eliminated the leftover “lessphp_*.lesscache” files in /var/tmp. None showed up in the cache directory. A slight improvement was noted.

At this point, I’m still getting the error in the three browsers. I'm willing to do a screen sharing session if it'd help provide more information.

I also noticed that Chrome was the only browser that consistently displayed the ordering arrows in the column headings of my sortable table on the main page.

DBeidle added a comment.EditedDec 13 2016, 8:43 PM

I've also noticed that when I added a internal link to a page, the text shows up as bright red as expected. When I click on the link to create the page, I can successfully create that page. However going back a page (the one containing the link), the text changes to a dark red. Hovering over the link, I see the text "page does not exist". Yet, clicking on the link successfully navigates to the newly created page.

Interesting, the next day, the link color is now dark blue, and no longer indicates "page does not exist" in Chrome.

I noticed on https://www.mediawiki.org/wiki/Manual:$wgServer, a warning against setting $wgServer to http://localhost. It's been set to that on 1.26.2, and earlier, for years with no problems. Based on that warning, I changed $wgServer to point to "http://akamalipedia.loc", a virtual host. I still get the occasional "can't start a transaction with a transaction" error, even while navigating around the wiki.

This frequently effects me when either creating or editing a page.
php: 7.1.1
mediawiki: 1.28.0
sqlite: 3.15.1

This is a fresh install of MediaWiki

Object Moved

This document may be found hereMediaWiki internal error.

Original exception: [eb486620d1b136e29cc1104a] /JadeInternalWiki/index.php?title=Main_Page&action=submit JobQueueError from line 813 of D:\JadeWikiRoot\mediawiki-1.28.0\includes\jobqueue\JobQueueDB.php: DBQueryError: A database query error has occurred. Did you forget to run your application's database schema updater after upgrading? 
Query: UPDATE job SET job_token = '163c70e942c4214d3b1fb6ce2ed62f06',job_token_timestamp = '20170321205424',job_attempts = job_attempts+1 WHERE job_cmd = 'htmlCacheUpdate' AND job_id = '99' AND job_token = ''
Function: JobQueueDB::claimRandom
Error: 5 database is locked

Backtrace:
#0 D:\JadeWikiRoot\mediawiki-1.28.0\includes\jobqueue\JobQueueDB.php(304): JobQueueDB->throwDBException(DBQueryError)
#1 D:\JadeWikiRoot\mediawiki-1.28.0\includes\jobqueue\JobQueue.php(372): JobQueueDB->doPop()
#2 D:\JadeWikiRoot\mediawiki-1.28.0\includes\jobqueue\JobQueueGroup.php(240): JobQueue->pop()
#3 D:\JadeWikiRoot\mediawiki-1.28.0\includes\jobqueue\JobRunner.php(157): JobQueueGroup->pop(integer, integer, array)
#4 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(1025): JobRunner->run(array)
#5 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(900): MediaWiki->triggerJobs()
#6 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(720): MediaWiki->restInPeace(string)
#7 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(739): MediaWiki->{closure}()
#8 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(543): MediaWiki->doPostOutputShutdown(string)
#9 D:\JadeWikiRoot\mediawiki-1.28.0\index.php(43): MediaWiki->run()
#10 {main}

Exception caught inside exception handler: [eb486620d1b136e29cc1104a] /JadeInternalWiki/index.php?title=Main_Page&action=submit DBQueryError from line 1054 of D:\JadeWikiRoot\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 (LinkBatch::doQuery (for Skin::preloadExistence))
Error: 1 cannot start a transaction within a transaction

Backtrace:
#0 D:\JadeWikiRoot\mediawiki-1.28.0\includes\libs\rdbms\database\Database.php(912): Database->reportQueryError(string, integer, string, string, boolean)
#1 D:\JadeWikiRoot\mediawiki-1.28.0\includes\libs\rdbms\database\DatabaseSqlite.php(741): Database->query(string, string)
#2 D:\JadeWikiRoot\mediawiki-1.28.0\includes\libs\rdbms\database\Database.php(2704): DatabaseSqlite->doBegin(string)
#3 D:\JadeWikiRoot\mediawiki-1.28.0\includes\libs\rdbms\database\Database.php(851): Database->begin(string, string)
#4 D:\JadeWikiRoot\mediawiki-1.28.0\includes\libs\rdbms\database\Database.php(1254): Database->query(string, string)
#5 D:\JadeWikiRoot\mediawiki-1.28.0\includes\cache\LinkBatch.php(209): Database->select(string, array, string, string)
#6 D:\JadeWikiRoot\mediawiki-1.28.0\includes\cache\LinkBatch.php(137): LinkBatch->doQuery()
#7 D:\JadeWikiRoot\mediawiki-1.28.0\includes\cache\LinkBatch.php(126): LinkBatch->executeInto(LinkCache)
#8 D:\JadeWikiRoot\mediawiki-1.28.0\includes\skins\Skin.php(225): LinkBatch->execute()
#9 D:\JadeWikiRoot\mediawiki-1.28.0\includes\skins\Skin.php(145): Skin->preloadExistence()
#10 D:\JadeWikiRoot\mediawiki-1.28.0\skins\Vector\SkinVector.php(47): Skin->initPage(OutputPage)
#11 D:\JadeWikiRoot\mediawiki-1.28.0\includes\skins\SkinTemplate.php(249): SkinVector->initPage(OutputPage)
#12 D:\JadeWikiRoot\mediawiki-1.28.0\includes\OutputPage.php(2333): SkinTemplate->outputPage()
#13 D:\JadeWikiRoot\mediawiki-1.28.0\includes\exception\MWException.php(174): OutputPage->output()
#14 D:\JadeWikiRoot\mediawiki-1.28.0\includes\exception\MWException.php(220): MWException->reportHTML()
#15 D:\JadeWikiRoot\mediawiki-1.28.0\includes\exception\MWExceptionHandler.php(69): MWException->report()
#16 D:\JadeWikiRoot\mediawiki-1.28.0\includes\exception\MWExceptionHandler.php(137): MWExceptionHandler::report(JobQueueError)
#17 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(722): MWExceptionHandler::handleException(JobQueueError)
#18 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(739): MediaWiki->{closure}()
#19 D:\JadeWikiRoot\mediawiki-1.28.0\includes\MediaWiki.php(543): MediaWiki->doPostOutputShutdown(string)
#20 D:\JadeWikiRoot\mediawiki-1.28.0\index.php(43): MediaWiki->run()
#21 {main}

This issue "Error: 1 cannot start a transaction within a transaction" happens fairly consistently now on showing a preview, saving a page, or simply navigating the website. It can take several (1 - 6) page reloads and confirmations to get the action to take (getting to be irritating). On rare occasions a page reload is not required (it works on the first try). The apparent lack of support for the sqlite database option is disheartening. I'm left with three options that do not appeal to me:

  1. Learn php and MediaWiki internals to fix it myself,
  2. Migrate from sqlite to mysql (which seems to enjoy more support), or
  3. Migrate from MediaWiki to another wiki solution.

For now, I figured out how to create and run a scheduled backup script to back up my wiki (knowledge base) on my MacBook to a separate directory that CrashPlan can back up, This at least eliminates a possible conflict between MediaWiki and CrashPlan accessing the database concurrently. I doubt it will solve anything, but it gives me a path to migrate to another option.

aaron added a comment.Mar 27 2017, 8:15 PM

I use sqlite for testing on most of my computers and don't notice this problem. Things that make contention likely would mostly be:
a) Using CACHE_DB as $wgMainCacheType instead of apc/memcached/separate .sqlite file/ect...New MediaWiki versions use a separate sqlite DB when using CACHE_DB via the installer.
b) Using LCStoreDB as the message cache instead of files; one case use files via << $wgLocalisationCacheConf['storeDirectory'] = "/tmp/mw-cache"; $wgLocalisationCacheConf['store'] = 'files'; >>
c) Using $wgJobRunRate to run jobs at the end of web requests (without HHVM or async jobs to mask errors) while using the same sqlite DB to house the jobs table. https://www.mediawiki.org/wiki/User:Aaron_Schulz/How_to_make_MediaWiki_fast explains how to use a separate sqlite DB for jobs.

Change 345015 had a related patch set uploaded (by Aaron Schulz):
[mediawiki/core@master] Catch errors in more cases inside MediaWiki::triggerJobs()

https://gerrit.wikimedia.org/r/345015

I use a plain, vanilla, out of the box LocalSettings.php file as much as I can for my simple personal single-user wiki. Almost all the settings listed in the How_to_make_MediaWiki_ fast are not defined. The only exceptions are:

$wgMainCacheType = CACHE_NONE;
$wgCacheDirectory = "$IP/cache";

The latter line recommend by an earlier posting by MediaWiki support monitors. And copying to another directory didn't seem to help much. I still get "can't start a transaction within a transaction" errors. Sometimes a page update works on the first try, often it takes several page reloads to get the changes to stick.

Change 345015 merged by jenkins-bot:
[mediawiki/core@master] Catch errors in more cases inside MediaWiki::triggerJobs()

https://gerrit.wikimedia.org/r/345015

Do you need me to download the changes to help resolve/isolate the issue?

DBeidle added a comment.EditedApr 17 2017, 12:39 AM

I have upgraded to Mediawiki 1.28.1... I will let you know if things improve over the course of the next week or so. It does seem a bit more responsive once pages are cached.

Nope. Still have problems editing pages. Still get the "cannot start a transaction within a transaction" failure. Work-around: reload/confirm page one, or more, times until the Save action successfully completes.

I am trying to get the VisualEditor functioning and this error is preventing any progress for me. Running v1.29.0 . Since SQLite doesn't appear to be fully supported I'm now looking into ways to convert from it to MariaDB or PostGres.