Hello,
I Have a fresh install from Piwik 1.8.4 on a Win Server 2008 with IIS 7.5.
Tried to import a logfile with the “import_logs.py” script, but failed with “Error when connecting to Piwik”.
D:\test\import_logs.py --debug --url=http://piwik.example/live/ iwd.201104.log --login=#### --password=#### --idsite=2 --recorders=1
2012-10-10 12:48:36,171: [DEBUG] Accepted hostnames: all
2012-10-10 12:48:36,171: [DEBUG] Piwik URL is: http://piwik.example.com/live/
2012-10-10 12:48:36,171: [DEBUG] No token-auth specified
2012-10-10 12:48:36,171: [DEBUG] Using credentials: (login = #####, password = #####)
2012-10-10 12:48:36,390: [DEBUG] Authentication token token_auth is: #####
2012-10-10 12:48:36,390: [DEBUG] Resolver: static
0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2012-10-10 12:48:36,592: [DEBUG] Launched recorder
Parsing log iwd.201104.log...
2012-10-10 12:48:36,592: [DEBUG] Detecting the log format
2012-10-10 12:48:36,592: [DEBUG] Format ncsa_extended does not match
2012-10-10 12:48:36,592: [DEBUG] Format iis does not match
2012-10-10 12:48:36,592: [DEBUG] Format common_complete does not match
2012-10-10 12:48:36,592: [DEBUG] Format common matches
4180 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
8308 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2012-10-10 12:48:38,967: [DEBUG] Error when connecting to Piwik: HTTP Error 404: Not Found
12245 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
16021 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2012-10-10 12:48:40,969: [DEBUG] Error when connecting to Piwik: HTTP Error 404: Not Found
19946 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
23333 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
2012-10-10 12:48:42,969: [DEBUG] Error when connecting to Piwik: HTTP Error 404: Not Found
Fatal error: Not Found
You can restart the import of "iwd.201104.log" from the point it failed by specifying --skip=0 on the command line.
here are the entries form the server log
2012-10-10 10:48:36 172.18.7.222 POST /live/ - 80 - 172.18.7.222 Python-urllib/2.7 200 0 0 203
2012-10-10 10:48:36 172.18.7.222 POST /live/ - 80 - 172.18.7.222 Python-urllib/2.7 200 0 0 203
2012-10-10 10:48:38 172.18.7.222 POST /live/piwik.php - 80 - 172.18.7.222 Python-urllib/2.7 404 0 2 0
2012-10-10 10:48:40 172.18.7.222 POST /live/piwik.php - 80 - 172.18.7.222 Python-urllib/2.7 404 0 2 0
2012-10-10 10:48:42 172.18.7.222 POST /live/piwik.php - 80 - 172.18.7.222 Python-urllib/2.7 404 0 2 0
it seems user “jay_haitch” have the same problem, see:
Forum Thread: import_logs.py fails contacting Piwik served from Nginx
so I changed line 764 of the “import_logs.py” script to "raise logging.debug(‘Error when connecting to Piwik: %s’, e)"
like “cyril” requested, here is the output:
2012-10-10 13:31:56,415: [DEBUG] Error when connecting to Piwik: HTTP Error 404:
Not Found
Exception in thread Thread-2:
Traceback (most recent call last):
File "C:\Py\lib\threading.py", line 551, in __bootstrap_inner
self.run()
File "C:\Py\lib\threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "D:\test\import_logs.py", line 968, in _run
self._record_hits(hits)
File "D:\test\import_logs.py", line 1049, in _record_hits
on_failure=self._on_tracking_failure
File "D:\test\import_logs.py", line 780, in call
data=data)
File "D:\test\import_logs.py", line 764, in _call_wrapper
raise logging.debug('Error when connecting to Piwik: %s', e)
TypeError: exceptions must be old-style classes or derived from BaseException, n
ot NoneType
14 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
sadly no change after manually adding the column “location_geoip_region” to the table “webstat_log_visit” as described in this post.
any help appreciated, please advice.