EzDevInfo.com

excon

Usable, fast, simple HTTP 1.1 for Ruby Excon excon : extended http(s) connections

Bundler could not find compatible versions for gem "excon" for gem mandrill-api

I'm getting this error when trying to install bundle. I have both versions '0.15.4' and '0.25.1' of gem excon in my gemset. How can I fix this?

Bundler could not find compatible versions for gem "excon":

In Gemfile: mandrill-api (>= 0) ruby depends on excon (~> 0.15.4) ruby

fog (~> 1.10.1) ruby depends on
  excon (0.25.1)

Source: (StackOverflow)

When saving a file to RackSpace CloudFiles using Paperclip/Fog, a timeout occurs, when connecting to odd IP address

I have an app that stores images on RackSpace CloudFiles using Paperclip. It's been working fine, but recently it won't save files. The error that occurs is:

Excon::Errors::SocketError (Connection timed out - connect(2) for 94.236.107.224:443 (Errno::ETIMEDOUT)):

In excon/socket.rb I have added some debugging to see the content of @data at the point the request is made. This is:

{
  :chunk_size        => 1048576, 
  :ciphers           => "HIGH:!SSLv2:!aNULL:!eNULL:!3DES", 
  :connect_timeout   => 60, 
  :debug_request     => false, 
  :debug_response    => true, 
  :headers           => {"User-Agent" => "fog/1.22.0"}, 
  :idempotent        => false, 
  :instrumentor_name => "excon", 
  :middlewares       => [Excon::Middleware::ResponseParser, Excon::Middleware::Expects, Excon::Middleware::Idempotent, Excon::Middleware::Instrumentor, Excon::Middleware::Mock],
  :mock              => false,
  :nonblock          => true,
  :omit_default_port => false,
  :persistent        => false,
  :read_timeout      => 60,
  :retry_limit       => 4,
  :ssl_verify_peer   => true,
  :tcp_nodelay       => false,
  :uri_parser        => URI,
  :write_timeout     => 60,
  :host              => "lon.auth.api.rackspacecloud.com",
  :path              => "/v2.0",
  :port              => 443,
  :query             => nil,
  :scheme            => "https",
  :user              => nil,
  :password          => nil
}

The host is lon.auth.api.rackspacecloud.com, which resolves to 92.52.64.197 (on the server, as well as locally).

However the error is because the connection to 94.236.107.224 times out. A reverse lookup on that IP shows it is also associated with the auth hostname:

$ host 94.236.107.224
224.107.236.94.in-addr.arpa domain name pointer lon.auth.api.rackspacecloud.com.

I presume this IP is no longer in use for the auth service, but I can't see why it's being connected to at all.

So I need to know:

  1. Why is the bad IP being connected to, when it doesn't show up in the log?
  2. How do I fix this so that the correct server is used?

Here is the full error that occurs:

Completed 500 Internal Server Error in 15437.6ms

Excon::Errors::SocketError (Connection timed out - connect(2) for 94.236.107.224:443 (Errno::ETIMEDOUT)):
  excon (0.33.0) lib/excon/socket.rb:220:in `connect_nonblock'
  excon (0.33.0) lib/excon/socket.rb:220:in `rescue in block in connect'
  excon (0.33.0) lib/excon/socket.rb:189:in `block in connect'
  excon (0.33.0) lib/excon/socket.rb:185:in `each'
  excon (0.33.0) lib/excon/socket.rb:185:in `connect'
  excon (0.33.0) lib/excon/ssl_socket.rb:131:in `connect'
  excon (0.33.0) lib/excon/socket.rb:28:in `initialize'
  excon (0.33.0) lib/excon/ssl_socket.rb:9:in `initialize'
  excon (0.33.0) lib/excon/connection.rb:414:in `new'
  excon (0.33.0) lib/excon/connection.rb:414:in `socket'
  excon (0.33.0) lib/excon/connection.rb:126:in `request_call'
  excon (0.33.0) lib/excon/middlewares/mock.rb:42:in `request_call'
  excon (0.33.0) lib/excon/middlewares/instrumentor.rb:22:in `request_call'
  excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
  excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
  excon (0.33.0) lib/excon/middlewares/base.rb:15:in `request_call'
  excon (0.33.0) lib/excon/connection.rb:269:in `request'
  fog-core (1.22.0) lib/fog/core/connection.rb:56:in `request'
  fog (1.22.0) lib/fog/rackspace/service.rb:34:in `request_without_retry'
  fog (1.22.0) lib/fog/rackspace/requests/identity/create_token.rb:15:in `create_token'
  fog (1.22.0) lib/fog/rackspace/identity.rb:41:in `authenticate'
  fog (1.22.0) lib/fog/rackspace/identity.rb:79:in `initialize'
  fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
  fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
  fog (1.22.0) lib/fog/rackspace/service.rb:116:in `authenticate_v2'
  fog (1.22.0) lib/fog/rackspace/service.rb:30:in `authenticate'
  fog (1.22.0) lib/fog/rackspace/storage.rb:88:in `authenticate'
  fog (1.22.0) lib/fog/rackspace/storage.rb:419:in `initialize'
  fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
  fog-core (1.22.0) lib/fog/core/service.rb:115:in `new'
  fog-core (1.22.0) lib/fog/storage.rb:26:in `new'
  paperclip (3.4.2) lib/paperclip/storage/fog.rb:208:in `connection'
  paperclip (3.4.2) lib/paperclip/storage/fog.rb:218:in `directory'
  paperclip (3.4.2) lib/paperclip/storage/fog.rb:100:in `block in flush_writes'
  paperclip (3.4.2) lib/paperclip/storage/fog.rb:96:in `each'
  paperclip (3.4.2) lib/paperclip/storage/fog.rb:96:in `flush_writes'
  paperclip (3.4.2) lib/paperclip/attachment.rb:221:in `save'
  paperclip (3.4.2) lib/paperclip/instance_methods.rb:17:in `block in save_attached_files'
  paperclip (3.4.2) lib/paperclip/instance_methods.rb:10:in `block in each_attachment'
  paperclip (3.4.2) lib/paperclip/instance_methods.rb:9:in `each'
  paperclip (3.4.2) lib/paperclip/instance_methods.rb:9:in `each_attachment'
  paperclip (3.4.2) lib/paperclip/instance_methods.rb:16:in `save_attached_files'
  activesupport (3.2.17) lib/active_support/callbacks.rb:449:in `_run__806665839013247154__save__3701132647492051879__callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_save_callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
  activerecord (3.2.17) lib/active_record/callbacks.rb:264:in `create_or_update'
  activerecord (3.2.17) lib/active_record/persistence.rb:84:in `save'
  activerecord (3.2.17) lib/active_record/validations.rb:50:in `save'
  activerecord (3.2.17) lib/active_record/attribute_methods/dirty.rb:22:in `save'
  activerecord (3.2.17) lib/active_record/transactions.rb:259:in `block (2 levels) in save'
  activerecord (3.2.17) lib/active_record/transactions.rb:313:in `block in with_transaction_returning_status'
  activerecord (3.2.17) lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction'
  activerecord (3.2.17) lib/active_record/transactions.rb:208:in `transaction'
  activerecord (3.2.17) lib/active_record/transactions.rb:311:in `with_transaction_returning_status'
  activerecord (3.2.17) lib/active_record/transactions.rb:259:in `block in save'
  activerecord (3.2.17) lib/active_record/transactions.rb:270:in `rollback_active_record_state!'
  activerecord (3.2.17) lib/active_record/transactions.rb:258:in `save'
  activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:28:in `block in save_resource'
  activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_save_callbacks'
  activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:27:in `save_resource'
  activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:22:in `block in create_resource'
  activeadmin (0.5.1) lib/active_admin/callbacks.rb:78:in `run_create_callbacks'
  activeadmin (0.5.1) lib/active_admin/resource_controller/callbacks.rb:21:in `create_resource'
  inherited_resources (1.4.1) lib/inherited_resources/actions.rb:33:in `create'
  activeadmin (0.5.1) lib/active_admin/resource_controller/actions.rb:48:in `create'
  actionpack (3.2.17) lib/action_controller/metal/implicit_render.rb:4:in `send_action'
  actionpack (3.2.17) lib/abstract_controller/base.rb:167:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/rendering.rb:10:in `process_action'
  actionpack (3.2.17) lib/abstract_controller/callbacks.rb:18:in `block in process_action'
  activesupport (3.2.17) lib/active_support/callbacks.rb:458:in `_run__2901337515923689909__process_action__4396305873998292606__callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_process_action_callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.17) lib/abstract_controller/callbacks.rb:17:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/rescue.rb:29:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action'
  activesupport (3.2.17) lib/active_support/notifications.rb:123:in `block in instrument'
  activesupport (3.2.17) lib/active_support/notifications/instrumenter.rb:20:in `instrument'
  activesupport (3.2.17) lib/active_support/notifications.rb:123:in `instrument'
  actionpack (3.2.17) lib/action_controller/metal/instrumentation.rb:29:in `process_action'
  actionpack (3.2.17) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.17) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.17) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.17) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.17) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.17) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.17) lib/action_controller/metal.rb:246:in `block in action'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `block in call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.17) lib/action_dispatch/routing/route_set.rb:608:in `call'
  rack-google_analytics (1.0.2) lib/rack/google_analytics.rb:5:in `call'
  warden (1.2.3) lib/warden/manager.rb:35:in `block in call'
  warden (1.2.3) lib/warden/manager.rb:34:in `catch'
  warden (1.2.3) lib/warden/manager.rb:34:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.17) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.17) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
  activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `_run__1208023080139519486__call__3701132647492051879__callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.17) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.17) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.17) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.17) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.17) lib/rails/rack/logger.rb:16:in `block in call'
  activesupport (3.2.17) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.17) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.17) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.17) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.17) lib/rails/engine.rb:484:in `call'
  railties (3.2.17) lib/rails/application.rb:231:in `call'
  railties (3.2.17) lib/rails/railtie/configurable.rb:30:in `method_missing'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/rack/thread_handler_extension.rb:77:in `process_request'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler/thread_handler.rb:142:in `accept_and_process_next_request'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler/thread_handler.rb:110:in `main_loop'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/passenger-4.0.35/lib/phusion_passenger/request_handler.rb:441:in `block (3 levels) in start_threads'

Source: (StackOverflow)

Advertisements

how can I resolve this gemfile conflict

I'm getting this error after bundle install. How can I fix it?

 Bundler could not find compatible versions for gem "excon":
  In Gemfile:
    locomotive-heroku (~> 0.0.2) ruby depends on
      excon (~> 0.9.4) ruby

    excon (0.20.0)

Source: (StackOverflow)

Excon unable to verify certificate on Mavericks 10.9.2

I've recently run into an error when I try to deploy my AWS servers where Excon is no longer able to find my ssl certificates. The following error is what I get:

/Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/ssl_socket.rb:101:in `connect_nonblock': Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file` or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::SocketError)
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/ssl_socket.rb:101:in `block in initialize'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/2.1.0/timeout.rb:82:in `block in timeout'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `catch'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/2.1.0/timeout.rb:70:in `timeout'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/ssl_socket.rb:97:in `initialize'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:410:in `new'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:410:in `socket'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:122:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/mock.rb:42:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:265:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/idempotent.rb:12:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:288:in `rescue in request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:225:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/idempotent.rb:12:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:288:in `rescue in request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:225:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/idempotent.rb:12:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/middlewares/base.rb:10:in `error_call'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:288:in `rescue in request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/excon-0.32.1/lib/excon/connection.rb:225:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/xml/sax_parser_connection.rb:36:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/xml.rb:22:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/aws/compute.rb:447:in `_request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/aws/compute.rb:442:in `request'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/aws/requests/compute/describe_security_groups.rb:39:in `describe_security_groups'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/fog-1.21.0/lib/fog/aws/models/compute/security_groups.rb:66:in `all'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/cloud/aws.rb:268:in `describe_security_groups'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/cloud/aws.rb:404:in `sync_security_groups'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/cloud/aws.rb:260:in `setup_security_groups'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/cloud/aws.rb:75:in `before_create_instance'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/thread_safe_proxy.rb:13:in `method_missing'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/recipes/rubber/instances.rb:267:in `block in create_instance'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/recipes/rubber/instances.rb:266:in `create_instance'
from /Users/Jacob/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/rubber-2.7.3/lib/rubber/recipes/rubber/instances.rb:230:in `block (2 levels) in create_instances'

I've tried deleting my openssl.conf file as suggested in this similar thread:

Excon not recognising my SSL route

but the same error still appears

Let me know if there is any other information I could provide to be helpful.


Source: (StackOverflow)

Ruby Excon SSL SocketError: read finished A

Using Ruby on Rails with Carrierwave + Fog, which relies on Excon to connect to S3. The Rails server is being run on AWS EC2. Most of the time, the Carrierwave uploader works fine, but often I get the following error and stack trace:

Excon::Errors::SocketError: SSL_connect SYSCALL returned=5 errno=0 state=SSLv3 read finished A (OpenSSL::SSL::SSLError)
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/ssl_socket.rb: 105:in `connect_nonblock'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/ssl_socket.rb: 105:in `block in initialize'
/usr/local/lib/ruby/2.1.0/timeout.rb:  91:in `block in timeout'
/usr/local/lib/ruby/2.1.0/timeout.rb:  35:in `block in catch'
/usr/local/lib/ruby/2.1.0/timeout.rb:  35:in `catch'
/usr/local/lib/ruby/2.1.0/timeout.rb:  35:in `catch'
/usr/local/lib/ruby/2.1.0/timeout.rb: 106:in `timeout'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/ssl_socket.rb: 101:in `initialize'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 414:in `new'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 414:in `socket'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 126:in `request_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/mock.rb:  42:in `request_call'
…ems/excon-0.36.0/lib/excon/middlewares/instrumentor.rb:  22:in `request_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  15:in `request_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  15:in `request_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  15:in `request_call'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 269:in `request'
…/gems/excon-0.36.0/lib/excon/middlewares/idempotent.rb:  12:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 292:in `rescue in request'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 229:in `request'
…/gems/excon-0.36.0/lib/excon/middlewares/idempotent.rb:  12:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 292:in `rescue in request'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 229:in `request'
…/gems/excon-0.36.0/lib/excon/middlewares/idempotent.rb:  12:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…/2.1.0/gems/excon-0.36.0/lib/excon/middlewares/base.rb:  10:in `error_call'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 292:in `rescue in request'
…y/gems/2.1.0/gems/excon-0.36.0/lib/excon/connection.rb: 229:in `request'
…/2.1.0/gems/fog-core-1.22.0/lib/fog/core/connection.rb:  56:in `request'
…cal/lib/ruby/gems/2.1.0/gems/fog-1.22.1/lib/fog/xml.rb:  23:in `request'
…ruby/gems/2.1.0/gems/fog-1.22.1/lib/fog/aws/storage.rb: 535:in `request'
…/fog-1.22.1/lib/fog/aws/requests/storage/put_object.rb:  31:in `put_object'
…1.0/gems/fog-1.22.1/lib/fog/aws/models/storage/file.rb: 199:in `save'
…/2.1.0/gems/fog-core-1.22.0/lib/fog/core/collection.rb:  51:in `create'
…gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb: 261:in `store'
…gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:  80:in `store!'
…s/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:  59:in `block in store!'
…rrierwave-0.10.0/lib/carrierwave/uploader/callbacks.rb:  17:in `with_callbacks'
…s/carrierwave-0.10.0/lib/carrierwave/uploader/store.rb:  58:in `store!'
…2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb: 375:in `store!'
…2.1.0/gems/carrierwave-0.10.0/lib/carrierwave/mount.rb: 207:in `store_finish_image!'

Any idea what is going on?


Source: (StackOverflow)

How to map Amazon Products API to Rails?

I'm trying to fetch products from the Amazon Products API (using https://github.com/hakanensari/vacuum/) and display them in my Rails app. But how do I bring the product names and photos into my views?

Currently getting:

ActionView::Template::Error (undefined method `image' for #<Array:0x88486aec>):
    2: <% if @products.any? %>
    3:   <% @products.each do |product| %>
    4:     <div class="product">
    5:       <%= link_to image_tag(product.image.url), product.url %>
    6:       <%= link_to product.name, product.url %>
    7:     </div>
    8:   <% end %>

main_controller.rb:

class MainController < ApplicationController
  def index
    request = Vacuum.new('GB')

    request.configure(
      aws_access_key_id: 'ABCDEFGHIJKLMNOPQRST',
      aws_secret_access_key: '<long messy key>',
      associate_tag: 'lipsum-20'
    )

    params = {
      'SearchIndex' => 'Books',
      'Keywords'=> 'Ruby on Rails'
    }

    #
    # NOT SURE WHERE TO TAKE IT FROM HERE
    #

    raw_products = request.item_search(query: params)

    @products = raw_products.to_h
    product = OpenStruct.new(@products)
  end
end

index.html.erb:

<% if @products.any? %>
  <% @products.each do |product| %>
    <div class="product">
      <%= link_to image_tag(product.image.url), product.url %>
      <%= link_to product.name, product.url %>
    </div>
  <% end %>
<% end %>

Source: (StackOverflow)

excon gem dependency conflict between mandrill-api and fog. (Rails 3)

In my gemfile I have

gem 'rails', '3.2.11'
gem 'fog'
gem 'mandrill-api'

When I run bundle I receive this error

Bundler could not find compatible versions for gem "excon":
  In Gemfile:
    mandrill-api (>= 0) ruby depends on
      excon (~> 0.15.4) ruby

    fog (>= 0) ruby depends on
      excon (0.13.4)

I'm not sure how to deal with dependency conflicts like this other then searching for versions of the two conflicting gems which don't have the conflict. Obviously, I'd like to be able to use the versions I choose and not be limited by dependency conflicts. In this case, I'm not even sure if it is possible to find non-conflicting versions.

My question is, can you fix this error, preferably without specifying older versions of either of the two gems?

Let me know if you need any more info to answer the question.

Thanks.


Source: (StackOverflow)

asset_sync/fog Unable to verify SSL certificate

I want to use the asset_sync gem to compile my Rails-assets locally and then upload them to my S3 bucket. But when I try to compile & upload them the rake task aborts because it's unable to verify the SSL-certificate.

I'm struggling around for 3 days to find a workaround for this problem but nothing solved it.

Found out that the OpenSSL of rubyinstaller.org's builds is broken, but even if I set SSL_CERT_FILE manually the rake task fails with the same error (Even though I can make a HTTPS-connection in ruby with that setting).

Works:

set SSL_CERT_FILE=C:\ruby\cacert_test\cacert.pem
ruby -ropen-uri -e 'puts open("https://www.google.com/accounts").read'

Fails:

set SSL_CERT_FILE=C:\ruby\cacert_test\cacert.pem
bundle exec rake assets:precompile RAILS_ENV=production

System: Win 8.1 (x64) and ruby 2.1 (x64) (from rubyinstaller)

Error-log:

Excon::Errors::SocketError: Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `ENV['SSL_CERT_DIR'] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, `ENV['SSL_CERT_FILE'] = path_to_file`, `Excon.defaults[:ssl_verify_callback] = callback` (see OpenSSL::SSL::SSLContext#verify_callback), or `Excon.defaults[:ssl_verify_peer] = false` (less secure).
OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
...

Related:


Source: (StackOverflow)

rails - excon gem dependency conflict between mandrill-api & heroku-api

I have some dependency conflict since I try to add mandrill-api.

I've added the gem in my gemfile, but when I want to bundle install I've got this error :

Bundler could not find compatible versions for gem "excon":
 In Gemfile:
mandrill-api (>= 0) ruby depends on
  excon (~> 0.15.4) ruby

heroku-api (>= 0) ruby depends on
  excon (0.13.4)

I've tried so many things to fix this, but impossible. Even if I delete the heroku gems, I still get an error with fog.

Anyone has an idea? thanks !


Source: (StackOverflow)

Error with Excon when uploading to rackspace with Fog

Very recently, uploading of files to Rackspace cloud has started erroring on my mac and one other mac in our office. The same code base works fine on Ubuntu servers and on a third mac in the office. The error reports an (Excon::Errors::SocketError) Illegal seek (Errno::ESPIPE) pointing to gems/excon-0.31.0/lib/excon/connection.rb:186:in `pos='"

This has been baffling me for days. All macs are osx 10.9. If anyone can offer any assistance it would be greatly appreciated.

Versions: Fog(1.20.0) Excon(0.31.0)


Source: (StackOverflow)

Excon not recognising my SSL route

When pushing to Heroku, my db:migrate failed at the following:

!    Heroku client internal error.
Error:       Unable to verify certificate, please set `Excon.defaults[:ssl_ca_path] = path_to_certs`, `Excon.defaults[:ssl_ca_file] = path_to_file`, or `Excon.defaults[:ssl_verify_peer] = false` (less secure). (Excon::Errors::SocketError)

So, I added the following to the bottom of my production.rb file (my certs at in the root file)

Excon.defaults[:ssl_ca_path] = Rails.root

Same error.

So I then tried the fallback:

Excon.defaults[:ssl_verify_peer] = false

Same error.

I'm stumped, and have been going round in circles for hours. Any ideas?

Thanks in advance


Source: (StackOverflow)

How to solve "Connection refused - connect(2) (Errno::ECONNREFUSED) (Excon::Errors::SocketError)"?

I cannot get my Ruby on Rails app to start anymore. For no apparent reason, any command such as "rails s", "rake db:migrate", "thin start", etc now triggers the following exception :

Connection refused - connect(2) (Errno::ECONNREFUSED) (Excon::Errors::SocketError)

After some reading, this seems to indicate that something, somewhere, is not listening to some ports (!) but this is unfortunately an area I am really not knowledgeable and comfortable with.

The only recent change I can think of when trying to find out what could have caused this is the installation and use of Jmeter with Homebrew on my Macbook pro running Mavericks.

Any ideas that could point me to the right direction to eventually solve this would be highly appreciated.

For the record, here are the lines that tell where things go wrong :

EDIT : here is the complete trace :

/Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:218:in `connect_nonblock': Connection refused - connect(2) (Errno::ECONNREFUSED) (Excon::Errors::SocketError)
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:218:in `rescue in block in connect'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:187:in `block in connect'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:183:in `each'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:183:in `connect'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/socket.rb:28:in `initialize'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/connection.rb:418:in `new'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/connection.rb:418:in `socket'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/connection.rb:126:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/newrelic_rpm-3.8.0.218/lib/new_relic/agent/instrumentation/excon/middleware.rb:28:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/middlewares/mock.rb:42:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/middlewares/instrumentor.rb:22:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/middlewares/base.rb:15:in `request_call'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/excon-0.33.0/lib/excon/connection.rb:269:in `request'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/neography-1.5.0/lib/neography/connection.rb:70:in `block (3 levels) in <class:Connection>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/neography-1.5.0/lib/neography/connection.rb:84:in `log'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/neography-1.5.0/lib/neography/connection.rb:62:in `block (2 levels) in <class:Connection>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/neography-1.5.0/lib/neography/rest/node_auto_indexes.rb:38:in `set_node_auto_index_status'
from /Users/pierre/argomento/config/initializers/01_neo4j.rb:20:in `<top (required)>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `load'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `block in load'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:245:in `load'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/engine.rb:593:in `block (2 levels) in <class:Engine>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/engine.rb:592:in `each'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/engine.rb:592:in `block in <class:Engine>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/initializable.rb:30:in `run'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `each'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/application.rb:136:in `initialize!'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/pierre/argomento/config/environment.rb:5:in `<top (required)>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-3.2.18/lib/active_support/dependencies.rb:251:in `require'
from /Users/pierre/argomento/config.ru:3:in `block in <main>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/pierre/argomento/config.ru:in `new'
from /Users/pierre/argomento/config.ru:in `<main>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/commands/server.rb:46:in `app'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/commands/server.rb:70:in `start'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/commands.rb:55:in `block in <top (required)>'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/commands.rb:50:in `tap'
from /Users/pierre/.rvm/gems/ruby-2.0.0-p353/gems/railties-3.2.18/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'

Source: (StackOverflow)

Rails: sporadic Carrierwave/Excon errors

Using carrierwave for our uploaders, we get a couple of Excon errors each week from our production app. For example:

Excon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request) excon.error.response :body => "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>IncompleteBody</Code><Message>The request body terminated unexpectedly</Message>

We've started wrapping the uploading process in a retry block and it always seems to work fine after another try, but I'm wondering if there is a better solution, as this becomes unwieldy after a while. It seems to me like these errors ought to be handled at a lower level. Is there a better way to handle these issues?

Here's our production configuration:

config.storage = :fog
config.root = Dir.tmpdir
config.cache_dir = 'carrierwave'
config.fog_credentials = {
  provider: 'AWS',
  aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
  aws_secret_access_key: ENV['AWS_ACCESS_KEY'],
}

config.fog_directory = ENV['AWS_S3_BUCKET']
config.fog_public = false
config.fog_authenticated_url_expiration = 7.days.to_i

config.enable_processing = true

And we're using gem versions:

fog (1.27.0)
carrierwave (0.10.0)
excon (0.43.0)

Source: (StackOverflow)

Mandrill-api Excon::Errors::SocketError

I am using Mandrill-api in Ruby to programmatically send out transactional email.

I have (more or less) the following line in my rails app,

mandrill ||= Mandrill::API.new const(:API)[:MANDRILL_APIKEY]
... (constructing the message, content, etc)
mandrill.messages.send_template templ, template_content, message, true

The problem is when running in production, it returns the following error once in a while.

Excon::Errors::SocketError (EOFError (EOFError)):
app/mailers/mailer.rb:24:in `send'
....

I have no idea how to debug this issue. If somebody could shed me light on the approach for debugging this, I highly appreciate it.

Gems Info:

  • mandrill-api (1.0.33)
  • excon (0.16.10)

Production env:

 sudo bundle exec rake RAILS_ENV=production about


About your application's environment
Ruby version              1.9.3 (x86_64-linux)
RubyGems version          1.8.11
Rack version              1.4
Rails version             3.2.13
Active Record version     3.2.13
Action Pack version       3.2.13
Active Resource version   3.2.13
Action Mailer version     3.2.13
Active Support version    3.2.13
Middleware                Rack::Cache, Rack::Lock, #<ActiveSupport::Cache::Strategy::LocalCache::Middleware:0x00000001e72330>, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Callbacks, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::CookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, ActionDispatch::Head, Rack::ConditionalGet, Rack::ETag, ActionDispatch::BestStandardsSupport
Environment               production
Database adapter          mysql2

Running on:

Apache Server: Apache/2.2.22 (Ubuntu)

Passenger: 3.0.14


Source: (StackOverflow)

Carrierwave + S3 Storage + Counter Cache Taking too Long

I have a simple app that receives POSTed images via an API and sends them to S3, via Carrierwave. My Photos table has a counter_cache as well.

80% of the time my transaction time is HUGE, like 60 seconds or more, and more than 90% of this time is spent uploading the image to S3 and updating counter_cache.

Does anybody have a clue about why this uploading time is so big and why counter cache queries are taking so long?

New Relic report

Transaction Trace

SQL Trace

Just added some photos on http://carrierwave-s3-upload-test.herokuapp.com

Behavior was similar: enter image description here

Just removed counter_cache from my code and did some more uploading.... Odd behavior again. enter image description here


EDIT 1

Logs from last batch upload. EXCON_DEBUG is set to True: https://gist.github.com/rafaelcgo/561f516a85823e30fbad


EDIT 2

My logs weren't showing any EXCON output info. So I realized I was using fog 1.3.1. Updated to Fog 1.19.0 (which uses a newer version of the excon gem) and everything works nicely now. enter image description here

Tips.. If you need to debug external connections, use the newer version of excon and set the env EXCON_DEBUG=true in order to see some verbose, like this: https://gist.github.com/geemus/8097874


EDIT 3

Guys, updated the gem fog and now it's sweet. Don't know why old versions of fog and excon have this odd performance.


Source: (StackOverflow)