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

Cannot Import Log Files #6885

Closed
ajtrichards opened this issue Dec 20, 2014 · 3 comments
Closed

Cannot Import Log Files #6885

ajtrichards opened this issue Dec 20, 2014 · 3 comments
Labels
worksforme The issue cannot be reproduced and things work as intended.

Comments

@ajtrichards
Copy link

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

tsteur commented Dec 22, 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
Copy link
Member

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

@ajtrichards
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
worksforme The issue cannot be reproduced and things work as intended.
Projects
None yet
Development

No branches or pull requests

4 participants