-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mysql socket error on Google Cloud Run with Rails 6.1 #106
Comments
Good morning, thank you so much for the message!
Are you seeing this error locally? When you say it's happening on asset precompile, you're not using webpacker or anything, right? It's looking like it's hitting a problem whereby the database is not initialized -- are you using a non-standard means to connect to the DB? I notice it's got "cloudsql" listed as the driver.
Rich
… On 14/02/2022 22:39 Aaron Lorenz ***@***.***> wrote:
I get the following error when adding the exception_handler config information on production...while assets are precompiling...db: option is set to true. Removing the config info clears the error...as does setting db: option to nil. Any help would be appreciated...thanks
RUN RAILS_ENV=production bundle exec rake assets:precompile
---> Running in 5f9658 https://gitlab.com/springs-data-services/hr-onboarding/-/jobs/2092658638#L658 d8ba43
rake aborted!
ActiveRecord::ConnectionNotEstablished: Can't connect to local MySQL server through socket '/cloudsql/' (2)
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:45:in rescue in new_client' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:39:in new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in mysql2_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in public_send'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in try_to_checkout_new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in acquire_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in checkout' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in retrieve_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in connection' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in initialize'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in new' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in block in class:Engine'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in instance_exec' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in run'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in block in run_initializers' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in run_initializers'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in initialize!' /app/config/environment.rb:5:in
'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in require' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in require_environment!' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in block in run_tasks_blocks'
/app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in block (2 levels) in define' /app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in load' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in kernel_load'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in run' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in exec'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in dispatch'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in start'
/usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in block in <top (required)>' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in with_friendly_errors'
/usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in <top (required)>' /usr/local/bundle/bin/bundle:23:in load'
/usr/local/bundle/bin/bundle:23:in <main>' Caused by: Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/cloudsql/' (2) /app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in connect'
/app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in initialize' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in new'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in new_client' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in mysql2_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in public_send' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in checkout_new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in acquire_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in checkout'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in retrieve_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in connection'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in initialize' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in new'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in block in <class:Engine>' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in instance_exec'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in run' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in block in run_initializers'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in run_initializers' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in initialize!'
/app/config/environment.rb:5:in <main>' /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in require' /app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in require'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in block in require' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in load_dependency'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in require' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in require_environment!'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in block in run_tasks_blocks' /app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in block (2 levels) in define'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in <top (required)>' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in load'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in kernel_load' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in run'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in exec' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in run'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in dispatch'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in dispatch' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in start'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in start' /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in block in <top (required)>'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in with_friendly_errors' /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in <top (required)>'
/usr/local/bundle/bin/bundle:23:in load' /usr/local/bundle/bin/bundle:23:in '
—
Reply to this email directly, view it on GitHub #106 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINULY2C4VD6I3GCU7YG6TU3GAC7ANCNFSM5OMZCZ5A .
Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub .
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Hey Rich,
Sorry for the late reply. No, the issue is only in production. Yes, this is
Rails 6 so Webpacker is in use. The application is running in Docker on
Google Cloud Run, which is the reason I would love to get the DB part of
exception handler running . I would agree as well that the initialization
of exception_handler is being called prior to the sql connection being
available. Would there be a way to delay this, or perhaps turn on the
database functionality after the application is already fully loaded.
Thanks
On Tue, Feb 15, 2022 at 4:33 AM Richard Peck ***@***.***>
wrote:
… Good morning, thank you so much for the message!
Are you seeing this error locally? When you say it's happening on asset
precompile, you're not using webpacker or anything, right? It's looking
like it's hitting a problem whereby the database is not initialized -- are
you using a non-standard means to connect to the DB? I notice it's got
"cloudsql" listed as the driver.
Rich
> On 14/02/2022 22:39 Aaron Lorenz ***@***.***> wrote:
>
>
>
>
> I get the following error when adding the exception_handler config
information on production...while assets are precompiling...db: option is
set to true. Removing the config info clears the error...as does setting
db: option to nil. Any help would be appreciated...thanks
>
> RUN RAILS_ENV=production bundle exec rake assets:precompile
> ---> Running in 5f9658
https://gitlab.com/springs-data-services/hr-onboarding/-/jobs/2092658638#L658
d8ba43
> rake aborted!
> ActiveRecord::ConnectionNotEstablished: Can't connect to local MySQL
server through socket '/cloudsql/' (2)
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:45:in
rescue in new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:39:in
new_client'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in
mysql2_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
public_send'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in
checkout_new_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in
try_to_checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in
acquire_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in
checkout'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in
connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in
retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in
retrieve_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in
connection'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in
initialize'
>
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
new'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
block in class:Engine'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
instance_exec'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
run'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in
block in run_initializers'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in
run_initializers'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in
initialize!' /app/config/environment.rb:5:in
>
> '
>
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'
>
/app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in
require'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
block in require'
>
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in
load_dependency'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
require'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in
require_environment!'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in
block in run_tasks_blocks'
>
/app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in
block (2 levels) in define'
/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in <top
(required)>'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in load'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
kernel_load'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in run'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in exec'
>
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'
>
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in
dispatch' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in
dispatch'
>
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in
start' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in start'
> /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in block in <top
(required)>'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors'
> /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in <top (required)>'
/usr/local/bundle/bin/bundle:23:in load'
> /usr/local/bundle/bin/bundle:23:in <main>' Caused by:
Mysql2::Error::ConnectionError: Can't connect to local MySQL server through
socket '/cloudsql/' (2)
/app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
connect'
>
/app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
initialize'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in
new'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in
new_client'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in
mysql2_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
public_send'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
new_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in
checkout_new_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in
try_to_checkout_new_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in
acquire_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in
checkout'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in
connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in
retrieve_connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in
retrieve_connection'
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in
connection'
>
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in
initialize'
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
new'
>
/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
block in <class:Engine>'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
instance_exec'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
run'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in
block in run_initializers'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in
run_initializers'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in
initialize!'
> /app/config/environment.rb:5:in <main>'
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'
>
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'
/app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in
require'
>
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
block in require'
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in
load_dependency'
>
/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
require'
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in
require_environment!'
>
/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in
block in run_tasks_blocks'
/app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in
block (2 levels) in define'
> /app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in <top
(required)>'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in load'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
kernel_load'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in run'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in exec'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run'
>
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in
dispatch'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in dispatch'
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in
start'
> /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in start'
/usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in block in <top
(required)>'
>
/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors' /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in
<top (required)>'
> /usr/local/bundle/bin/bundle:23:in load'
/usr/local/bundle/bin/bundle:23:in '
>
>
> —
> Reply to this email directly, view it on GitHub
#106 , or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAINULY2C4VD6I3GCU7YG6TU3GAC7ANCNFSM5OMZCZ5A
.
> Triage notifications on the go with GitHub Mobile for iOS
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
or Android
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
.
> You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#106 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABO7EFGG3Y7LB5EF2CDQ6NTU3JBZHANCNFSM5OMZCZ5A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get the following error when adding the exception_handler config information on production...while assets are precompiling...db: option is set to true. Removing the config info clears the error...as does setting db: option to nil. Any help would be appreciated...thanks
RUN RAILS_ENV=production bundle exec rake assets:precompile
'---> Running in 5f9658d8ba43
rake aborted!
ActiveRecord::ConnectionNotEstablished: Can't connect to local MySQL server through socket '/cloudsql/' (2)
/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:45:in
rescue in new_client' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:39:in
new_client'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in
mysql2_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
public_send'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in
checkout_new_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in
try_to_checkout_new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in
acquire_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in
checkout' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in
connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in
retrieve_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in
retrieve_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in
connection' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in
initialize'/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
new' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
block in class:Engine'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
instance_exec' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
run'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in
block in run_initializers' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in
run_initializers'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in
initialize!' /app/config/environment.rb:5:in
/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require' /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'/app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in
require' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
block in require'/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in
load_dependency' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
require'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in
require_environment!' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in
block in run_tasks_blocks'/app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in
block (2 levels) in define' /app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in
<top (required)>'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
load' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
kernel_load'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in
run' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in
exec'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in
dispatch' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in
dispatch'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in
start' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in
start'/usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in
block in <top (required)>' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors'/usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in
<top (required)>' /usr/local/bundle/bin/bundle:23:in
load'/usr/local/bundle/bin/bundle:23:in
<main>' Caused by: Mysql2::Error::ConnectionError: Can't connect to local MySQL server through socket '/cloudsql/' (2) /app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
connect'/app/vendor/bundle/ruby/3.0.0/gems/mysql2-0.5.3/lib/mysql2/client.rb:90:in
initialize' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in
new'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:40:in
new_client' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/mysql2_adapter.rb:23:in
mysql2_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
public_send' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in
new_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in
checkout_new_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in
try_to_checkout_new_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in
acquire_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in
checkout'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in
connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in
retrieve_connection'/app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:327:in
retrieve_connection' /app/vendor/bundle/ruby/3.0.0/gems/activerecord-6.1.4.6/lib/active_record/connection_handling.rb:283:in
connection'/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/config.rb:143:in
initialize' /app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
new'/app/vendor/bundle/ruby/3.0.0/gems/exception_handler-0.8.0.2/lib/exception_handler/engine.rb:45:in
block in <class:Engine>' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
instance_exec'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:32:in
run' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:61:in
block in run_initializers'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/initializable.rb:60:in
run_initializers' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:391:in
initialize!'/app/config/environment.rb:5:in
<main>' /app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require'/app/vendor/bundle/ruby/3.0.0/gems/bootsnap-1.10.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in
require' /app/vendor/bundle/ruby/3.0.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in
require'/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
block in require' /app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:299:in
load_dependency'/app/vendor/bundle/ruby/3.0.0/gems/activesupport-6.1.4.6/lib/active_support/dependencies.rb:332:in
require' /app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:367:in
require_environment!'/app/vendor/bundle/ruby/3.0.0/gems/railties-6.1.4.6/lib/rails/application.rb:533:in
block in run_tasks_blocks' /app/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.4.2/lib/sprockets/rails/task.rb:61:in
block (2 levels) in define'/app/vendor/bundle/ruby/3.0.0/gems/rake-13.0.6/exe/rake:27:in
<top (required)>' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
load'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:58:in
kernel_load' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli/exec.rb:23:in
run'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:484:in
exec' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor.rb:392:in
dispatch'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:31:in
dispatch' /usr/local/bundle/gems/bundler-2.3.7/lib/bundler/vendor/thor/lib/thor/base.rb:485:in
start'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/cli.rb:25:in
start' /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:48:in
block in <top (required)>'/usr/local/bundle/gems/bundler-2.3.7/lib/bundler/friendly_errors.rb:103:in
with_friendly_errors' /usr/local/bundle/gems/bundler-2.3.7/exe/bundle:36:in
<top (required)>'/usr/local/bundle/bin/bundle:23:in
load' /usr/local/bundle/bin/bundle:23:in
'The text was updated successfully, but these errors were encountered: