Error When Connecting To Piwik Urlopen Error
Sign in Pricing Blog Support Search GitHub This repository Watch 325 Star 6,164 Fork 1,080 piwik/piwik Code Issues 1,373 Pull requests 21 Projects 0 Wiki Pulse Graphs New issue When importing logs, if --url= is set to HTTP url and Piwik is forced to use SSL then importing logs fails #6699 Closed mattab opened this Issue Nov 19, 2014 · 1 comment Projects None yet Labels duplicate Enhancement Milestone Long term Assignees No one assigned 1 participant Piwik Analytics member mattab commented Nov 19, 2014 When importing logs in Piwik and when Piwik is configured to use SSL by default, if you specify --url=http://piwik.example.org then Piwik will fail with this error: 2014-11-20 11:40:10,643: [DEBUG] Error when connecting to Piwik: The solution is to set the --url parameter to https://.... when importing logs. To fix this issue, we could maybe detect the URL redirect from HTTP to HTTPS and make Log importer detect that HTTPS should be used. mattab added Enhancement c: Log Analytics (import_logs.py) labels Nov 19, 2014 mattab added this to the Mid term milestone Nov 19, 2014 mattab referenced this issue in piwik/piwik-log-analytics Nov 19, 2014 Open When importing logs, if --url= is set to HTTP url and Piwik is forced to use SSL then importing logs fails #42 Piwik Analytics member mattab commented Mar 12, 2015 Issue was moved to the new repository for Piwik Log Analytics: https://github.com/piwik/piwik-log-analytics/issues refs #7163 mattab closed this Mar 12, 2015 mattab added the duplicate label Mar 12, 2015 Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment Contact GitHub API Training Shop Blog About © 2016 GitHub, Inc. Terms Privacy Security Status Help You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
connecting to Piwik: . I set up authentication when loading Piwik from the machine, but this doesn't work with import_logs.py. So instead, I set up a localhost-only port so the logs can be imported into the Piwik instance. Here's the relevant Nginx setup for the localhost-only Piwik port: server { listen 55557; allow ; allow 127.0.0.1; deny all; root /var/www-stats/piwik; index index.php index.html index.html; access_log /var/log/nginx/localhost_access.log; error_log https://github.com/piwik/piwik/issues/6699 /var/log/nginx/localhost_error.log info; client_max_body_size 10m; client_body_buffer_size 1024k; # Try all locations and relay to index.php as a fallback. # location / { # try_files $uri /index.php; # } # Relay all index.php requests to fastcgi. # location ~* ^/(?:index|piwik)\.php$ { location ~ \.php$ { try_files $uri =404; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; https://forum.piwik.org/t/import-logs-py-fails-contacting-piwik-served-from-nginx/7764 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_intercept_errors on; } } That setup seems to work correctly: > curl -I http://localhost:55557/piwik.php HTTP/1.1 200 OK Server: nginx Date: Mon, 17 Sep 2012 20:53:26 GMT Content-Type: text/html Connection: keep-alive X-Powered-By: PHP/5.3.10 But the actual import fails: > /var/www-stats/piwik/misc/log-analytics/import_logs.py -d --url=http://localhost:55557 --idsite=1 --recorders=1 --enable-http-errors --enable-http-redirects --enable-static --enable-bots access.log-20120916 2012-09-17 15:54:51,219: [DEBUG] Accepted hostnames: all 2012-09-17 15:54:51,219: [DEBUG] Piwik URL is: http://localhost:55557 2012-09-17 15:54:51,220: [DEBUG] No token-auth specified 2012-09-17 15:54:51,220: [DEBUG] No credentials specified, reading them from "/var/www-stats/piwik/config/config.ini.php" 2012-09-17 15:54:51,222: [DEBUG] Using credentials: (login = XXXXXX, password = YYYYYY) 2012-09-17 15:54:52,412: [DEBUG] Authentication token token_auth is: ZZZZZZ 2012-09-17 15:54:52,413: [DEBUG] Resolver: static 0 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current) 2012-09-17 15:54:52,654: [DEBUG] Launched recorder Parsing log access.log-20120916... 2012-09-17 15:54:52,654: [DEBUG] Detecting the log format 2012-09-17 15:54:52,743: [DEBUG] Format ncsa_extended matches 2445 lines parsed, 0 lines recorded, 0 records/sec (avg), 0 records/sec (current) 2012-09-17 15:54:53,781: [DEBUG] Error when connec
See blog post Piwik alternative to Urchin for more information. Piwik is the Urchin alternative but also Webalyzer and AWStats alternative: with a Python script, you can now import webserver logs https://issues.piwik.org/703 (apache, iis, and more) in Piwik, instead of using the javascript tracking. Description A Python script available in piwik/misc/log-analytics/ will parse server logs efficiently and automatically call the Piwik Tracking API to inject the visits/pageviews/downloads in Piwik. How to install / how to use * Requires Piwik >= 1.7.2-rc2. Download the latest version from http://builds.piwik.org/?C=N;O=D * Requires at least Python 2.6 * Requires one or many error when server log files, typically called access.log in Apache for example. These log files will be imported into Piwik. * You can also create a "test website" in Piwik to import all data into, rather than importing into your existing websites. Then, use the command --idsite=X to force all info from the log files to be imported into this idsite * You can use --dry-run command to error when connecting have a test run and make sure you will not track data or create new websites SEE FOLLOW UP TICKET #3163 How you can help? * please use the script and report your feedback and bugs here * if you are a hacker yourself, please review the code and consider submitting performance optimization, or improvements. * If you are a webhost or web agency and wish to offer Piwik to hundreds of your customers, please contact us * review the doc at Server log analytics Tasks to do before final release * Test, test and test * Setup on demo.piwik.org in a new website * Check all code review feedback managed * Review Import Logs in Piwik doc page. * decomission apache2piwik (update blog post) Feature requests for V2 or later SEE FOLLOW UP TICKET #3163 @mattab commented on March 14th 2012 First release of the script committed in [6046] @mattab commented on March 15th 2012 (In [6051]) Refs #703 * Adding README contributed by Cyril @robocoder commented on March 16th 2012 (In [6053]) refs #703 - propset eol-style @oliverhumpage commented on March 20th 2012 Performance-wise: I've set up piwik in its own jail now, turned