[Solved] Log importer doesn't add anything in the DB

Hello,

I’ve re-installed Piwik from git.
The load importer says that logs were successfully imported but in my MySQL, there are nothing new.
No data were imported on widgets neither.
But when I add something from the dashboard like an user, it appears insde the database.

Is it me or just the log impoter that has problems ?
Thanks in advance

You should run the archive cron job:
http://piwik.org/docs/setup-auto-archiving/

TheYOSH

Hi,

I’ve installed and configured crontab, working well. But that didn’t fix the probleme.
There is no data at all in my db. The log importer doesn’t add anything in my DB, even the first time I run it


Logs import summary
-------------------

    456 requests imported successfully
    0 requests were downloads
    0 requests ignored:
        0 invalid log lines
        0 requests done by bots, search engines, ...
        0 HTTP errors
        0 HTTP redirects
        0 requests to static resources (css, js, ...)
        0 requests did not match any known site
        0 requests did not match any requested hostname

Website import summary
----------------------

    456 requests imported to 2 sites
        2 sites already existed
        0 sites were created:

    0 distinct hostnames did not match any existing site:



Performance summary
-------------------

    Total time: 1 seconds
    Requests imported per second: 430.48 requests per second


mysql> select * from piwik_log_action;
[b]Empty set[/b] (0.00 sec)
mysql> select * from piwik_site_url;
[b]Empty set [/b] (0.00 sec)
mysql> select * from piwik_log_visit;
[b]Empty set [/b] (0.00 sec)

And everywhere on the dashboard: Visitor Log There is no data for this report.

Do you think it can come from the Nginx conf file ?


 server {
 
 error_page 405 = $uri;
 error_page 403 = $uri;
 server_name piwik.myhost.gy;
 root /var/www/piwik/;
 index index.php;
 listen 80;
 allow all;
 access_log /var/www/piwik/log/access.log;
 error_log /var/www/piwik/log/error.log;

        location / {
                 try_files $uri /index.php;        
        }
 
        # Relay all index.php requests to fastcgi.

 location ~ \.php$ {
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          try_files $uri = 404;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME /var/www/piwik/index.php;
          include fastcgi_params;
 }


.

check your nginx server access logs + error logs ?

I get this when I try to import my log, 1st time I notice it to be honest:


"
2013/09/25 09:36:42 [error] 1924#0: *77 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Call to private method Piwik\Plugins\CoreVisualizations\Visualizations\Cloud::getCloudValues() from context '' in /var/www/piwik/plugins/CoreVisualizations/Visualizations/Cloud.php on line 71" while reading response header from upstream, client: ip, server: piwik.numer.gy, request: "POST /index.php?date=2013-09-24&module=VisitorInterest&action=getNumberOfVisitsPerVisitDuration&widget=1&idSite=1&period=day HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "piwik.numer.gy", referrer: "http://piwik.numer.gy/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday"

I think it’s just that the command I ran failed (log importer). It doesn’t happen every time.

Also:


cat /var/log/mysql/mysql.log | grep INSERT 
(10:56:02) Mergy:                    42 Prepare   INSERT INTO `piwik_option` (option_name, option_value, autoload)  VALUES (?, ?, ?)  ON DUPLICATE KEY UPDATE option_value = ?
(10:56:02) Mergy:                    42 Execute   INSERT INTO `piwik_option` (option_name, option_value, autoload)  VALUES ('InvalidatedOldReports_WebsiteIds', 'a:1:{i:0;s:1:\"1\";}', '0')  ON DUPLICATE KEY UPDATE option_value = 'a:1:{i:0;s:1:\"1\";}'

Also there are absolutly NO INSERT in database :frowning:
What I think: if the script is using the API and so uses Nginx to access to MySQL, the Nginx conf might block the call to the API.
Does anyone have a working nginx conf please?

I was right !!!


 server {
 
 error_page 405 = $uri;
 error_page 403 = $uri;
 server_name piwik.myhost.gy;
 root /var/www/piwik/;
 index index.php;
 listen 80;
 allow all;
 access_log /var/www/piwik/log/access.log;
 error_log /var/www/piwik/log/error.log;


 location /index.php {
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          try_files $uri = 404;
          fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME /var/www/piwik/index.php;
          include fastcgi_params;
 }
 location /piwik.php {
          fastcgi_pass unix:/var/run/php5-fpm.sock;
          try_files $uri = 404;
          fastcgi_index piwik.php;
          fastcgi_param SCRIPT_FILENAME /var/www/piwik/piwik.php;
          include fastcgi_params;
          }
 }


Just make sure your Nginx file doesn’t redirect everything to index.php otherwise the API is never called !!

Solved :smiley: