3

从 Rails 控制台使用 MailChimp gem 时出现间歇性错误。

这是错误:

Excon::Errors::SocketError: EOFError (EOFError)
  from /Users/me/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/openssl/buffering.rb:246:in `readline'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/excon-0.26.0/lib/excon/response.rb:39:in `parse'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/excon-0.26.0/lib/excon/middlewares/response_parser.rb:6:in `response_call'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/excon-0.26.0/lib/excon/connection.rb:349:in `response'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/excon-0.26.0/lib/excon/connection.rb:252:in `request'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/excon-0.26.0/lib/excon/connection.rb:290:in `post'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/mailchimp-api-2.0.3/lib/mailchimp.rb:40:in `call'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/mailchimp-api-2.0.3/lib/mailchimp/api.rb:861:in `member_info'
  from (irb):5
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/railties-3.2.14/lib/rails/commands/console.rb:47:in `start'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/railties-3.2.14/lib/rails/commands/console.rb:8:in `start'
  from /Users/me/.rvm/gems/ruby-1.9.3-p448@launchsoon/gems/railties-3.2.14/lib/rails/commands.rb:41:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'
4

2 回答 2

8

我做了一些搜索Excon::Errors::SocketError: EOFError (EOFError),我遇到了这个carrierwave问题,这似乎与我的经历一致。

我能够重现这种行为 - 如果我让我的控制台在那里坐一会儿,然后调用 MailChimp 的 API,它会因上述错误而失败一次。如果我重试相同的调用,它会成功。

所以这个问题似乎是由于让套接字打开超过了保持活动的值。不幸的是,我不知道除了“不要那样做”之外的修复/解决方法。

于 2013-09-26T13:56:48.163 回答
2

只是为了记录,如果有人在这里结束:excon 0.44.4 版似乎已经解决了这个问题。添加

gem 'excon', '~> 0.44.4'

到您的 Gemfile 并运行

bundle update excon
于 2015-08-05T15:06:49.410 回答