Last modified: 2013-09-04 11:47:19 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 T33696, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 31696 - update.php fails with SQLite
update.php fails with SQLite
Status: RESOLVED WORKSFORME
Product: MediaWiki
Classification: Unclassified
Database (Other open bugs)
1.17.x
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: sqlite
  Show dependency treegraph
 
Reported: 2011-10-14 14:19 UTC by Jussi Kekkonen
Modified: 2013-09-04 11:47 UTC (History)
8 users (show)

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


Attachments

Description Jussi Kekkonen 2011-10-14 14:19:56 UTC
While trying to run php maintenance/update.php on a wiki that uses SQLite database, instead of doing the update the script returns:

MediaWiki 1.17.0 Updater

DB connection error: Cannot return last error, no db connection

The required database update isn't done, tested with extension(s) and without.

Tested on following setup:

MediaWiki 	1.17.0
PHP 	5.2.6-1+lenny13 (cgi-fcgi)
SQLite 	3.5.9 with full-text search support
Comment 1 Brion Vibber 2011-10-14 20:44:05 UTC
Can the updaters even work on sqlite? ALTER TABLE is pretty much limited to adding new fields...

http://www.sqlite.org/lang_altertable.html
Comment 2 Max Semenik 2011-10-15 01:05:55 UTC
Yes it can. As the matter of fact, unit tests verify this on every run even if $wgDBtype is not "sqlite":) We have to work around cases where we need DROP COLUMN, of course:)
Comment 3 Brion Vibber 2011-10-15 19:54:51 UTC
Ok, confirmed w/ Max that we expect the updaters to generally work; things like drop column are worked around by duplicating data to a temporary table, then swapping it back in place.

So this is probably a fairly specific problem: perhaps incorrect path so it's not loading properly, or something closing out the connection (which ought not happen :) in the middle of the updates.

Jussi, what was the previous version of MW that you're updating from? We can try updating the same versions and see if this happens for us...

Probably also worth double-checking contents of your LocalSettings.php to make sure that paths and settings are correct and nothing changed unexpectedly.
Comment 4 Jussi Kekkonen 2011-10-16 08:09:42 UTC
(In reply to comment #3)
> Ok, confirmed w/ Max that we expect the updaters to generally work; things like
> drop column are worked around by duplicating data to a temporary table, then
> swapping it back in place.
> 
> So this is probably a fairly specific problem: perhaps incorrect path so it's
> not loading properly, or something closing out the connection (which ought not
> happen :) in the middle of the updates.
> 
> Jussi, what was the previous version of MW that you're updating from? We can
> try updating the same versions and see if this happens for us...
> 
> Probably also worth double-checking contents of your LocalSettings.php to make
> sure that paths and settings are correct and nothing changed unexpectedly.

This is a mediawiki that was installed as 1.17.0, and I tried to run the update.php so I could finalize the install of liquidthreads extension (svn). The wiki works just fine otherwise, but I can provide my settings if its needed.
Comment 5 Max Semenik 2011-10-16 15:05:50 UTC
Ow, LiquidThreads.... Could you confirm that everything works if LQT is disabled?
Comment 6 Jussi Kekkonen 2011-10-17 05:47:38 UTC
(In reply to comment #5)
> Ow, LiquidThreads.... Could you confirm that everything works if LQT is
> disabled?

Yup, did test and got the same result (error), hence the "tested with extension(s) and without" in the original message. (:
Comment 7 p858snake 2011-10-17 05:53:31 UTC
when you say without extensions, do you mean you removed the LQT folder or just
disabled it in LocalSettings?
Comment 8 Jussi Kekkonen 2011-10-17 06:04:40 UTC
(In reply to comment #7)
> when you say without extensions, do you mean you removed the LQT folder or just
> disabled it in LocalSettings?

Latter, now I tested with (re)moving the extension folder contents so there's none, and still the same error. Something else I should try?
Comment 9 Mark A. Hershberger 2011-10-18 11:44:17 UTC
This is probably a permissions failure.  Could you run the command line script with the same user as the one who runs the web server?  Alternatively, see http://www.mediawiki.org/wiki/Extension:Maintenance_scripts
Comment 10 Chad H. 2011-10-18 11:52:42 UTC
(In reply to comment #9)
> Alternatively, see
> http://www.mediawiki.org/wiki/Extension:Maintenance_scripts

Please do not recommend that or any other "maintenance" extension. Maintenance scripts are meant to be run from the command line only.
Comment 11 Jussi Kekkonen 2011-10-19 05:57:49 UTC
(In reply to comment #9)
> This is probably a permissions failure.  Could you run the command line script
> with the same user as the one who runs the web server?  Alternatively, see
> http://www.mediawiki.org/wiki/Extension:Maintenance_scripts

Could you elaborate what kind of permission failure this would be? As my shell user is the owner of the database file, and as far as I know (which isn't much) it's the only permission management with sqlite.
Comment 12 Mark A. Hershberger 2011-10-20 03:08:42 UTC
(In reply to comment #11)
> Could you elaborate what kind of permission failure this would be? As my shell
> user is the owner of the database file, and as far as I know (which isn't much)
> it's the only permission management with sqlite.

I was only saying that because it looked like the sort of problem I would run into when the file was owned by "www-data" (my web server user) and I ran as "mah".  If you own the DB file, then I don't think it is the permissions problem.
Comment 13 Sumana Harihareswara 2011-11-02 21:47:44 UTC
We discussed this bug in IRC today.  Max Semenik said, "I would love to see a repro for this bug...looks like the connection is getting closed somewhere."

DJ Bauch, whom I am now cc'ing on the bug, said, "I may try to reproduce since I probably face similar / same issues with MSSQL".  I'm asking him to reproduce this sometime in the next few days, since we want it fixed before the official MediaWiki 1.18.0 release.
Comment 14 Mark A. Hershberger 2011-11-02 22:53:48 UTC
I've tried several times to reproduce the problem tonight.  I don't think this is a problem with 1.18 and I couldn't reproduce it with 1.17.

I tried the running update.php after each of the following scenarios:

1.16 -> 1.17
1.17 -> add LQT from 1.17 branch
-> add LQT from svn
-> 1.18 with LQT from svn

My config for each of these tests:

$ dpkg -l php5-sqlite php5-cli
...
ii  libapache2-mod-php5            5.3.8-1~dotdeb.2               server-side, HTML-embedded scripting language (Apache 2 module)
ii  php5-cli                       5.3.8-1~dotdeb.2               command-line interpreter for the php5 scripting language
ii  php5-sqlite                    5.3.8-1~dotdeb.2               SQLite module for php5
Comment 15 Max Semenik 2012-12-17 16:39:48 UTC
Not enough information to reproduce.

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


Navigation
Links