gpt4 book ai didi

ruby-on-rails - Errno::ECONNRESET:连接被对端重置

转载 作者:行者123 更新时间:2023-11-30 05:29:09 44 4
gpt4 key购买 nike

我正在使用 Rails 应用程序和 MiniFB Gem 来调用 Facebook Api。我得到以下异常

Errno::ECONNRESET:  Connection reset by peer

以下是回溯:-

Backtrace :
/usr/lib/ruby/1.8/net/http.rb:586:in `connect'
/usr/lib/ruby/1.8/net/http.rb:586:in `connect'
/usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
/usr/lib/ruby/1.8/net/http.rb:542:in `start'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:166:in `transmit'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:60:in `execute'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rest-client-1.6.1/lib/restclient/request.rb:31:in `execute'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rest-client-1.6.1/lib/restclient.rb:68:in `get'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/mini_fb-1.1.7/lib/mini_fb.rb:633:in `fetch'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/mini_fb-1.1.7/lib/mini_fb.rb:619:in `rest'
/usr/local/share/webapps/airtelfbvoiceupdates/lib/facebook.rb:39:in `getContactInfo'
/usr/local/share/webapps/airtelfbvoiceupdates/app/models/person.rb:453:in `probe_email_in_facebook'
/usr/local/share/webapps/airtelfbvoiceupdates/app/controllers/api/ussd_controller.rb:45:in `index'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in `send'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:1331:in `perform_action_without_filters'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:617:in `call_filters'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:10:in `realtime'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/benchmark.rb:17:in `ms'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/flash.rb:151:in `perform_action'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in `send'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:532:in `process_without_filters'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/filters.rb:606:in `process'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:391:in `process'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/base.rb:386:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/routing/route_set.rb:438:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:87:in `dispatch'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:121:in `_call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:130:in `build_middleware_stack'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/string_coercion.rb:25:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/head.rb:9:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/methodoverride.rb:24:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/params_parser.rb:15:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/session/cookie_store.rb:99:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/failsafe.rb:26:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `synchronize'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/rack-1.1.0/lib/rack/lock.rb:11:in `call'
/usr/local/share/webapps/airtelfbvoiceupdates/vendor/bundle/ruby/1.8/gems/actionpack-2.3.8/lib/action_controller/dispatcher.rb:106:in `call'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/rack/request_handler.rb:92:in `process_request'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/railz/application_spawner.rb:441:in `start_request_handler'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/railz/application_spawner.rb:381:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/utils.rb:252:in `safe_fork'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/railz/application_spawner.rb:377:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:163:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/railz/application_spawner.rb:222:in `start'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:352:in `__send__'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:352:in `main_loop'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/lib/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
/usr/lib/ruby/gems/1.8/gems/passenger-2.2.14/bin/passenger-spawn-server:61

ECONNRESET 可能是什么原因,Facebook 是否重置了他们的连接?还是与我本地的 Passenger 相关问题有关?

最佳答案

我遇到了同样的问题。我以某种方式通过将我的请求限制为 1 个查询/秒来修复它。每秒发出多少请求?

关于ruby-on-rails - Errno::ECONNRESET:连接被对端重置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8252407/

44 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com