1

该错误是间歇性的,有时有效,有时无效,这使得调试非常困难。

  • 机器: Windows 10
  • 框架: Laravel 5.1
  • 环境:
    • 宅基地2.2.1
    • Vagrant 1.8.1(Ubuntu 14.04.2 LTS GNU/Linux 3.13.0-32-generic x86_64)
    • PHP 5.6.10-1+deb.sury.org
  • 作曲家锁
    • “guzzlehttp/guzzle”:6.1.1,
    • "get-stream/stream-laravel": "dev-master",
CurlFactory.php 第 186 行中的 ConnectException:
cURL 错误 7:无法连接到 us-east-api.getstream.io 端口 443:连接超时(参见 http://curl.haxx.se/libcurl/c/libcurl-errors.html)
在 CurlFactory.php 第 186 行
在 CurlFactory::createRejection(object(EasyHandle), array('errno' => '7', 'error' => '无法连接到 us-east-api.getstream.io 端口 443: 连接超时', ' 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')) 在 CurlFactory.php 第 150 行0', 'redirect_url' => '', 'primary_ip' => '', 'certinfo' => array(), 'primary_port' => '0', 'local_ip' => '', 'local_port' => '0')) 在 CurlFactory.php 第 150 行0', 'redirect_url' => '', 'primary_ip' => '', 'certinfo' => array(), 'primary_port' => '0', 'local_ip' => '', 'local_port' => '0')) 在 CurlFactory.php 第 150 行
在 CurlFactory::finishError(object(CurlHandler), object(EasyHandle), object(CurlFactory)) 在 CurlFactory.php 第 103 行
在 CurlHandler.php 第 43 行的 CurlFactory::finish(object(CurlHandler), object(EasyHandle), object(CurlFactory))
在 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)) 在 Proxy.php 第 28 行
在 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)) 在 Proxy.php 第 51 行
在 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)) 在 PrepareBodyMiddleware.php 第 42 行
在 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)) 在 Middleware.php 第 30 行
在 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)) 在 RedirectMiddleware.php 第 68 行
在 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)) 在 Middleware.php 第 59 行
在 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)) 在 HandlerStack.php 第 67 行
在 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)) 在 Client.php 第 268 行
在客户端->传输(对象(请求),数组('同步'=> true,'base_uri'=>对象(Uri),'超时'=>'6','处理程序'=>对象(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'))) 在 Client.php 第 98 行
4

1 回答 1

1

作为 Stream 的联合创始人之一,我可以告诉你,我们这边的事情进展顺利 :) 你也可以从 Stream 的状态页面验证相同的内容。

您遇到的超时错误可能取决于很多事情。这两个是导致类似问题的最常见原因:

  • 您的本地开发人员和我们的 API 端点之间的连接延迟缓慢/不一致

  • DNS 问题(例如,错误处理 DNS TTL、错误的 DNS 服务器……)

我的建议是通过执行以下操作确保两者都得到照顾:

  • 为你的开发环境增加 API 超时,在 stream-laravel 配置文件中确保你有'timeout' => 10.

  • 确保您使用诸如 Google DNS 之类的东西(它们工作得很好)IP 是8.8.8.8,并且8.8.4.4由于 Homestead 使用 Ubuntu,您可以参考此链接

于 2016-03-15T17:29:22.790 回答