Widgets or even the whole Dashboard doesn't load

Hello.

I’m having weird problems with PIWIK 3.2.0. I’m guessing it’s server-configuration related, but I just don’t know anymore.
I’m using a cPanel-based hosting. I’ve installed PIWIK 3.0 (I think) through Softcoulous (sp) and have updated every version since through the 1-click update option within PIWIK.
I’m using PHP 7.1.11, with apcu and opcache. Apache 2.4.29. MariaDB 10.0.33. On linux 3.10.0-614.10.2.lve1.4.50.el7.x86_64.

The main problem is that when viewing the Dashboard either the dashboard doesn’t load fully, either all or most widgets show error: “Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again.”, or I get no widgets and just the “Please check your server configuration. You may want to whitelist „*.html“ files from the „plugins“ directory.”

Other symptoms are as follows:

  • No PHP errors are generated
  • In the cPanel Errors I get “client denied by server configuration: /home/user/public_html/piwik/index.php, referer: site/piwik/index.php?module=CoreHome&action=index&idSite=3&period=day&date=yesterday”
  • Requests to individual widgets like “site/piwik/index.php?module=Proxy&action=getCss&cb=bdb556a8b7bc6adea5b9b5ac23bfe2b4” ends up returning in 403 errors.
  • But if I visit the url of an individual 403’d widget, it will load up just fine.
  • When I directly visit site/piwik/index.php?date=2017-11-13&module=API&method=Live.getCounters&format=json&lastMinutes=3&idSite=3&period=day, I get: {“result”:“error”,“message”:“You can’t access this resource as it requires ‘view’ access for the website id = 3.”}

I’ve tried:

  • All the pertinent suggestions at piwik .org/faq/troubleshooting/#faq_18485. The dashboard.directive.html loads the same on my server as it does on that page.
  • I’ve tried all 5 steps at piwik .org/faq/troubleshooting/faq_148/
  • I’ve removed .htaccess from /public_html/
  • I’ve removed PHP modules apcu and opcache
  • I don’t use ad blockers
  • I’ve tried different browsers, and have cleared cache and cookies.

Other info:

  • PIWIK is installed in /public_html/piwik, but I have another web app installed on root (/public_html/) called PrestaShop. Could this be an issue?
  • I get 403 errors, if I remove the .htaccess from root. If I leave the .htaccess file on root, I will get 404 errors instead.
  • Still… I have removed .htaccess from root and I’ve gotten the same problem. Do I need to clear cache in apache or something, after I modify .htaccess?
  • When I load the site.com/piwik login screen and check the network requests in DevTools, I see that some of the requests generate the 403 error. Upon closer inspection I’ve seen that the response header includes “powered-by:PrestaShop”.

EDIT:

  • Another thing crossed my mind… I think my hosting service is limiting requests in quick succession. I’ve noticed similar problems on Prestashop as well. When I make many requests in quick succession, the first few will go through alright, the rest will throw 403 or 404.
    This would explain how I can view the individual widgets, but not the whole dashboard of widgets.
  • Is there a more “static” version of the dashboard? Or: can I somehow tell PIWIK to load one widget at a time?

Could .htaccess on root be problematic? The whole .htaccess file:

<IfModule mod_rewrite.c>
RewriteEngine On

# force HTTPS redirect
RewriteCond %{HTTP_HOST} www\. [NC,OR]
RewriteCond %{HTTPS} !on
RewriteRule (.*) "https\:\/\/site\.com%{REQUEST_URI}" [R=301,L,NC]
</IfModule>

<IfModule mod_headers.c>
# HSTS preloading
Header set Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" env=HTTPS
</IfModule>

# ~~start~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again
# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

<IfModule mod_rewrite.c>
<IfModule mod_env.c>
SetEnv HTTP_MOD_REWRITE On
</IfModule>


# Disable Multiviews
Options -Multiviews

RewriteEngine on

#Domain: site .com
RewriteRule . - [E=REWRITEBASE:/]
RewriteRule ^api$ api/ [L]

RewriteRule ^api/(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]

# Images
RewriteRule ^([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$1$2$3.jpg [L]
RewriteRule ^([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$1$2$3$4.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$1$2$3$4$5.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg [L]
RewriteRule ^([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg [L]
RewriteRule ^c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2$3.jpg [L]
RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]
# AlphaImageLoader for IE and fancybox
RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]

# Dispatcher
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ %{ENV:REWRITEBASE}index.php [NC,L]
</IfModule>

AddType application/vnd.ms-fontobject .eot
AddType font/ttf .ttf
AddType font/otf .otf
AddType application/font-woff .woff
AddType font/woff2 .woff2
<IfModule mod_headers.c>
	<FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|svg)$">
		Header set Access-Control-Allow-Origin "*"
	</FilesMatch>
</IfModule>

<IfModule mod_expires.c>
	ExpiresActive On
	ExpiresByType image/gif "access plus 1 month"
	ExpiresByType image/jpeg "access plus 1 month"
	ExpiresByType image/png "access plus 1 month"
	ExpiresByType text/css "access plus 1 week"
	ExpiresByType text/javascript "access plus 1 week"
	ExpiresByType application/javascript "access plus 1 week"
	ExpiresByType application/x-javascript "access plus 1 week"
	ExpiresByType image/x-icon "access plus 1 year"
	ExpiresByType image/svg+xml "access plus 1 year"
	ExpiresByType image/vnd.microsoft.icon "access plus 1 year"
	ExpiresByType application/font-woff "access plus 1 year"
	ExpiresByType application/x-font-woff "access plus 1 year"
	ExpiresByType font/woff2 "access plus 1 year"
	ExpiresByType application/vnd.ms-fontobject "access plus 1 year"
	ExpiresByType font/opentype "access plus 1 year"
	ExpiresByType font/ttf "access plus 1 year"
	ExpiresByType font/otf "access plus 1 year"
	ExpiresByType application/x-font-ttf "access plus 1 year"
	ExpiresByType application/x-font-otf "access plus 1 year"
</IfModule>

<IfModule mod_headers.c>
    Header unset Etag
</IfModule>
FileETag none
<IfModule mod_deflate.c>
    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript font/ttf application/x-font-ttf font/otf application/x-font-otf font/opentype image/svg+xml
    </IfModule>
</IfModule>

#If rewrite mod isn't enabled
ErrorDocument 404 /index.php?controller=404

# ~~end~~ Do not remove this comment, Prestashop will keep automatically the code outside this comment when .htaccess will be generated again

Hi,

I don’t have much time at the moment, but it reminds me of this issue:

I think it is definitely possible that a request by piwik gets rewritten by the .htaccess and then points to PrestaShop.

Thank you for finding that issue, I will go through it now.

I’ve also updated the OP with the following info:

  • Another thing crossed my mind… I think my hosting service is limiting requests in quick succession. I’ve noticed similar problems on Prestashop as well. When I make many requests in quick succession, the first few will go through alright, the rest will throw 403 or 404.
    This would explain how I can view the individual widgets, but not the whole dashboard of widgets.
  • Is there a more “static” version of the dashboard? Or: can I somehow tell PIWIK to load one widget at a time?

Hi,

I hope this doesn’t happen this way. Because otherwise Piwik and most other software will be pretty useless.
Every visit of a website tracked by piwik sends a request with the data to piwik, so if many requests will fail you can’t reliably track a website.