@anonymous-piwik-user opened this issue on November 29th 2013

Hi, the import_logs.py returns error when the apache log first line looks like:

default.example.com:443 212.149.41.43 - - [29/Nov/2013:00:00:03 +0100] "-" 408 1600 "-" "-"

The returned error is:

Traceback (most recent call last):
  File "/data/domains/piwik.avn.cz/http/misc/log-analytics/import_logs.py", line 1575, in <module>
    main()
  File "/data/domains/piwik.avn.cz/http/misc/log-analytics/import_logs.py", line 1539, in main
    parser.parse(filename)
  File "/data/domains/piwik.avn.cz/http/misc/log-analytics/import_logs.py", line 1390, in parse
    format = self.detect_format(file)
  File "/data/domains/piwik.avn.cz/http/misc/log-analytics/import_logs.py", line 1349, in detect_format
    logging.debug('Format %s is the best match', format.name)
AttributeError: 'NoneType' object has no attribute 'name'

Looks that piwik expects more in the url field (here just "-") during parsing than apache is able to offer in such lines :-)

While a quick fix is to move any offending lines beyond a "good" line, this is not easily automated (like on Bug#4230).

Keywords: ImportLog

@mattab commented on December 26th 2013

This should be fixed in the latest Piwik, if not please reopen with an example log file (complete log file) so we can reproduce

This issue was closed on January 6th 2014
Powered by GitHub Issue Mirror