Piwik doesn't finish loading pages [SOLVED]


#1

Hey folks!

I have this peculiar issue that I’m not sure on how to debug. I installed Piwik on both my VPS and a wardrobe server, the latter having the following hardware specifications:

CPU: ARM-based 1.2 GHz network processor
Memory: 512 MB internal high-speed DDR-II RAM, running at 800 MHz
Network: 2 x Gigabit Ethernet interfaces

Both have Debian 6.0 installed and the issue here is that on the wardrobe server the pages stop loading (literally) halfway through, botching the CSS and not displaying all HTML elements. On the other hand, Wordpress runs just fine on that hardware.

I’m a rookie on this subject (well, subjects) and could use some friendly advice on where to look for more information.


(Matthieu Aubry) #2

Do you see any error in your webserver error log?


#3

Pardon the delay, I’ve been away for a while.

I checked the output of top while accessing and browsing Piwik on the server and it always rises to above 90 %.

/var/log/apache2/error.log output:


[Fri Sep 23 10:44:56 2011] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /xxx/www/piwik/libs/jsmin/jsmin.php on line 141, referer: http://www.xxx.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

I also get these JavaScript errors when visiting the website in Chrome:


SyntaxError: Unexpected identifier [xxx.com/piwik/index.php?module=Proxy&action=getJs&cb=f137110b795e7ee4efec72e0d265dab7:2]
ReferenceError: $ is not defined [xxx.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday:119]


#4

Also, the language selection menu is displayed as a native dropdown menu with a button entitled “go” next to it rather than the subtle default design (which looks like a plain link).


#5

Alright I’ve tried to pinpoint the error but no success so far…

... Maximum execution time of 30 seconds exceeded in /xxx/www/piwik/libs/jsmin/jsmin.php on line 141 ...

This points to the following with the specific line in bold:

protected function get() {
    $c = $this->lookAhead;
    $this->lookAhead = null;
    if ($c === null) {
        if ($this->inputIndex < $this->inputLength) {
            [b]$c = substr($this->input, $this->inputIndex, 1);[/b]
            $this->inputIndex += 1;
        } else {
            $c = null;
        }
    }
    if ($c === "\r") {
        return "\n";
    }
    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
        return $c;
    }
    return ' ';
}

Google tells me this script is a “JavaScript Minifier”, sadly I can’t claim to understand JavaScript but possibly this is a bug. I have downloaded and reinstalled Piwik several times now with the same result.


(vipsoft) #6

The minifier is taking too long and your server has a max_execution limit. In your config/config.ini.php, add the following:


[Debug]
disable_merged_assets = 1

This is normally used for debugging, but it’s the only quick fix I can propose at this time.


#7

Thank you, adding that line did the trick. Piwik runs smoothly and I haven’t noticed anything else acting up. All my packages (Debian Squeeze) seem to be up to date as well. I’d happily provide more information if it helps figuring out this… oddity.


(Matthieu Aubry) #8

For reference, here is the FAQ: Troubleshooting - Analytics Platform - Matomo


#9

Oops. Sorry. I skimmed through that earlier but didn’t connect the dots.

I set the max timeout in php.ini to 300 instead of 30 (and removed the disable_merged_asset line in Piwik) and now it works! Very cool, thanks!