1

Trying to import my webserver's log-files using import_logs.py results in the error:

hostname X doesn't match Y.

It retries to import the data but eventually gives up. The URL is set properly to the web-address (a https-subdomain without proper certificate) of the matomo-installation. The hostname "X" is the hostname of the host the installation is running, so this is fine. The other hostname (let's say to discriminate this one from the other by using the variable "Y") is a strange one and cannot be found in any of my config scripts of the matomo installation. It resembles the tld of that of hostname "X" but with an other subdomain.

Using python version 2.7.15. On my other installation using python version 2.7.6 that error is not experienced.

  • So what are X and Y? – Patrick Mevzek May 25 '18 at 14:58
  • X is any hostname different to the hostname Y. – dr0i May 28 '18 at 7:33
  • Hm. The hostnames are just really arbitrary. What would it help to write them down? What striked me however was the fact that hostname Y wasn't configured anywhere in the installation (as it turned out it was the hostname of the wrongly used SSL certificate. – dr0i May 28 '18 at 7:42
  • Which is your correct host name? X or Y? Is the incorrect one found in the log file? – Stephen Ostermiller May 28 '18 at 7:57
  • @stephen-ostermiller I updated my question to make clear that "X" is the correct one. – dr0i May 28 '18 at 8:31
1

Figured out that this is a SSL verification issue. Older python versions don't validate ssl certificates at all, thus the one matomo instance was working fine and the other not. The exception is aurllib2.URLError and the cause is a SSL-verification. To bypass this one could simply start the script like this:

PYTHONHTTPSVERIFY=0 python matomo/misc/log-analytics/import_logs.py.

But as @patrick-mevzek stated correctly this workaround might someday not work, so the solution is to ultimately fix the SSL problems eventually by getting a valid certificate.

  • 1
    Never bypass TLS checks like that. This is the wrong way to do it even if it solves your problem right now. – Patrick Mevzek May 25 '18 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.