1
votes

I'm trying to send hit to google analytics measurement protocol and get timeout exception. Hits send by curl library, i tried to increase timeout but it didn't help. This issue appears randomly

  * Connection #7 to host www.google-analytics.com left intact    
https://www.google-analytics.com/collect?tid=UA-61364284-1&geoid=1011969&cm=cpc&cs=smi&cn=1322_5&ul=ru-ru&t=pageview&v=1&dl=http%3A%2F%2Fnominaltechno.ru&cid=a4788d46-3628-4132-a5d9-505201581b59&ua=Mozilla%2F5.0%20%28X11%3B%20Linux%20i586%3B%20rv%3A31.0%29%20Gecko%2F20100101%20Firefox%2F31.0&sc=start&qt=5688590    
* Hostname was found in DNS cache    
*   Trying 172.217.20.206...    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable      
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
* connect to 172.217.20.206 port 443 failed: Connection timed out    
*   Trying 2a00:1450:401b:803::200e...    
* Immediate connect fail for 2a00:1450:401b:803::200e: Network is unreachable    
* Failed to connect to www.google-analytics.com port 443: Connection timed out    
* Closing connection 8

Can anybody explain what caused the problem? Thank for answers

1

1 Answers

1
votes

I just tried your request against the debug endpoint

https://www.google-analytics.com/debug/collect?tid=UA-61364284-1&geoid=1011969&cm=cpc&cs=smi&cn=1322_5&ul=ru-ru&t=pageview&v=1&dl=http%3A%2F%2Fnominaltechno.ru&cid=a4788d46-3628-4132-a5d9-505201581b59&ua=Mozilla%2F5.0%20%28X11%3B%20Linux%20i586%3B%20rv%3A31.0%29%20Gecko%2F20100101%20Firefox%2F31.0&sc=start&qt=5688590    

Response:

{
  "hitParsingResult": [ {
    "valid": true,
    "parserMessage": [ ],
    "hit": "/debug/collect?tid=UA-61364284-1\u0026geoid=1011969\u0026cm=cpc\u0026cs=smi\u0026cn=1322_5\u0026ul=ru-ru\u0026t=pageview\u0026v=1\u0026dl=http%3A%2F%2Fnominaltechno.ru\u0026cid=a4788d46-3628-4132-a5d9-505201581b59\u0026ua=Mozilla%2F5.0%20(X11%3B%20Linux%20i586%3B%20rv%3A31.0)%20Gecko%2F20100101%20Firefox%2F31.0\u0026sc=start\u0026qt=5688590"
  } ],
  "parserMessage": [ {
    "messageType": "INFO",
    "description": "Found 1 hit in the request."
  } ]
}

Which tells us its a valid hit. Then I put it in a web browser (chrome) which returned the proper gif. You may have just seen a hit coming from Denmark that was me.

I think there is something up with your curl setup.

Curl Error Hostname Not Found in DNS Cache: curl failed to connect to that host's TCP port number 80.