Last modified: 2014-04-22 19:01:09 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 T46949, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 44949 - no upload possible when mysql database contains a "." in its name, due to 'Swift and S3 restrictions'
no upload possible when mysql database contains a "." in its name, due to 'Sw...
Status: NEW
Product: MediaWiki
Classification: Unclassified
Uploading (Other open bugs)
1.20.x
All Linux
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-13 12:44 UTC by keyler
Modified: 2014-04-22 19:01 UTC (History)
4 users (show)

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


Attachments

Description keyler 2013-02-13 12:44:45 UTC
I recently upgraded a couple of internal wikis from mw1.16.5 directly to mw1.20.2.
Everything was working when I noticed that uploads were not working anymore. As I already knew I had to correct the rights in the Linux directories so thatthe upload would be working again (images direectory). As always this helped and the uploading was working again. 
But on one wiki it did not help. After looking into the problem for a couple of hours I changed the mysql database name by coincidence from "w.wiki1" to "test-wiki". Suddenly the uploading was working again. I then found out that as soon es there is a "." in the database name uploading would stop working. The "." was not a problem in 1.16.5.
For me this is resolved as I won't use a "." in database names any more but I still wanted to point out the problem.
Comment 1 keyler 2013-02-13 12:47:23 UTC
MediaWiki: 1.20.2
PHP: 5.3.10-1ubuntu3.5 (apache2handler)
MySQL: 5.5.29-0ubuntu0.12.04.1
Ubuntu: 12.04
Comment 2 Andre Klapper 2013-02-18 13:34:30 UTC
How exactly do you upload? via Special:Upload, or via the UploadWizard extension?
Comment 3 Alex Monk 2013-02-18 14:49:28 UTC
This is in the MediaWiki product, so it must be Special:Upload.
Comment 4 keyler 2013-02-18 15:39:51 UTC
I disabled all extensions for this test. And yes "Special:Upload".
Comment 5 keyler 2013-02-26 12:33:21 UTC
Was someone of the devs able to reproduce this problem?
Comment 6 Andre Klapper 2013-02-27 23:37:51 UTC
Sorry, nobody has tried yet.
Providing the exact database error here would be welcome (see
http://www.mediawiki.org/wiki/Manual:How_to_debug ).
Comment 7 keyler 2013-02-28 11:56:39 UTC
Hmm, that's sad. It is very easy to reproduce as one just has to rename the database name of the wiki (inkluding a "." dot in the name). From then on the upload will not work anymore in MW.1.20.2.
Comment 8 Elliott Eggleston 2013-09-04 04:10:37 UTC
I can reproduce this bug, and it's not actually a database error.  FileBackendStore::isValidContainerName rejects container names with periods because of 'Swift and S3 restrictions'.

The container name is prepended with the wikiId in FileBackendStore::FullContainerName.  

So it seems like db names that break this regex for any reason will break uploads: /^[a-z0-9][a-z0-9-_]{0,199}$/i

I'll see where else this full container name is used, and what sort of transformation we might be able to apply that would avoid breaking S3/Swift storage but not cause wiki.db to overlap with wikidb or wiki_db.
Comment 9 Andre Klapper 2013-09-04 09:20:42 UTC
Thanks for investigating!
Comment 10 Elliott Eggleston 2013-09-04 12:24:59 UTC
My pleasure!  I'm new here, so I'm not sure where to propose the following fix:  

For the FSFileBackend backend (local filesystem), it seems like container names are only ever used as hash keys to look up local directories.  So we take the 'final' off isValidContainerName and override it in FSFileBackend to allow most anything.  Then in the FileBackend constructor, we call isValidContainerName on the wikiId and throw an exception if false.  It would be nice to also add a more informative error message suggesting the user set a legal wikiId in LocalSettings.php -> $wgFileBackends
Comment 11 Aaron Schulz 2014-04-22 19:01:09 UTC
(In reply to Elliott Eggleston from comment #10)
> My pleasure!  I'm new here, so I'm not sure where to propose the following
> fix:  
> 
> For the FSFileBackend backend (local filesystem), it seems like container
> names are only ever used as hash keys to look up local directories. 

Not if basePath is set, which is preferred.

Maybe the solution is to support some container name encoding. The FileRepo config could have it's URLs adjusted by the admin to compensate.

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


Navigation
Links