Log-analytics/import_logs.py returns 403

Running the import script produces the following output:


$/path/to/misc/log-analytics/import_logs.py --url=https://www.mysite.com/ /path/to/var/log/apache/access.log --idsite=1 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots --debug
14-04-11 13:13:47,367: [DEBUG] Accepted hostnames: all
2014-04-11 13:13:47,368: [DEBUG] Piwik URL is: https://www.mysite.com/
2014-04-11 13:13:47,368: [DEBUG] No token-auth specified
2014-04-11 13:13:47,368: [DEBUG] No credentials specified, reading them from "/path/to/config.ini.php"
2014-04-11 13:13:47,526: [DEBUG] Authentication token token_auth is: [REDACTED]
2014-04-11 13:13:47,527: [DEBUG] Resolver: static
2014-04-11 13:13:47,544: [DEBUG] Error when connecting to Piwik: HTTP Error 403: Forbidden
2014-04-11 13:13:49,560: [DEBUG] Error when connecting to Piwik: HTTP Error 403: Forbidden
2014-04-11 13:13:51,574: [DEBUG] Error when connecting to Piwik: HTTP Error 403: Forbidden

I have double checked the auth token with the Piwik web interface, it is correct.

After a week of trying to get Piwik installed with the javascript tracker (and getting
the same error), I decided to use the log importer as a cron job instead. This
narrows down the problem, no?

Any suggestions?

It looks like Piwik returns a 403 error. Piwik does not return 403 errors in the sourcecode, therefore this is a server misconfiguration. Please check your logs why your server returns 403 when the API is being called. hope it helps?