Hi,
I am making the dynamodb connection through
Aws.config.update({
region: region,
credentials: Aws::Credentials.new(a.public.text, a.private.text),
})
I am getting the error while executing the line :
Node.where(:is_submitted => 't').where(:is_signed_off => 'f').count
Error :
Seahorse::Client::NetworkingError
SSL_connect returned=1 errno=0 state=error: certificate verify failed
Logs :
/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/net/http.rb:800:in
connect' /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/net/http.rb:800:inblock in connect'
/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/timeout.rb:69:intimeout' /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/timeout.rb:100:intimeout'
/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/net/http.rb:800:inconnect' /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/net/http.rb:756:indo_start'
/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/net/http.rb:751:instart' aws-sdk-core (2.3.19) lib/seahorse/client/net_http/connection_pool.rb:281:instart_session'
aws-sdk-core (2.3.19) lib/seahorse/client/net_http/connection_pool.rb:93:insession_for' aws-sdk-core (2.3.19) lib/seahorse/client/net_http/handler.rb:116:insession'
aws-sdk-core (2.3.19) lib/seahorse/client/net_http/handler.rb:68:intransmit' aws-sdk-core (2.3.19) lib/seahorse/client/net_http/handler.rb:42:incall'
aws-sdk-core (2.3.19) lib/seahorse/client/plugins/content_length.rb:12:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/dynamodb_crc32_validation.rb:27:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/json/error_handler.rb:8:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/request_signer.rb:84:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:87:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:118:inretry_request' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:101:inretry_if_possible'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/retry_errors.rb:89:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/json/handler.rb:11:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/user_agent.rb:12:incall' aws-sdk-core (2.3.19) lib/seahorse/client/plugins/endpoint.rb:41:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/param_validator.rb:21:incall' aws-sdk-core (2.3.19) lib/seahorse/client/plugins/raise_response_errors.rb:14:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/dynamodb_simple_attributes.rb:112:incall' aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/param_converter.rb:20:incall'
aws-sdk-core (2.3.19) lib/aws-sdk-core/plugins/response_paging.rb:26:incall' aws-sdk-core (2.3.19) lib/seahorse/client/plugins/response_target.rb:21:incall'
aws-sdk-core (2.3.19) lib/seahorse/client/request.rb:70:insend_request' aws-sdk-core (2.3.19) lib/seahorse/client/base.rb:207:inblock (2 levels) in define_operation_methods'
dynamoid (1.1.0) lib/dynamoid/adapter_plugin/aws_sdk_v2.rb:368:inblock (2 levels) in scan' dynamoid (1.1.0) lib/dynamoid/adapter_plugin/aws_sdk_v2.rb:367:inloop'
dynamoid (1.1.0) lib/dynamoid/adapter_plugin/aws_sdk_v2.rb:367:inblock in scan' dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:142:ineach'
dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:142:ineach' dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:142:inblock in records_via_scan'
dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:115:ineach' dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:115:ineach'
dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:115:into_a' dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:115:inArray'
dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:115:inrecords' dynamoid (1.1.0) lib/dynamoid/criteria/chain.rb:95:ineach'
app/controllers/application_controller.rb:108:incount' app/controllers/application_controller.rb:108:inset_global_counts'
activesupport (4.1.14.2) lib/active_support/callbacks.rb:429:inblock in make_lambda' activesupport (4.1.14.2) lib/active_support/callbacks.rb:143:incall'
activesupport (4.1.14.2) lib/active_support/callbacks.rb:143:inblock in halting_and_conditional' activesupport (4.1.14.2) lib/active_support/callbacks.rb:501:incall'
activesupport (4.1.14.2) lib/active_support/callbacks.rb:501:inblock in call' activesupport (4.1.14.2) lib/active_support/callbacks.rb:501:ineach'
activesupport (4.1.14.2) lib/active_support/callbacks.rb:501:incall' activesupport (4.1.14.2) lib/active_support/callbacks.rb:86:inrun_callbacks'
actionpack (4.1.14.2) lib/abstract_controller/callbacks.rb:19:inprocess_action' actionpack (4.1.14.2) lib/action_controller/metal/rescue.rb:29:inprocess_action'
actionpack (4.1.14.2) lib/action_controller/metal/instrumentation.rb:32:inblock in process_action' activesupport (4.1.14.2) lib/active_support/notifications.rb:159:inblock in instrument'
activesupport (4.1.14.2) lib/active_support/notifications/instrumenter.rb:20:ininstrument' activesupport (4.1.14.2) lib/active_support/notifications.rb:159:ininstrument'
actionpack (4.1.14.2) lib/action_controller/metal/instrumentation.rb:30:inprocess_action' actionpack (4.1.14.2) lib/action_controller/metal/params_wrapper.rb:250:inprocess_action'
actionpack (4.1.14.2) lib/abstract_controller/base.rb:136:inprocess' actionview (4.1.14.2) lib/action_view/rendering.rb:30:inprocess'
actionpack (4.1.14.2) lib/action_controller/metal.rb:196:indispatch' actionpack (4.1.14.2) lib/action_controller/metal/rack_delegation.rb:13:indispatch'
actionpack (4.1.14.2) lib/action_controller/metal.rb:232:inblock in action' actionpack (4.1.14.2) lib/action_dispatch/routing/route_set.rb:80:incall'
actionpack (4.1.14.2) lib/action_dispatch/routing/route_set.rb:80:indispatch' actionpack (4.1.14.2) lib/action_dispatch/routing/route_set.rb:48:incall'
actionpack (4.1.14.2) lib/action_dispatch/journey/router.rb:73:inblock in call' actionpack (4.1.14.2) lib/action_dispatch/journey/router.rb:59:ineach'
actionpack (4.1.14.2) lib/action_dispatch/journey/router.rb:59:incall' actionpack (4.1.14.2) lib/action_dispatch/routing/route_set.rb:690:incall'
rack (1.5.2) lib/rack/etag.rb:23:incall' rack (1.5.2) lib/rack/conditionalget.rb:25:incall'
rack (1.5.2) lib/rack/head.rb:11:incall' actionpack (4.1.14.2) lib/action_dispatch/middleware/params_parser.rb:27:incall'
actionpack (4.1.14.2) lib/action_dispatch/middleware/flash.rb:254:incall' rack (1.5.2) lib/rack/session/abstract/id.rb:225:incontext'
rack (1.5.2) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.1.14.2) lib/action_dispatch/middleware/cookies.rb:562:incall'
actionpack (4.1.14.2) lib/action_dispatch/middleware/callbacks.rb:29:inblock in call' activesupport (4.1.14.2) lib/active_support/callbacks.rb:82:inrun_callbacks'
actionpack (4.1.14.2) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.1.14.2) lib/action_dispatch/middleware/reloader.rb:73:incall'
actionpack (4.1.14.2) lib/action_dispatch/middleware/remote_ip.rb:76:incall' actionpack (4.1.14.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall'
actionpack (4.1.14.2) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.1.14.2) lib/rails/rack/logger.rb:38:incall_app'
railties (4.1.14.2) lib/rails/rack/logger.rb:20:inblock in call' activesupport (4.1.14.2) lib/active_support/tagged_logging.rb:68:inblock in tagged'
activesupport (4.1.14.2) lib/active_support/tagged_logging.rb:26:intagged' activesupport (4.1.14.2) lib/active_support/tagged_logging.rb:68:intagged'
railties (4.1.14.2) lib/rails/rack/logger.rb:20:incall' /opt/brazil-pkg-cache/packages/AmazonRailsLogger/AmazonRailsLogger-4.0.80.55/RHEL5_64/DEV.STD.PTHREAD/build/ruby1.9/site_ruby/1.9.1/amazon/set_request_id.rb:9:incall'
/opt/brazil-pkg-cache/packages/AmazonRailsLogger/AmazonRailsLogger-4.0.80.55/RHEL5_64/DEV.STD.PTHREAD/build/ruby1.9/site_ruby/1.9.1/amazon/set_request_id.rb:9:incall' actionpack (4.1.14.2) lib/action_dispatch/middleware/request_id.rb:21:incall'
rack (1.5.2) lib/rack/methodoverride.rb:21:incall' rack (1.5.2) lib/rack/runtime.rb:17:incall'
activesupport (4.1.14.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:incall' rack (1.5.2) lib/rack/lock.rb:17:incall'
actionpack (4.1.14.2) lib/action_dispatch/middleware/static.rb:84:incall' rack (1.5.2) lib/rack/sendfile.rb:112:incall'
railties (4.1.14.2) lib/rails/engine.rb:514:incall' railties (4.1.14.2) lib/rails/application.rb:144:incall'
railties (4.1.14.2) lib/rails/railtie.rb:194:inpublic_send' railties (4.1.14.2) lib/rails/railtie.rb:194:inmethod_missing'
rack (1.5.2) lib/rack/lint.rb:49:in_call' rack (1.5.2) lib/rack/lint.rb:37:incall'
rack (1.5.2) lib/rack/showexceptions.rb:24:incall' rack (1.5.2) lib/rack/commonlogger.rb:33:incall'
rack (1.5.2) lib/rack/chunked.rb:43:incall' rack (1.5.2) lib/rack/content_length.rb:14:incall'
rack (1.5.2) lib/rack/handler/webrick.rb:60:inservice' /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/webrick/httpserver.rb:138:inservice'
/home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/webrick/httpserver.rb:94:inrun' /home/lakhwani/FCLaunchRequirement/env/FCLaunchRequirementWebsite-1.0/runtime/ruby1.9/1.9.1/webrick/server.rb:191:inblock in start_thread'
Can any one help me in this?
What you're seeing is us wrapping errors from your HTTP client, which we then retry.
This error indicates that Ruby's OpenSSL was unable to verify the peer certificate while establishing an SSL connection to Amazon S3. This particular error is very common when your system does not have a correctly configured openssl library with certificate. For example, this happens on all Windows installations of Ruby.
As a work-around the SDK ships with an optional SSL cert bundle. Browsers frequently bundle their own certs for the same reason. You can opt-in to use the bundled cert by calling:
Aws.use_bundled_cert!
@awood45 is there another alternative to Aws.use_bundled_cert! ?
Hi,
How does one "call" Aws.use_bundled_cert!
on a Windows EC2 instance?
thank you!
@FlandersBurger I called it in aws.rb
# frozen_string_literal: true
require 'aws-sdk'
Aws.config.update(
region: Rails.configuration.aws_region,
credentials: Aws::Credentials.new(Rails.application.secrets.aws_access_key_id, Rails.application.secrets.aws_secret_access_key)
)
Aws.use_bundled_cert!
and that worked for me for now. this is true that I want a solution that does not require this :)
for the background, I was having SSL issue for the system before this issue that I resolved using https://github.com/rubygems/rubygems/issues/2415#issuecomment-460998632
All this start happening when I moved from Mojave to Catalina.
This can also happen if you set the region parameter to something invalid (e.g. from a typo) as this is used to generate the hostname.
Most helpful comment
What you're seeing is us wrapping errors from your HTTP client, which we then retry.
This error indicates that Ruby's OpenSSL was unable to verify the peer certificate while establishing an SSL connection to Amazon S3. This particular error is very common when your system does not have a correctly configured openssl library with certificate. For example, this happens on all Windows installations of Ruby.
As a work-around the SDK ships with an optional SSL cert bundle. Browsers frequently bundle their own certs for the same reason. You can opt-in to use the bundled cert by calling: