Support » Plugin: WP-Matomo (WP-Piwik) » Connection timed out after 5008 milliseconds

  • Hey there

    We re-setup Matomo on a new environment.
    Actually Matomo is running behind a nginx reverse proxy.
    Now the connections aren’t working anymore. I tried near everything.
    When I do the request in a browser or directly from the webserver’s console, I get a proper answer.
    Can you help please?

    WP-Matomo 1.0.22
    Mode: http
    
    Test 1/3: global.getPiwikVersion
    
    string(6) "3.11.0"
    
    array(2) {
      [0]=>
      string(451) "HTTP/1.1 200 OK
    Server: nginx
    Date: Sun, 06 Oct 2019 14:26:19 GMT
    Content-Type: application/json; charset=utf-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Vary: Accept-Encoding
    X-Powered-By: PHP/7.1.32
    X-Matomo-Request-Id: 3e597
    Cache-Control: must-revalidate
    Access-Control-Allow-Origin: *
    X-Acki: proxyfile nocache 1.0
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET, POST, OPTIONS
    X-Host: stats.domain.ch
    
    "
      [1]=>
      string(144) "https://stats.domain.ch/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DAPI.getPiwikVersion%26idSite%3Dn%2Fa&token_auth=..."
    }
    
    Test 2/3: SitesManager.getSitesWithAtLeastViewAccess
    
    bool(false)
    
    array(2) {
      [0]=>
      string(0) ""
      [1]=>
      string(167) "https://stats.domain.ch/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3Dn%2Fa&token_auth=..."
    }
    
    Test 3/3: SitesManager.getSitesIdFromSiteUrl
    
    bool(false)
    
    array(2) {
      [0]=>
      string(0) ""
      [1]=>
      string(275) "https://stats.domain.ch/?module=API&method=API.getBulkRequest&format=json&urls[0]=method%3DSitesManager.getSitesWithAtLeastViewAccess%26idSite%3Dn%2Fa&urls[1]=method%3DSitesManager.getSitesIdFromSiteUrl%26idSite%3Dn%2Fa%26url%3Dhttp%3A%2F%2Fwww.naefspiele.ch&token_auth=..."
    }
    
    array(2) {
      ["global_settings"]=>
      array(67) {
        ["revision"]=>
        string(10) "2019072901"
        ["last_settings_update"]=>
        string(10) "1570371091"
        ["piwik_mode"]=>
        string(4) "http"
        ["piwik_url"]=>
        string(26) "https://stats.domain.ch/"
        ["piwik_path"]=>
        string(0) ""
        ["piwik_user"]=>
        string(0) ""
        ["matomo_user"]=>
        string(0) ""
        ["piwik_token"]=>
        string(3) "set"
        ["auto_site_config"]=>
        string(1) "1"
        ["default_date"]=>
        string(9) "yesterday"
        ["stats_seo"]=>
        string(1) "0"
        ["stats_ecommerce"]=>
        string(1) "0"
        ["dashboard_widget"]=>
        string(8) "disabled"
        ["dashboard_ecommerce"]=>
        string(1) "0"
        ["dashboard_chart"]=>
        string(1) "0"
        ["dashboard_seo"]=>
        string(1) "0"
        ["toolbar"]=>
        string(1) "0"
        ["capability_read_stats"]=>
        array(8) {
          ["administrator"]=>
          string(1) "1"
          ["editor"]=>
          string(1) "0"
          ["author"]=>
          string(1) "0"
          ["contributor"]=>
          string(1) "0"
          ["subscriber"]=>
          string(1) "0"
          ["translator"]=>
          string(1) "0"
          ["wpseo_manager"]=>
          string(1) "0"
          ["wpseo_editor"]=>
          string(1) "0"
        }
        ["perpost_stats"]=>
        string(1) "0"
        ["plugin_display_name"]=>
        string(8) "WP-Piwik"
        ["piwik_shortcut"]=>
        string(1) "0"
        ["shortcodes"]=>
        string(1) "0"
        ["track_mode"]=>
        string(8) "disabled"
        ["track_codeposition"]=>
        string(6) "footer"
        ["track_noscript"]=>
        string(1) "0"
        ["track_nojavascript"]=>
        string(1) "0"
        ["proxy_url"]=>
        string(0) ""
        ["track_content"]=>
        string(8) "disabled"
        ["track_search"]=>
        string(1) "0"
        ["track_404"]=>
        string(1) "0"
        ["add_post_annotations"]=>
        array(0) {
        }
        ["add_customvars_box"]=>
        string(1) "0"
        ["add_download_extensions"]=>
        string(0) ""
        ["set_download_extensions"]=>
        string(0) ""
        ["set_link_classes"]=>
        string(0) ""
        ["set_download_classes"]=>
        string(0) ""
        ["disable_cookies"]=>
        string(1) "0"
        ["limit_cookies"]=>
        string(1) "0"
        ["limit_cookies_visitor"]=>
        string(8) "34186669"
        ["limit_cookies_session"]=>
        string(4) "1800"
        ["limit_cookies_referral"]=>
        string(8) "15778463"
        ["track_admin"]=>
        string(1) "0"
        ["capability_stealth"]=>
        array(0) {
        }
        ["track_across"]=>
        string(1) "0"
        ["track_across_alias"]=>
        string(1) "0"
        ["track_crossdomain_linking"]=>
        string(1) "0"
        ["track_feed"]=>
        string(1) "0"
        ["track_feed_addcampaign"]=>
        string(1) "0"
        ["track_feed_campaign"]=>
        string(4) "feed"
        ["track_heartbeat"]=>
        string(1) "0"
        ["track_user_id"]=>
        string(8) "disabled"
        ["cache"]=>
        string(1) "1"
        ["http_connection"]=>
        string(4) "curl"
        ["http_method"]=>
        string(4) "post"
        ["disable_timelimit"]=>
        string(1) "0"
        ["filter_limit"]=>
        string(0) ""
        ["connection_timeout"]=>
        string(1) "5"
        ["disable_ssl_verify"]=>
        string(1) "0"
        ["disable_ssl_verify_host"]=>
        string(1) "0"
        ["piwik_useragent"]=>
        string(3) "php"
        ["piwik_useragent_string"]=>
        string(8) "WP-Piwik"
        ["dnsprefetch"]=>
        string(1) "0"
        ["track_datacfasync"]=>
        string(1) "0"
        ["track_cdnurl"]=>
        string(0) ""
        ["track_cdnurlssl"]=>
        string(0) ""
        ["force_protocol"]=>
        string(8) "disabled"
        ["update_notice"]=>
        string(7) "enabled"
      }
      ["settings"]=>
      array(6) {
        ["name"]=>
        string(0) ""
        ["site_id"]=>
        string(3) "n/a"
        ["noscript_code"]=>
        string(0) ""
        ["tracking_code"]=>
        string(0) ""
        ["last_tracking_code_update"]=>
        string(1) "0"
        ["dashboard_revision"]=>
        string(1) "0"
      }
    }
    

    Thanks,
    Chris

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author braekling

    (@braekling)

    Strangely enough, the result code (200) looks good, but the response is empty.

    – Did you check your server logfiles? Maybe there is a hint on what’s happening?
    – Did you try to call the REST endpoint in your browser? Just copy & paste one of the URLs used by the test script and add your auth token. Does it also take that long? Can you also check the network section of your browser’s debug tools while requesting the URL?

    – Yes, I can’t see anything unusual
    – Yes, every request is working as expected. For example one response to SitesManager.getSitesIdFromSiteUrl, taking 82ms:
    [[{"idsite":"140"}],"3.11.0","<!-- Matomo -->\n<script type=\"text\/javascript\">\n var _paq = window._paq || [];\n \/* tracker methods like \"setCustomDimension\" should be called before \"trackPageView\" *\/\n _paq.push(['trackPageView']);\n _paq.push(['enableLinkTracking']);\n (function() {\n var u=\"https:\/\/stats.domain.ch\/\";\n _paq.push(['setTrackerUrl', u+'piwik.php']);\n _paq.push(['setSiteId', 'n\/a']);\n var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];\n g.type='text\/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);\n })();\n<\/script>\n<noscript><p><img src=\"https:\/\/stats.domain.ch\/piwik.php?idsite=n\/a&rec=1\" style=\"border:0;\" alt=\"\" \/><\/p><\/noscript>\n<!-- End Matomo Code -->\n"]

    Plugin Author braekling

    (@braekling)

    To be honest, I don’t have an idea how to proceed here.

    I just can imagine that localhost requests are blocked for some reason (mod_security settings? Firewall?), but this should be visible in your log files and not just cause a timeout/ no response scenario. :/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Connection timed out after 5008 milliseconds’ is closed to new replies.