错误是间歇性的,有时会起作用,有时它不会使调试变得非常困难。
ConnectException in CurlFactory.php line 186: cURL error 7: Failed to connect to us-east-api.getstream.io port 443: Connection timed out (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
in CurlFactory.php line 186 at CurlFactory::createRejection(object(EasyHandle), array('errno' => '7', 'error' => 'Failed to connect to us-east-api.getstream.io port 443: Connection timed out', 'url' => 'https://us-east-api.getstream.io/api/v1.0/feed/notification/1/?limit=7&api_key=XXX', 'content_type' => null, 'http_code' => '0', 'header_size' => '0', 'request_size' => '0', 'filetime' => '-1', 'ssl_verify_result' => '0', 'redirect_count' => '0', 'total_time' => '4.077293', 'namelookup_time' => '0.127791', 'connect_time' => '0', 'pretransfer_time' => '0', 'size_upload' => '0', 'size_download' => '0', 'speed_download' => '0', 'speed_upload' => '0', 'download_content_length' => '-1', 'upload_content_length' => '-1', 'starttransfer_time' => '0', 'redirect_time' => '0', 'redirect_url' => '', 'primary_ip' => '', 'certinfo' => array(), 'primary_port' => '0', 'local_ip' => '', 'local_port' => '0')) in CurlFactory.php line 150 at CurlFactory::finishError(object(CurlHandler), object(EasyHandle), object(CurlFactory)) in CurlFactory.php line 103 at CurlFactory::finish(object(CurlHandler), object(EasyHandle), object(CurlFactory)) in CurlHandler.php line 43 at CurlHandler->__invoke(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in Proxy.php line 28 at Proxy::GuzzleHttp\Handler\{closure}(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in Proxy.php line 51 at Proxy::GuzzleHttp\Handler\{closure}(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in PrepareBodyMiddleware.php line 42 at PrepareBodyMiddleware->__invoke(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in Middleware.php line 30 at Middleware::GuzzleHttp\{closure}(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in RedirectMiddleware.php line 68 at RedirectMiddleware->__invoke(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in Middleware.php line 59 at Middleware::GuzzleHttp\{closure}(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in HandlerStack.php line 67 at HandlerStack->__invoke(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false)) in Client.php line 268 at Client->transfer(object(Request), array('synchronous' => true, 'base_uri' => object(Uri), 'timeout' => '6', 'handler' => object(HandlerStack), 'allow_redirects' => array('max' => '5', 'protocols' => array('http', 'https'), 'strict' => false, 'referer' => false, 'track_redirects' => false), 'http_errors' => true, 'decode_content' => true, 'verify' => true, 'cookies' => false, '_conditional' => array('User-Agent' => 'GuzzleHttp/6.1.1 curl/7.35.0 PHP/5.6.10-1+deb.sury.org~trusty+1'))) in Client.php line 98
答案 0 :(得分:1)
作为Stream的联合创始人之一我可以告诉你事情在我们结束时运行顺利:)你也可以从Stream的status page验证相同的内容。
您遇到的超时错误可能取决于很多事情。这两个是导致类似问题的最常见原因:
本地开发人员与我们的API端点之间的连接延迟缓慢/不一致
DNS问题(例如,错误处理DNS TTL,错误的DNS服务器......)
我的建议是通过以下方式确保两者都得到照顾:
在stream-laravel配置文件中增加开发环境的API超时,确保您拥有'timeout' => 10
。
确保您使用Google DNS之类的内容(效果很好)IP 8.8.8.8
和8.8.4.4
因为Homestead使用Ubuntu,您可以参考this link