Last modified: 2006-07-12 02:06:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 6618 - PHP warning on Special:Lockdb from attempting to write to non-existent uploads directory.
PHP warning on Special:Lockdb from attempting to write to non-existent upload...
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
All All
: Low minor (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2006-07-10 08:26 UTC by Nick Jenkins
Modified: 2006-07-12 02:06 UTC (History)
0 users

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


Description Nick Jenkins 2006-07-10 08:26:02 UTC
Use case:

0) Wiki is a fresh SVN checkout.
1) User has privs to use Special:Lockdb
2) User goes to SpecialLockdb (e.g. )
3) A reason is entered, and the confirmation checkbox is ticked, and the "Lock
Database" button is clicked.

For me with error_reporting(E_ALL) enabled, and have a fresh SVN checkout, the
result is a HTML page containing this PHP warning:

<b>Warning</b>:  fopen(/var/www/hosts/mediawiki/phase3/upload/lock_yBgMBwiR) [<a
href='function.fopen'>function.fopen</a>]: failed to open stream: No such file
or directory in
<b>/var/www/hosts/mediawiki/phase3/includes/SpecialLockdb.php</b> on line
<b>95</b><br />

and page that says :
Internal error
Could not find file "/var/www/hosts/mediawiki/phase3/upload/lock_yBgMBwiR".

I know that this isn't the most user-facing bit of code, but nevertheless, could
we maybe please add in something like this code from Special:Upload before
writing to this file:
                /** Check if the image directory is writeable, this is a common
mistake */
                if ( !is_writeable( $wgUploadDirectory ) ) {
                        $wgOut->addWikiText( wfMsg(
'upload_directory_read_only', $wgUploadDirectory ) );

Also is it possible to perhaps create the default "wgUploadDirectory" (usually
"wiki/upload") during installation? (assuming this isn't already being done)
Comment 1 Rob Church 2006-07-10 08:57:42 UTC
Addressed in SVN trunk, r15490. Er, the default is wiki/images, no? And that's
checked out with the rest of the code. If it's not, then creating the default
would require write permissions on the directory's parent, which may not be
forthcoming, or wise.

Comment 2 Nick Jenkins 2006-07-12 02:06:16 UTC
> Addressed in SVN trunk, r15490.

Thank you! 

> Er, the default is wiki/images, no?

Yes, but it's set to an invalid value (wiki/upload) before that, which
proprogates through to $wgReadOnlyFile, which causes the request to be for

However, rather than muddy the waters between this and that (since they're
really two different things), to keep it separate I've logged it as Bug 6639 and
explained what I think the problem is - but if I've made a mistake in my
assumptions in that other bug please feel free to close it and mark it as
"INVALID: stupid user error" ;-)

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