I have a sporadic but recurring serious error with Sasson. I have the "regenerate every page request" option checked in the theme options, and every few hours SassParser goes crazy for a short while and fires ten-of-thousands of parse errors per second into the 'watchdog' table:

message
%type: !message in %function (line %line of %file).

longblob
a:6:{s:5:"%type";s:6:"Notice";s:8:"!message";s:34:"Uninitialized string offset: 32282";s:9:"%function";s:24:"SassParser->scss2Token()";s:5:"%file";s:86:"/data/drupal7/sites/samaritans/site/sites/all/themes/sasson/phamlp/sass/SassParser.php";s:5:"%line";i:696;s:14:"severity_level";i:5;}

There is nothing invalid with my SCSS files, and no clear trigger for what causes this. It just seems to happen 2-3 times a day, with the site returning a 500 error (unsurprisingly) each time this happens for about a 10-20 minute period.

Using drush to clear all caches has no apparent effect. It just seems to steady itself and go back to parsing the SCSS file successfully again after you've left it alone for a while.

Apologies for the poor report, but I've had several of my senior Drupal developers and a couple of IT people look at it, and we simply can't define what's causing this problem. I'm reasonably sure it's related to me working on the SCSS file and it regenerating every request, but beyond that I can't determine what the problem is.

NB: This may be related to a similar issue raised by a colleague in April.

Comments

tsi’s picture

Status: Active » Postponed (maintainer needs more info)

What do you mean by "regenerate every page request" ?
1. 'Development mode - unminified output and FireSass support.' or
2. 'Rebuild theme registry on every page request.'
Are we talking about a production site ? if we do, then both of them should be off.

Anyway, my best suggestion is to update to the current dev branch, there was some serious development happening there, and some of it has to do with re-compilation of Sass files.
Please report back if that doesn't help.

markedup’s picture

What do you mean by "regenerate every page request" ?

In the Sasson theme options; my SCSS file is being regenerated every page request.

tsi’s picture

Category: bug » support

The point is that there is no such option (there used to be) in theme settings.
You can force re-compilation from your .info file but not from theme settings.

markedup’s picture

I'm not sure I understand you. If I go to Appearance > Theme Name > SASS / SCSS settings there is a checkbox for recompiling at every request, which I have ticked.

Is this not what you mean? (As noted, I'm using the latest stable release.)

tsi’s picture

You're right, I'm truly sorry for confusing you. I was looking at the dev branch and this option was changed there for better performance while developing.

I have just now pushed a change to the dev branch with some debugging options to force re-compilation of Sass files, so now you have:
Production mode (Dev mode off) - outputs minimal css so it is lighter and faster.
Dev mode - will output more readable css and have firesass support, Sass files are recompiled only when modified or when cache is cleared.
Debugging - All Sass files are recompiled on every single page request.

markedup’s picture

Status: Postponed (maintainer needs more info) » Active

I think I've determined what is causing the problem, and it is indeed a syntax error. My apologies for insisting otherwise.

However, the error is so slight that I wasn't able to find it easily. Simply missing a bracket somewhere within a rule is enough to trigger the problem in Development mode with continuous recompilation enabled.

Whilst this isn't strictly a Sasson issue, I still think it is unacceptable for a theme to generate ~80,000 'watchdog' errors in a couple of seconds simply because of an extremely simplistic and light syntax error. Being able to crash a server because of a missing curly brace seems ridiculous.

Is there any way of making error reporting less... nihilistic? Could it be limited to a single error instance, rather than panicking and firing off tens-of-thousands of database writes a second? (Why does one very basic error need to be reported ~80,000 times?!)

mint5auce’s picture

I've just had this issue today. 15,000 watchdog entries in the space of a couple of minutes bought my server down.

I'm guessing I also have a syntax error somewhere, but not only is the 'hosing' of the watchdog table unhelpful, there is not enough detail in the error message to give me any idea where to start looking.

tsi’s picture

Version: 7.x-2.4 » 7.x-2.x-dev
Category: support » bug

This wasn't easy to reproduce but I believe we've found it.
Please test it with the latest dev version so we can make sure this is fixed.

mint5auce’s picture

Early indications are that this has fixed it.

I've just updated sasson on from 2.1 to dev, after encountering the watchdog issue (107K entries!). After a restart and clear cache my site came back up, with two entries in the log file, rather than thousands.

The messages could still do with work however, I've no idea where the syntax issue is in the file (not sure if this is Sasson, Sass, or Compass at fault though).

tsi’s picture

Status: Active » Fixed

This error looping was solved in all of my tests, error reporting is a whole different story.
Sasson v3.x is using the Original compass compiler by default which handles this kind of stuff much better.
Please re-open if you can still reproduce this issue

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit a032597 on 7.x-2.x, compasscompile, 7.x-3.x, PHPSass, 7.x-3.x-Assetic, 7.x-3.x-susy by tsi:
    Issue #1676760 by markedup, mint5auce - SassParser randomly hosing '...