Topic on Project:Support desk

Upload File not working with Oracle

6
Summary by Ciencia Al Poder
200.49.85.195 (talkcontribs)

After we try to upload an image, mediawiki says that the image doesn't exists (Spanish message: "No existe ningún archivo con este nombre, pero puedes subirlo. "), but we can find the file in the server file system.

The file list special page, does not shows any results. The IMAGE table is empty. The UPLOADSTASH table has several rows like this:

62 1 12gj3imwf6ns.ik9b4y.1.png /tmp/localcopy_c7c5f0e99b18-1.png mwrepo://local/temp/5/59/20140723151607!localcopy_c7c5f0e99b18-1.png file 23/07/2014 03:16:07,000000000 PM -03:00 finished 10424 80i9wcke3o13ipvgr1hhgctj3ilflxk image/png BITMAP 687 327 8 (BLOB)

Another info MediaWiki 1.22.3 PHP 5.3.2-1ubuntu4.23 (apache2handler) Oracle 11.2.0.3.0

Ciencia Al Poder (talkcontribs)

The message you get is MediaWiki:filepage-nofile-link: No file by this name exists, but you can [$1 upload it].

Well, if the image table is empty, then the error is correct: Your MediaWiki installation doesn't have any file uploaded yet.

The Manual:uploadstash table is a temporary table to track unfinished uploads (those uploads that threw a warning to the user, so they're still on hold).

Try uploading the file again, and if it fails, you should post here what error message are you getting on upload.

200.49.85.195 (talkcontribs)

I've tried to upload the file several times (also different files), no error message after that, just the message "No file by this name exists, but you can [$1 upload it].".
As I said, I can find the file in the file system (i.e images/2/22/Screenshot_merge.png), so the file gets uploaded after all, but mediawiki has not register of that happening.
In apache error.log I can see somthing like:

[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:37 2014] [error] [client 192.168.215.31] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png
[Wed Jul 23 12:35:38 2014] [error] [client 192.168.215.31] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/includes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php?title=Especial:SubirArchivo&wpDestFile=Screenshot_merge.png

But I also have errors like this on pages that are working well:

[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:52 2014] [error] [client 192.168.215.35] PHP Warning:  substr() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1142, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
[Mon Jul 21 10:40:53 2014] [error] [client 192.168.215.35] PHP Warning:  strpos() expects parameter 1 to be string, object given in /var/www/mediawiki/in
cludes/db/DatabaseOracle.php on line 1146, referer: http://192.168.215.204/mediawiki/index.php/Servidores_de_Integraci%C3%B3n
Ciencia Al Poder (talkcontribs)

I've looked at those lines and I don't see anything wrong there, despite the fact that somewhere an object is being passed to strpos instead of a string. I haven't seen this error before, so maybe you're using some MediaWiki extension that's not compatible with the MediaWiki version you're running? You could try disabling all extensions.

Anyway, 1.22 has released new security updates, so you should upgrade to latest 1.22.x to see if that fixes your issue.

Ciencia Al Poder (talkcontribs)

I've just gone ahead and reported on bugzilla myself. It's on bug 68874. Please create an account there if you don't have one and add yourself as CC of that bug in case someone requests more information.

Ciencia Al Poder (talkcontribs)

Apparently, Oracle is not supported on recent versions of MediaWiki, albeit appearing as being one of the options, so I recommend you to use another Database engine for MediaWiki :(

Reply to "Upload File not working with Oracle"