./import_logs.py not working. __main__.Error: The HTTP server returned a redirect error that would lead to an infinite loop. The last 30x error message was: Found


#1

Hi Trying to run import_logs.py

./import_logs.py --idsite=3 --url=www.example.com /path/to/log/files/access_log-20141027

And I get the following error:
Traceback (most recent call last):
File “./import_logs.fix.py”, line 1763, in
resolver = config.get_resolver()
File “./import_logs.fix.py”, line 659, in get_resolver
return StaticResolver(self.options.site_id)
File “./import_logs.fix.py”, line 999, in init
’SitesManager.getSiteFromId’, idSite=self.site_id
File “./import_logs.fix.py”, line 981, in call_api
return cls._call_wrapper(cls._call_api, None, None, method, **kwargs)
File “./import_logs.fix.py”, line 970, in _call_wrapper
raise Piwik.Error(message)
main.Error: The HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
Found

Log files look like this:
172.22.4.110 - - [26/Oct/2014:08:04:21 -0400] “GET /index.php?w1=UserCTL/ProfileMaintenanceCTL HTTP/1.1” 200 6080 “-” “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1 WhiteHat Security”

I searched this forum for a similar HTTP error and didn’t find it.

#uname -a
Linux host.example.com 2.6.32-504.el6.x86_64 #1 SMP Tue Sep 16 01:56:35 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
#python
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Anyone know what’s wrong here?


#2

One more thing.

Piwik 2.10.0


(Matthieu Aubry) #3

–url should point to your Piwik URL


#4

Thanks for the info. I tried what you said and now I get:

./import_logs.py --idsite=3 --url=piwikserver.company.com /path/to/log/files/access_log-20141027

Traceback (most recent call last):
File “./import_logs.2.py”, line 1748, in
resolver = config.get_resolver()
File “./import_logs.2.py”, line 650, in get_resolver
return StaticResolver(self.options.site_id)
File “./import_logs.2.py”, line 991, in init
’SitesManager.getSiteFromId’, idSite=self.site_id
File “./import_logs.2.py”, line 974, in call_api
return cls._call_wrapper(cls._call_api, None, None, method, **kwargs)
File “./import_logs.2.py”, line 963, in _call_wrapper
raise Piwik.Error(message)
main.Error: Not Found


#5

I’ve read other posts which pointed to a possible issue with Redhat 6 and PHP under version 2.7.

Is this still an issue with the latest Piwik?


(Matthieu Aubry) #6

Not sure what’s wrong, it works for us. If you open the URL directly with “lynx” for example do you see Piwik?