@ajtrichards opened this issue on December 20th 2014

I'm new to using Piwik and i'm only wanting to import log files.

I've followed the instructions and used the code:

python /var/www/html/piwik/misc/log-analytics/import_logs.py --recorders=4 --idsite=1 --url=SITE_URL test.log

I then get an error:

Traceback (most recent call last): File "/var/www/html/piwik/misc/log-analytics/import_logs.py", line 1748, in resolver = config.get_resolver() File "/var/www/html/piwik/misc/log-analytics/import_logs.py", line 650, in get_resolver return StaticResolver(self.options.site_id) File "/var/www/html/piwik/misc/log-analytics/import_logs.py", line 991, in init 'SitesManager.getSiteFromId', idSite=self.site_id File "/var/www/html/piwik/misc/log-analytics/import_logs.py", line 974, in call_api return cls._call_wrapper(cls._call_api, None, None, method, **kwargs) File "/var/www/html/piwik/misc/log-analytics/import_logs.py", line 963, in _call_wrapper raise Piwik.Error(message) __main__.Error: Piwik returned an invalid response:

What then seems to be the invalid response is the HTML from the login area of my web app.

Have I configured something incorrectly?

I created a test log file with only the following entries:

10.248.0.0 - - [20/Dec/2014:06:26:24 +0000] "GET /status.php HTTP/1.1" 200 12 "-" "Amazon Route 53 Health Check Service; ref:fae2ffba-bb58-4ee4-b07d-b44e74abeecc" 10.238.0.0 - - [20/Dec/2014:06:26:25 +0000] "GET /status.php HTTP/1.1" 200 12 "-" "Amazon Route 53 Health Check Service; ref:fae2ffba-bb58-4ee4-b07d-b44e74abeecc" 10.248.0.0 - - [20/Dec/2014:06:26:26 +0000] "GET /status.php HTTP/1.1" 200 12 "-" "Amazon Route 53 Health Check Service; ref:fae2ffba-bb58-4ee4-b07d-b44e74abeecc" 10.238.0.0 - - [20/Dec/2014:06:26:27 +0000] "GET /status.php HTTP/1.1" 200 12 "-" "Amazon Route 53 Health Check Service; ref:fae2ffba-bb58-4ee4-b07d-b44e74abeecc" 10.248.0.0 - - [20/Dec/2014:06:26:27 +0000] "GET /status.php HTTP/1.1" 200 12 "-" "ELB-HealthChecker/1.0"

@tsteur commented on December 22nd 2014

Try to specify a token_auth parameter when executing the log importer like this: --token-auth=32characterLongApiKey. You should probably specify the token_auth of a user with super user access. In case you are a super user in your Piwik installation just go to "Piwik => your username top right => API". Maybe it works then. Otherwise maybe check your server logs re redirects.

@diosmosis commented on December 27th 2014

@ajtrichards Are you using the URL to your website in --url? It should be the URL to your Piwik instance.

@ajtrichards commented on December 29th 2014

Yes i was putting the website URL instead of the Piwik instance. Wasn't really clear from the documentation.

This issue was closed on December 29th 2014
Powered by GitHub Issue Mirror