Help with importing logs

Hi.

I’m a bit new to Piwik and I’m trying to import a log to my localhost server using the ‘import_logs.py’ and I continue to receive the same error:

Traceback (most recent call last):
File “/var/www/piwik/misc/log-analytics/import_logs.py”, line 1718, in
config = Configuration()
File “/var/www/piwik/misc/log-analytics/import_logs.py”, line 570, in init
self._parse_args(self._create_parser())
File “/var/www/piwik/misc/log-analytics/import_logs.py”, line 560, in _parse_args
self.options.piwik_token_auth = self._get_token_auth()
File “/var/www/piwik/misc/log-analytics/import_logs.py”, line 613, in _get_token_auth
credentials = open(filename, ‘r’).readline()
IOError: [Errno 2] No such file or directory: ‘/var/www/piwik/tmp/cache/token.php’

Can anybody help me?

Thank you in advance :slight_smile:

Can you add -ddd to the command used, and then paste full command used and output (After removing any TOKEN_AUTH= ) here?

appears to be something with the config.ini.php - on update it’s missing the superuser section per my diff
i added back the superuser section, but that’s still yielding the same error
please advise… still messing around with it - might just rerun the installer

2014-03-09 22:24:30,769: [DEBUG] Accepted hostnames: all
2014-03-09 22:24:30,770: [DEBUG] Piwik URL is: http://192.168.0.1/piwik/
2014-03-09 22:24:30,770: [DEBUG] No token-auth specified
2014-03-09 22:24:30,770: [DEBUG] No credentials specified, reading them from "/var/www/html/piwik/config/config.ini.php"
Traceback (most recent call last):
File “/var/www/html/piwik/misc/log-analytics/import_logs.py”, line 1724, in
config = Configuration()
File “/var/www/html/piwik/misc/log-analytics/import_logs.py”, line 576, in init
self._parse_args(self._create_parser())
File “/var/www/html/piwik/misc/log-analytics/import_logs.py”, line 566, in _parse_args
self.options.piwik_token_auth = self._get_token_auth()
File “/var/www/html/piwik/misc/log-analytics/import_logs.py”, line 619, in _get_token_auth
credentials = open(filename, ‘r’).readline()
IOError: [Errno 2] No such file or directory: ‘/var/www/html/piwik/tmp/cache/token.php’

ahh… looks like it’s just perms - previously it could be run as any user and it seems now it cannot - i guess it now needs to write something to the install dir, so you need to run as root or the web owner

Hello everyone.

Thank you in advance for the help. Apparently it has something to do with this new version of Piwik. I removed the new version, installed an old one, and everything worked like a charm.

Perhaps this new version of Piwik needs to be ‘tuned’ in some aspects, specially this one.

But once again, thank you so kindly for your help.

Best regards,

Yakare

if you do not have token auth, please add two parameters, --login --password, following with import_logs.py. they are users which could login the piwik.

Luty

Thanks for the feedback, but what is the correct syntax for the addition.

just add --login piwik --password abcd

or --login=piwik --password=abcd

this is not clear.

Also what do you mean by token auth. My piwik user has sudo rights. Is this something that needs to b generated?

Thanks
Lawrence