Css not working on Piwik 2.2


#1

Hello,

I have a problem with version 2.2. After installing, application does not load styles.
I try to solve it adding these lines to config.ini.php:

[Debug]
disable_merged_assets = 1

I also tried to solve it restarting website an application pool and reinstalling but it did not work.
When I use Firefox developer tool I can see a message that says:“the stylesheet can not be loaded”

Can anybody help me with this problem?

Thank you.


(Matthieu Aubry) #2

When I use Firefox developer tool I can see a message that says:“the stylesheet can not be loaded”

do you see any error in your error log files, such as 403 errors?

maybe the server does not serve the CSS files because of a htaccess rule or something else?


#3

Check this topic and the topic referred inside if you’re using nginx: 301 Moved Permanently


#4

No, I have no 403 errors in server logs.

I´m using Arvixe hosting to host piwik (windows hosting). I’ve been using two years without problems until today.
If I do a system check (from Piwik menu) everything is ok and if I create a new website on the server and try to do a clean installation, the error is the same.


(Matthieu Aubry) #5

if you can, look with “Firefox developer tool” to see what is returned instead of the CSS file. The request is something like …&action=getCss…

Maybe the output of this request will contain an error message?


#6

I put these lines in config.ini.php file:
[b][log]
log_writers[] = file
logger_file_path = tmp/logs/piwik.log

[Tracker]
debug = 1[/b]

and the error is the next one:
ERROR Proxy[2014-04-29 17:47:59] {hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php(141): Warning - substr_compare(): The start position cannot exceed initial string length.

I see in bug tracker that error fixed (#4948) and is going to be included on version 2.3.0 but, anybody knows what I need to change in the function to get it solved in my piwik installation?

Thank you.


#7

I put these lines in config.ini.php file:
[b][log]
log_writers[] = file
logger_file_path = tmp/logs/piwik.log

[Tracker]
debug = 1[/b]

and the error is the next one:
ERROR Proxy[2014-04-29 17:47:59] {hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php(141): Warning - substr_compare(): The start position cannot exceed initial string length.

I see in bug tracker the error and is fixed (#4948) and is going to be included on version 2.3.0 but, anybody knows what I need to change in the function to get it solved in my piwik installation?

Thank you.


#8

Sorry, I applied the patch but it did not work.
This is the full message: (I change the first part of the paths with {hiddendir})

ERROR Proxy[] {hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php(141): Warning - substr_compare(): The start position cannot exceed initial string length
#0 Piwik\Error::errorHandler(…) called at [:]
#1 substr_compare(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php:141]
#2 Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger->countDirectoriesInPathToRoot(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php:105]
#3 Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger->rewriteCssPathsDirectives(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php:90]
#4 Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger->processFileContent(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:111]
#5 Piwik\AssetManager\UIAssetMerger->concatenateAssets(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:99]
#6 Piwik\AssetManager\UIAssetMerger->getConcatenatedAssets(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger\StylesheetUIAssetMerger.php:60]
#7 Piwik\AssetManager\UIAssetMerger\StylesheetUIAssetMerger->generateCacheBuster(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:192]
#8 Piwik\AssetManager\UIAssetMerger->getCacheBusterValue(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:155]
#9 Piwik\AssetManager\UIAssetMerger->isFileUpToDate(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:143]
#10 Piwik\AssetManager\UIAssetMerger->shouldGenerate(…) called at [{hiddendir}\wwwroot\core\AssetManager\UIAssetMerger.php:51]
#11 Piwik\AssetManager\UIAssetMerger->generateFile(…) called at [{hiddendir}\wwwroot\core\AssetManager.php:169]
#12 Piwik\AssetManager->getMergedStylesheet(…) called at [{hiddendir}\wwwroot\plugins\Proxy\Controller.php:36]
#13 Piwik\Plugins\Proxy\Controller->getCss(…) called at [:]
#14 call_user_func_array(…) called at [{hiddendir}\wwwroot\core\FrontController.php:505]
#15 Piwik\FrontController->doDispatch(…) called at [{hiddendir}\wwwroot\core\FrontController.php:85]
#16 Piwik\FrontController->dispatch(…) called at [{hiddendir}\wwwroot\core\dispatch.php:34]
#17 require_once(…) called at [{hiddendir}\wwwroot\index.php:47]


(Matthieu Aubry) #9

did you try this patch: Follows up 9cc59e84a1819 -> path separator has 2 bytes on windows, so… · matomo-org/matomo@148b391 · GitHub ?

What version of PHP are you using? maybe you’re experiencing this bug: Incompatibility with PHP 5.5.11 due to bug in this php version · Issue #5060 · matomo-org/matomo · GitHub


#10

Yes, I’ve tried the patch but it did not work.
PHP version is 5.5.4. The problem with substr_compare is also in this php version?


(Matthieu Aubry) #11

Try this patch, I think this will fix your issue: Refs #5060 Remove use of substr_compare as it's buggy in 5.5.11 with … · matomo-org/matomo@f7f5296 · GitHub


#12

Yes! The patch solves the problem!!!
Thank you very much for your help Matt.