Object of class Blob could not be converted to string
Closed, ResolvedPublic

Description

Author: joshua

Description:
Trying to create or run a math page results in a 500 page error. looking in apache log you see

PHP Catchable fatal error: Object of class Blob could not be converted to string in /var/www/rnd-wiki/extensions/Math/MathRenderer.php on line 162.

Database is Postgresql
Server is Ubuntu 64bit


Version: REL1_21-branch
Severity: critical

bzimport added a project: Math.Via ConduitNov 22 2014, 2:07 AM
bzimport added a subscriber: Unknown Object (MLST).
bzimport set Reference to bz50235.
bzimport created this task.Via LegacyJun 26 2013, 2:06 PM
bzimport added a comment.Via ConduitJun 26 2013, 2:10 PM

physik wrote:

I'll have a look at this problem, which version of Postgresql do you use?

bzimport added a comment.Via ConduitJun 26 2013, 2:19 PM

joshua wrote:

9.1.9

i'd be happy to do a join.me or something like that to let you look into it

Installed software

Product Version
MediaWiki 1.21.1
PHP 5.4.9-4ubuntu2.1 (apache2handler)
PostgreSQL 9.1.9
BlueSpice for MediaWiki 1.21.0

bzimport added a comment.Via ConduitJun 26 2013, 2:23 PM

joshua wrote:

(In reply to comment #1)

I'll have a look at this problem, which version of Postgresql do you use?

9.1.9

i'd be happy to do a join.me or something like that to let you look into it

Installed software

Product Version
MediaWiki 1.21.1
PHP 5.4.9-4ubuntu2.1 (apache2handler)
PostgreSQL 9.1.9
BlueSpice for MediaWiki 1.21.0

bzimport added a comment.Via ConduitJun 26 2013, 5:33 PM

physik wrote:

Hi,

a quick fix is to uncomment this line, since it only prints out debug output.
I'll try to get a postgresql instance to submit a proper fix.

Best
Physikerwelt

bzimport added a comment.Via ConduitJun 26 2013, 5:48 PM

joshua wrote:

its not commented for me
wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . $this->getInputHash() . ')\n' );

bzimport added a comment.Via ConduitJun 26 2013, 5:53 PM

joshua wrote:

now im getting

Failed to parse (PNG conversion failed; check for correct installation of latex and dvipng (or dvips + gs + convert)): s_k

bzimport added a comment.Via ConduitJun 26 2013, 5:54 PM

physik wrote:

sorry I mean comment it out, i.e.
// wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:'
. $this->getInputHash() . ')\n' );

a real fix could be to replace the line by
wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . var_export( $this->getInputHash() , false ) . ')\n' );

bzimport added a comment.Via ConduitJun 26 2013, 6:02 PM

physik wrote:

(In reply to comment #6)

now im getting

Failed to parse (PNG conversion failed; check for correct installation of
latex
and dvipng (or dvips + gs + convert)): s_k

Ok this is quite normal if you have not installed latex and dvipng.
You can try out MathML rendering which does not require Latex to be installed
by setting

$wgUseLaTeXML = true; enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;
setting LaTeXML as default rendering option (optional)

in the LocalSettings.php file.
See
http://www.mediawiki.org/wiki/Extension:Math
for more information.

bzimport added a comment.Via ConduitJun 26 2013, 6:12 PM

joshua wrote:

tried that and its still coming up with the same error someone said in the render.ml they had to define the absolute path of latex and dvipng.

do you know these?

bzimport added a comment.Via ConduitJun 26 2013, 6:14 PM

physik wrote:

I probably can not fix the original bug. In the latest version the debug output is

wfDebugLog( "Math", 'store entry for $' . $this->tex . '$ in database (hash:' . $this->hash . ')\n' );

this should not cause problems since it is a text field.

So the general solution would be to update to the latest version.

bzimport added a comment.Via ConduitJun 26 2013, 6:17 PM

joshua wrote:

i am at the latest stable version

bzimport added a comment.Via ConduitJun 26 2013, 6:18 PM

physik wrote:

I know it's a little bit hard to fix errors, since the page is cached and the cache stores the errors as well.
So if you change something in the config, you have to add ?action=purge to the url in order to trigger another run of the math extension code.

bzimport added a comment.Via ConduitJun 26 2013, 6:21 PM

physik wrote:

Yes. I know. Maybe there should be a new release since that version is 4 month old.

bzimport added a comment.Via ConduitJun 26 2013, 6:30 PM

physik wrote:

(In reply to comment #8)

(In reply to comment #6)
> now im getting
>
>
> Failed to parse (PNG conversion failed; check for correct installation of
> latex
> and dvipng (or dvips + gs + convert)): s_k

Ok this is quite normal if you have not installed latex and dvipng.
You can try out MathML rendering which does not require Latex to be installed
by setting

$wgUseLaTeXML = true; enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;
setting LaTeXML as
default
rendering option (optional)

in the LocalSettings.php file.
See
http://www.mediawiki.org/wiki/Extension:Math
for more information.

does that work for you?

bzimport added a comment.Via ConduitJun 26 2013, 6:34 PM

joshua wrote:

nope

this is what i have

require_once("$IP/extensions/Math/Math.php");
$wgTmpDirectory = "$wgScriptPath/images/tmp";
$wgTexvc = '/var/www/rnd-wiki/extensions/Math/math/texvc';
$wgUseLaTeXML = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;

bzimport added a comment.Via ConduitJun 26 2013, 6:39 PM

joshua wrote:

in my apache error log you see

Use of undefined constant MW_MATH_LATEXML - assumed 'MW_MATH_LATEXML'

bzimport added a comment.Via ConduitJun 26 2013, 6:43 PM

physik wrote:

oh sorry my fault.

This only works with the current master branch
if you use git try

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/Math.git
git checkout master

in that case this config should be sufficient

require_once("$IP/extensions/Math/Math.php");
$wgTmpDirectory = "$wgScriptPath/images/tmp";
$wgTexvc = '/var/www/rnd-wiki/extensions/Math/math/texvc';
$wgUseLaTeXML = true; // enabeling MathJax as rendering option
$wgDefaultUserOptions['math'] = MW_MATH_LATEXML;

bzimport added a comment.Via ConduitJun 26 2013, 7:00 PM

joshua wrote:

Failed to parse (LaTeXML MathML is invalid XML.): C_{f_q}

bzimport added a comment.Via ConduitJun 26 2013, 7:07 PM

physik wrote:

ok. yet another problem. This is because the a dependency to a newer version of the core.

You can update your core version to the master version as well by
git checkout master in the mediawiki root dir, or uncomment the xml check in
MathLaTeXML.php line 204

 	/**
	 * Checks if the input is valid MathML,
	 * and if the root element has the name math
	 * @param string $XML
	 * @return boolean
	 */

static public function isValidMathML( $XML ) {

just add return true; there.

duplicatebug added a comment.Via ConduitJun 27 2013, 6:00 PM

See gerrit 60987 for the blob fix

bzimport added a comment.Via ConduitAug 27 2013, 2:06 PM

sumanah wrote:

Since the change has been merged, can we close this bug as resolved?

bzimport added a comment.Via ConduitSep 6 2013, 5:39 PM

physik wrote:

I think so.

Add Comment