Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import_logs.py fails to detect log type when url field contains "-" #4359

Closed
anonymous-matomo-user opened this issue Nov 29, 2013 · 1 comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Milestone

Comments

@anonymous-matomo-user
Copy link

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
Copy link
Member

mattab commented Dec 26, 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

@anonymous-matomo-user anonymous-matomo-user added this to the 2.0.3 - Piwik 2.0.3 milestone Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

2 participants