我正在尝试向Google分析测量协议发送命中并获得超时异常。命中由curl库发送,我试图增加超时但它没有帮助。此问题随机出现
* 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
有人可以解释导致问题的原因吗?感谢答案
答案 0 :(得分:1)
我刚尝试了针对调试端点的请求
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
响应:
{
"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."
} ]
}
这告诉我们它的有效命中。然后我把它放在一个Web浏览器(chrome)中,它返回了正确的gif。你可能刚刚看到来自丹麦的热门话题就是我。
我认为您的卷曲设置有一些问题。
在DNS缓存中找不到卷曲错误主机名:curl无法连接到该主机的TCP端口号80.