XF 2.0 Repeated server errors

djbaxter

in memoriam 1947-2022
I keep getting these but I don't understand what's causing them:

Code:
Server error log

    Less_Exception_Parser: Expected ')' got 'P' in anonymous-file-0.less src/vendor/oyejorge/less.php/lib/Less/Parser.php:2793

    Generated by: Unknown account Dec 20, 2018 at 2:46 PM

Stack trace

#0 src/vendor/oyejorge/less.php/lib/Less/Parser.php(942): Less_Parser->Error('Expected ')' go...')
#1 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2387): Less_Parser->expectChar(')')
#2 src/vendor/oyejorge/less.php/lib/Less/Parser.php(858): Less_Parser->parseSub()
#3 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2541): Less_Parser->MatchFuncs(Array)
#4 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2401): Less_Parser->parseOperand()
#5 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2440): Less_Parser->parseMultiplication()
#6 src/vendor/oyejorge/less.php/lib/Less/Parser.php(858): Less_Parser->parseAddition()
#7 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2565): Less_Parser->MatchFuncs(Array)
#8 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2362): Less_Parser->parseExpression()
#9 src/vendor/oyejorge/less.php/lib/Less/Parser.php(858): Less_Parser->parseValue()
#10 src/vendor/oyejorge/less.php/lib/Less/Parser.php(2062): Less_Parser->MatchFuncs(Array)
#11 src/vendor/oyejorge/less.php/lib/Less/Parser.php(858): Less_Parser->parseRule()
#12 src/vendor/oyejorge/less.php/lib/Less/Parser.php(1009): Less_Parser->MatchFuncs(Array)
#13 src/vendor/oyejorge/less.php/lib/Less/Parser.php(674): Less_Parser->parsePrimary()
#14 src/vendor/oyejorge/less.php/lib/Less/Parser.php(621): Less_Parser->GetRules(NULL)
#15 src/vendor/oyejorge/less.php/lib/Less/Parser.php(449): Less_Parser->_parse()
#16 src/XF/CssRenderer.php(363): Less_Parser->parse('// Note that th...')
#17 src/XF/CssRenderer.php(311): XF\CssRenderer->renderToCss('public:xfmg_med...', '// Note that th...')
#18 src/XF/CssRenderer.php(235): XF\CssRenderer->renderTemplate('public:xfmg_med...', NULL)
#19 src/XF/CssRenderer.php(101): XF\CssRenderer->renderTemplates(Array, Array, Array)
#20 src/XF/CssWriter.php(53): XF\CssRenderer->render(Array)
#21 css.php(30): XF\CssWriter->run(Array, 3, 1, 'dbf106493bcdbb7...')
#22 {main}

Request state

array(4) {
  ["url"] => string(340) "/forum/css.php?css=public%3Aeditor.less%2Cpublic%3Akl_em_froala_image.less%2Cpublic%3Amessage.less%2Cpublic%3Arating_stars.less%2Cpublic%3Arellect_favicon.less%2Cpublic%3Ashare_controls.less%2Cpublic%3Axfmg_media_list.less%2Cpublic%3Axfmg_media_view.less%2Cpublic%3Aextra.less&s=3&l=1&d=1545272151&k=dbf106493bcdbb71ff13ed740793dac1911c5031"
  ["referrer"] => string(94) "https://www.holisticactions.com/forum/media/toshi-and-tater-with-santa-and-juju-on-the-side.1/"
  ["_GET"] => array(5) {
    ["css"] => string(223) "public:editor.less,public:kl_em_froala_image.less,public:message.less,public:rating_stars.less,public:rellect_favicon.less,public:share_controls.less,public:xfmg_media_list.less,public:xfmg_media_view.less,public:extra.less"
    ["s"] => string(1) "3"
    ["l"] => string(1) "1"
    ["d"] => string(10) "1545272151"
    ["k"] => string(40) "dbf106493bcdbb71ff13ed740793dac1911c5031"
  }
  ["_POST"] => array(0) {
  }
}

This is a new forum with posts converted from BBPress (so there may be some HTML or bad bbcode in the previous posts) and the Xenforo Media add-on newly added. I think the errors started appearing when the Media addon was installed.
 
It does appear to be falling over on an XFMG template, but obviously that's not something we can reproduce or have had reported elsewhere, so I'm wondering if another add-on is involved (it mentions an XFMG template, but it could be another add-on modifying that template).

So there's a few things to check:

Do you get the error logged every time you view a media item? (if so, that's actually good as it means it can be reliably reproduced)

If you disable all add-ons except XFMG and view a media item, does the error still get logged?

If you use the XF default style (which can be recreated by creating a new style with no parent) does the error still get logged?
 
@Chris D

Haven't tried all of your suggestions yet but here's something that is reproducible.

Right now, there is only one image in the Media addon.

I cleared all errors from the Admin log.
Clicked on Media and viewed the thumbnail - nor errors.
Clicked on the thumbnail to view the full version - got this error on the main forum page as well as the same error nin the admin server errors list:

190990

190991

So it seems pretty clear that the error is triggered by trying to view the full image.
 
Absolutely expected (and hoped) that to be the case.

Now it’s reliably reproducible, if we can rule out other add-ons or the style then we can go from there.
 
If I switch to the default style, two things change:

  1. No errors.
  2. Clicking the thumbnail to view the full image shows a muich smaller image than with the PixelExit style.
 
It suggests then that it's an issue in one of the templates that belongs to the style. This would be a bug in the style or a mistake you've made when changing the template.

It seems to be in the xfmg_media_view.less template and the error suggests you might be missing a bracket somewhere.
 
@Russ from Pixel Exit found the problem.

First, I set up the child style incorrectly. I must have been overtired because instead of creating the child style from the parent I re-imported the style again as a parent, which ended up modifying a LOT of templates.

Second, the main problem was this setting I had changed in the custom style:

I set this to 999999px:

BB code elements -> Maximum expandable BB code block height reverting that appears to fix the problem and makes the error go away.

That setting was suggested to me elsewhere on the Xenforo forum so that the full text of a quoted post was displayed, rather than the default part quote with an "expand" link.

Is there a better way to do this?
 
Back
Top Bottom