Can't display weekly and mothly stats


(maxhb) #1

Hi!
After updating Piwik to Version 0.2.37 it is not possible to view stats by week, month or on a yearly basis.

Daily stats work like a charm.

Updating to version 0.4.0 did not solve the problem (as I hoped).

Any idea what causes this problem? Anyone else limited to daily stats?

PHP version: 5.2.0
MySQL version: 4.1.19

Regards
maxhb


(vipsoft) #2

check your php memory limit


(maxhb) #3

memory_limit is set to 128MB. Is this still not enough?!

CU
maxhb

P.S.: Even changing this value to 512Mb does not change anything…


(vipsoft) #4

What exactly do you see when you switch the period to week/month/year? (A screenshot might be helpful.)

Make sure you’re looking at the right php.ini file. On my system, there’s one for Apache and another for the CLI (shell).

Check your Apache error.log file and see if there’s an indication of the problem.

Use the default config/global.ini.php; if you customized it, move your overrides to config/config.ini.php.

Use the API and see try some queries for various periods and date ranges.


(maxhb) #5

[quote=vipsoft @ Jun 15 2009, 06:10 PM) <{POST_SNAPBACK}>

What exactly do you see when you switch the period to week/month/year? (A screenshot might be helpful.)

It’s just that it shows 0 visits, 0 actions, 0 total time spent by visitors in “overview with graph”. All other widgets show “no data for this table”.
QUOTE (vipsoft @ Jun 15 2009, 06:10 PM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=2860)
Make sure you're looking at the right php.ini file. On my system, there's one for Apache and another for the CLI (shell).
All memory settings are as explained before, I know there are different php.ini files and how to handle them.
QUOTE (vipsoft @ Jun 15 2009, 06:10 PM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=2860)
Check your Apache error.log file and see if there's an indication of the problem.
I can't find any piwik related errors in my log file.
QUOTE (vipsoft @ Jun 15 2009, 06:10 PM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=2860)
Use the default config/global.ini.php; if you customized it, move your overrides to config/config.ini.php.
I did not fiddle with the global.ini.php it's just the original version.
QUOTE (vipsoft @ Jun 15 2009, 06:10 PM]Use the API and see try some queries for various periods and date ranges.[/quote] Could you please give me some hints on how to do so?

Thanks for your support, hoping for another useful hint.

CU
maxhb


(vipsoft) #6

The absence of errors is perplexing.

Can you query your archive tables and see if it’s still archiving all periods?

SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=1;
SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=2;
SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=3;

SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=1;
SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=2;
SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=3;

If there aren’t any 2’s and 3’s, it isn’t archiving. Something in log_visits?

From your Dashboard, click on the API link (near the top left). Go to VisitsSummary.get and select a format (e.g., XML). Edit the URL in your address bar, changing the site ID, period, date range, and token_auth, as needed. Example:

http://localhost/index.php?module=API&method=VisitsSummary.get&idSite=1&period=week&date=2009-01-01,2009-06-15&format=Html&token_auth=anonymous

Try date ranges before the upgrade, after the upgrade, short ranges, long ranges, etc. Are there date ranges that return no data when it should? Can you narrow it down to any particular days?


(maxhb) #7

Hi vipsoft,
thanks for your support1

[quote=vipsoft @ Jun 15 2009, 09:56 PM) <{POST_SNAPBACK}>

The absence of errors is perplexing.

Yes, that’s really annoying since I can’t find any obvious problems…
QUOTE (vipsoft @ Jun 15 2009, 09:56 PM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=2866)
Can you query your archive tables and see if it's still archiving all periods?
The results of your query are:
SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=1
union
SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=2
union
SELECT COUNT(period) FROM piwik_archive_blob_2009_06 WHERE period=3;

COUNT(period)
3462
541
176

SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=1
union
SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=2
union
SELECT COUNT(period) FROM piwik_archive_numeric_2009_06 WHERE period=3;

COUNT(period)
1719
140
20

Looks like piwik is fetching data…

QUOTE (vipsoft @ Jun 15 2009, 09:56 PM) [<{POST_SNAPBACK}>](index.php?act=findpost&pid=2866)
If there aren't any 2's and 3's, it isn't archiving. Something in log_visits?
Querying the log_visit table with the following query gives me results for every single day since installing piwik:
SELECT visit_server_date, count(*) FROM `piwik_log_visit` group by visit_server_date
QUOTE (vipsoft @ Jun 15 2009, 09:56 PM]From your Dashboard, click on the API link (near the top left). Go to VisitsSummary.get and select a format (e.g., XML). Edit the URL in your address bar, changing the site ID, period, date range, and token_auth, as needed.[/quote] I tried various dates but the result is the same in every situation: As soon as I query weekly/monthly results there is no data returned.

For example:

Daily query.
http://host/index.php?module=API&method=VisitsSummary.get&idSite=1&period=day&date=2009-06-01&format=xml&token_auth=anonymous

<result>
<max_actions>15</max_actions>
<nb_uniq_visitors>14</nb_uniq_visitors>
<nb_visits>16</nb_visits>
<nb_actions>58</nb_actions>
<sum_visit_length>3513</sum_visit_length>
<bounce_count>6</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
</result>

and

Weekly query:
http://host/index.php?module=API&method=VisitsSummary.get&idSite=1&period=week&date=2009-06-01&format=xml&token_auth=anonymous

<result>
<max_actions>0</max_actions>
<nb_uniq_visitors>0</nb_uniq_visitors>
<nb_visits>0</nb_visits>
<nb_actions>0</nb_actions>
<sum_visit_length>0</sum_visit_length>
<bounce_count>0</bounce_count>
<nb_visits_converted>0</nb_visits_converted>
</result>

Strange side effect: Querying VisitsSummary.get crashes my Firefox after fiddling with the parameters (nearly 100% CPU time).

Anything else I could do to help to nartrow down the possible problems?

CU
maxh


(vipsoft) #8

Bizarre. Have you tried installing Piwik in a fresh directory instead of overwriting an existing one?

Can you create a user with view access and send an email to us at hello (at) piwik.org?


(maxhb) #9

[quote=vipsoft @ Jun 16 2009, 07:26 PM) <{POST_SNAPBACK}>

Bizarre. Have you tried installing Piwik in a fresh directory instead of overwriting an existing one?

I am not sure about that because a colleague of mine did the initial install - will ask him asap.
QUOTE (vipsoft @ Jun 16 2009, 07:26 PM]Can you create a user with view access and send an email to us at hello (at) piwik.org?[/quote] Created an account and mailed you username and password.

Thanks for your friendly help
maxhb


(maxhb) #10

Hi!
Some further experiments showed a strange bevavior:

Transferring the complete installation from my online server to my dev enviroment and deleting all piwik_archive_* tables successfully triggered recreation of archive data. Weekly, monthly and yearly stats are now displayed correctly in dev enviroment.

Deleteing and recreating those tables on online server did NOT work.

All piwik_archive_* tables with date1 <> date2 will show exactly 0 visits.

Dev-Server: Debian, PHP 5.2.6, mySQL 5.0.32
Online Server: FreeBSD, PHP 5.2.0, mySQL 4.1.19

Any ideas?
maxbh


(vipsoft) #11

Are you able to upgrade php on your bsd box?

We don’t have any logging in upgradephp.php but it would be informative to see what functions are missing from your php 5.2.0 build. (For example, we know json_encode isn’t 100% compatiblr with the built-in.)

Let us know if you learn anymore.


(maxhb) #12

Hi!
just stumbled over the Zend Framework requirements - maybe piwik requirements should be adjusted accordingly

A.1.1. PHP Version
Zend recommends the most current release of PHP for critical security and performance enhancements, and currently supports PHP 5.2.4 or later.

CU
maxbh

P.S.: My config/global.ini.php say:

; PHP minimum required version (minimum requirement known to date = ->newInstanceArgs)
minimum_php_version = 5.1.3


(vipsoft) #13

Re: Zend & PHP versions. We’ll cross that bridge when we update ZF to 1.8.x. (We’re still using a customized ZF 1.0.)

Not being a MySQL guru, I’ll naively ask, is there an easy way to see if the archive tables created on your dev and online servers are different?


(maxhb) #14

[quote=vipsoft @ Jun 27 2009, 10:18 PM]function Piwik_Query( $sqlQuery, $parameters = array())
{
if(stristr($query,‘insert into piwik_archive_numeric’)) {
// This part comes from memory, it may contain typos :wink:
$msg = Zend_Registry::get(‘db’)->quoteInto( $sqlQuery, $parameters);
error_log ($msg, 3, “/tmp/piwik.log”);
}
return Zend_Registry::get(‘db’)->query( $sqlQuery, $parameters);
}[/quote]
Unfortunately quoteInto() does not resolve the query parameters correctly - looks like this method can handle only scalar parameters, not arrays.

Is there a suitable method to generate the sql queries created by quer()?

Regards
maxhb


(maxhb) #15

Problem solved!
After upgrading PHP to version 5.2.10 everything works fine.

CU
maxhb

P.S.: This may resolve bug ticket 811: http://dev.piwik.org/trac/ticket/811


(vipsoft) #16

Thanks Marc. I wish we knew why… we have to decide whether or not to increase the php version reqt (5.1.3).


(burlysac) #17

Please see this newer related issue … it seems that this issue wasn’t resolved?

13471