Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All websites html rendering fails with many websites #3715

Closed
anonymous-matomo-user opened this issue Jan 28, 2013 · 5 comments
Closed

All websites html rendering fails with many websites #3715

anonymous-matomo-user opened this issue Jan 28, 2013 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. worksforme The issue cannot be reproduced and things work as intended.
Milestone

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

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
Copy link
Member

mattab commented Feb 7, 2013

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
Copy link
Member

mattab commented Mar 3, 2013

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

@mattab
Copy link
Member

mattab commented Mar 22, 2013

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
Copy link
Member

mattab commented Jan 10, 2014

This was fixed in 2.0

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

2 participants