#3822 closed Bug (fixed)

Import_Logs.py - MySQL error when trying to import logs out of date sequence

Reported by: John.Deery Owned by: mattab
Priority: major Milestone: 1.12 - The Great 1.x Backlog
Component: Core Keywords: import_logs.py, time_spent_ref_action
Cc: Sensitive: no

Description

When using the import_logs.py script to import IIS logs (may happen for others, but haven't tested) the following occurs:

Import a log file from 2010-03-01 : No problem
run archive.php : No Problem
Import a log file from 2010-03-03 : No Problem
run archive.php : No Problem
Import an IIS log file from 2010-03-02:

0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
 Parsing log G:\IISLOGS\W3SVC1908953133\ex110302.log...
1600 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
1600 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
1600 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
1600 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current)
Fatal error: Error query: SQLSTATE[01000]: Warning: 1264 Out of range value for column 'time_spent_ref_action' at row 1
 In query: INSERT  INTO piwik_log_link_visit_action (idvisit, idsite, idvisitor, server_time, idaction_url, idaction_name, idaction_url_ref, idaction_name_ref, time_spent_ref_action) VALUES (?,?,?,?,?,?,?,?,?)
Parameters: array (
  0 => '240716',
  1 => 1,
  2 => 'J|
You can restart the import of "G:\IISLOGS\W3SVC1908953133\ex110302.log" from the point it failed by specifying --skip=0 on the command line.

A similar issue occurs when trying to restart a failed log import (canceled out of import, run archive, then try to re-import) with the same error on 'time_spent_ref_action', but not sure if this is related to the same part in the script.

Change History (1)

comment:1 Changed 13 months ago by matt (mattab)

  • Owner set to mattab
  • Resolution set to fixed
  • Status changed from new to closed

In 575f1af34d0e3335ba32b085fc5fcf8735ee60ce:

fixes #3822
Simple fix for this ticket, by setting to 0 any negative time

Note: See TracTickets for help on using tickets.