@anonymous-piwik-user opened this Issue on January 28th 2013

Hello,

I have 500+ (and growing over time) websites with long urls and names (important fact). Since a few days ago I cannot view the "all websites" page anymore - it returns a empty result.
I've done some debugging and managed to see that its a Smarty related issue. Specifically with the MultiSites/templates/index.tpl template file. Even more specifically, the following code (shortened to be readable):
{foreach from=$sitesData key=i item=site}
allSites[{$i}] = new setRowData({$site.idsite}, ...
{/foreach}
The failure is due to the output size. If I change the code into:
{foreach from=$sitesData key=i item=site}
all[{$i}] = set({$site.idsite}, ...
{/foreach}
Then it works. The difference being, I removed some characters, making the output smaller.
I believe it is a Smarty issue, perhaps related to my php configuration. However, I am unfamiliar with Smarty and don't know how to debug it further.

Please assist and instruct.

Kind regards,
Mati Skiba

@anonymous-piwik-user commented on January 29th 2013

My issue seems similar to Mati's, and I want to give more specifics about how to reproduce and fix. First, some general info:

OS: RHEL 5.9
Piwik: 1.10.1
Total Sites in piwik: 791
Tracking Method: Javascript
Archive Method: Hourly cron
PHP: 5.3.3
Relevant PHP settings:
max_execution_time = 30
max_input_time = 60
memory_limit = 512M
display_errors = On
error_reporting = E_ALL & ~E_NOTICE
log_errors = On

Problem: All Websites link returns blank page after only 1-3 seconds. None of the solutions offered by matt and others in the forum to similar reports worked for me. My PHP settings are ideal. No errors ever appear on the page nor in apache error logs. Just a blank page.

Reproduce:

  1. After creating a test user with access to only 300 of the 791 sites, All Websites works. So I began adding sites to the test user one-by-one (yes, it took a while), each time loading All Websites, until I arrived at the number of sites which caused All Websites to return blank. That number for me was 745.
  2. In order to be sure it wasn't due to some funny data related to a single site, I tested making the 745th site in test user's access list different sites. It didn't matter what site it was, adding a 745th site to test user's access always caused All Websites to break.
  3. But 745 seems like such a random number to cause issues within the application, plus the fact that other reports of issues with All Websites claim all sorts of numbers of sites, even some with success into thousands of sites. So the issue must not be the number of sites, but some other limit being reached, which for me is triggered at the 745th site.
  4. That limit probably has something to do with the length of data in the array being created in MultiSites/templates/index.tpl, because after trying every possible modification of the array, I found that replacing either $site.name or $site.main_url for each element of the array with a smaller value, like $site.idsite, I could exceed 745 sites and load All Websites fine.

So my temporary fix is to change either the 5th or 6th paramater to the setRowData call to $site.idsite (instead of $site.name or $site.main_url) on line 13 of index.tpl. Now I can load All Websites fine with any number of sites, in my case all my 791 sites, even though I lose either the site's name or url on the page. This agrees with Mati's findings above that reducing the size of data in the allSites array fixes the All Websites blank page issue.

Total length of piwik.p_site.name for all 791 sites:15307
Total length of piwik.p_site.main_url for all 791 sites: 25372

Let me know if any other data would be helpful.

@mattab commented on February 7th 2013 Owner

Can you please contact me at matt@piwik.org as I would like to investigate this issue. PLease update to1.10.1 prior and contact me!

@mattab commented on March 3rd 2013 Owner

please give more information about the bug so we can help (contact me and Id be happy to fix this bug!)

@mattab commented on March 22nd 2013 Owner

A blank page, have you tried "View source" to check if it's really blank page? otherwise a blank page should really log some kind of errors.

If you install piwik in a new database, then if you copy the "site" table with your 800 sites into this new Piwik DB, canyou replicate the issue?

If so, send me the "site" table dump and ill try reproduce on my Piwik and fix the bug. thx!

@mattab commented on January 10th 2014 Owner

This was fixed in 2.0

This Issue was closed on January 10th 2014
Powered by GitHub Issue Mirror