google-cloud-ruby: Possible incompatibility with Airbrake gem
Hi,
I’m upgrading a Rails application to version 5.2.1 and some gems were updated.
ruby 2.4.2
airbrake-7.3.5
airbrake-ruby-2.11.0
google-cloud-logging-1.5.2
Looks like all executables (rails console, db migrations), when exiting, are raising an exception. This causes the return value from executables to be 1.
I’m unsure if this is an airbrake issue or a gcloud logging issue.
Can anyone help?
Example:
# rails c
Loading staging environment (Rails 5.2.1)
irb(main):002:0> Rails.logger.info("test")
test
=> true
irb(main):003:0> Rails.logger
=> #<Google::Cloud::Logging::Logger:0x000055e6b3c77438 @writer=#<Google::Cloud::Logging::AsyncWriter:0x000055e6b3c77640 @mon_owner=nil, @mon_count=0, @mon_mutex=#<Thread::Mutex:0x000055e6b3c77578>, @startup_lock=#<Thread::Mutex:0x000055e6b3c77550>, @cleanup_options={:wait_interval=>1.0, :timeout=>10.0, :force=>true}, @logging=#<Google::Cloud::Logging::Project:0x000055e6b3c651e8 @service=Google::Cloud::Logging::Service(projectname), @shared_async_writer=#<Google::Cloud::Logging::AsyncWriter:0x000055e6b3c77640 ...>>, @max_queue_size=10000, @partial_success=false, @queue_resource=#<MonitorMixin::ConditionVariable:0x000055e6b3c774d8 @monitor=#<Google::Cloud::Logging::AsyncWriter:0x000055e6b3c77640 ...>, @cond=#<Thread::ConditionVariable:0x000055e6b3c774b0>>, @queue=[], @queue_size=0, @lock_cond=#<MonitorMixin::ConditionVariable:0x000055e6b790b660 @monitor=#<Google::Cloud::Logging::AsyncWriter:0x000055e6b3c77640 ...>, @cond=#<Thread::ConditionVariable:0x000055e6b790b638>>, @async_state=:running, @thread=#<Thread:0x000055e6b790b2f0@/usr/local/bundle/gems/stackdriver-core-1.3.0/lib/stackdriver/core/async_actor.rb:314 sleep_forever>, @last_exception=#<Google::Cloud::PermissionDeniedError: 7:The caller does not have permission>>, @log_name="ruby_app_log", @resource=#<Google::Cloud::Logging::Resource:0x000055e6b3c77690 @labels={:cluster_name=>"environment", :namespace_id=>"default"}, @type="container">, @labels={}, @level=0, @request_info={}, @closed=false, @formatter=#<Logger::Formatter:0x000055e6b3c773c0 @datetime_format=nil>, @datetime_format="", @silencer=true, @project="projectname">
irb(main):004:0>
**Airbrake: closed
/usr/local/bundle/gems/google-cloud-logging-1.5.2/lib/google/cloud/logging/async_writer.rb:155:in `block in write_entries': AsyncWriter has been stopped (RuntimeError)
from /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
from /usr/local/bundle/gems/google-cloud-logging-1.5.2/lib/google/cloud/logging/async_writer.rb:154:in `write_entries'
from /usr/local/bundle/gems/google-cloud-logging-1.5.2/lib/google/cloud/logging/logger.rb:553:in `write_entry'
from /usr/local/bundle/gems/google-cloud-logging-1.5.2/lib/google/cloud/logging/logger.rb:317:in `add'
from /usr/local/bundle/gems/activesupport-5.2.1/lib/active_support/logger.rb:28:in `block (2 levels) in broadcast'
from /usr/local/bundle/gems/google-cloud-logging-1.5.2/lib/google/cloud/logging/logger.rb:195:in `debug'
from /usr/local/bundle/gems/airbrake-ruby-2.11.0/lib/airbrake-ruby/async_sender.rb:53:in `close'
from /usr/local/bundle/gems/airbrake-ruby-2.11.0/lib/airbrake-ruby/notifier.rb:73:in `close'
from /usr/local/bundle/gems/airbrake-ruby-2.11.0/lib/airbrake-ruby.rb:280:in `close'
from /usr/local/bundle/gems/airbrake-7.3.5/lib/airbrake.rb:29:in `block in <main>'
# echo $?
1
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 37 (22 by maintainers)
Can you try reproducing in a separate dummy app that only adds Google Cloud Logging and Airbrake, and any other dependency that is needed to demonstrate the behavior? Having a known-working reproducible app would help the diagnosis immensely.