Page MenuHomePhabricator

Upload a new version of image causes an internal error
Closed, ResolvedPublic

Description

Author: jburos

Description:
We see an internal error when uploading a new version of certain files, in particular for files that are documents -- word, pdf, ppt, etc. I have not yet noticed the error when replacing an existing file of image type.

An example of one such error message is:

Could not rename file "public/6/63/Wikidocsearchresults_9.xls" to "public/archive/6/63/20080301151006!Wikidocsearchresults_9.xls".

Though the precise path changes according to the wiki installation that causes the error.

Some comments:

  • we do not have "public" in our path
  • we have set the following in our LocalSettings.php: $wgUploadPath = "$wgScriptPath/images"; $wgUploadDirectory = "$IP/images";
  • we do not have php's safe_mode or open_basedir enabled
  • we have no /images/ aliases in apache2 conf files
  • in some cases, the paths which display are quite long and bizarre
  • most other files and images can be replaced without error
  • the files in question can be replaced using ./maintenance/importImage.php --overwrite

Version info is as follows:

  • MediaWiki: 1.11.0
  • PHP: 5.1.2 (apache2handler)
  • MySQL: 5.0.22-Debian_0ubuntu6.06.6-log

Version: 1.11.x
Severity: normal
OS: Linux
Platform: Other
URL: http://www.wikidoc.org

Details

Reference
bz13210

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:05 PM
bzimport set Reference to bz13210.
bzimport added a subscriber: Unknown Object (MLST).

Check the directory and file ownership and privileges. It's fairly likely that you have a mix of different file owners, particularly if you've been using command-line scripts to do file imports.

jburos wrote:

File/directory permissions are the same for all files (system user, 777) though the user is not our apache2 user -- something we did to simplify file synchronization among servers in our cluster. Once I changed this the problem was solved.

For some reason I thought the path was incorrect, but clearly not.

Thanks for your help!