sentry-ruby icon indicating copy to clipboard operation
sentry-ruby copied to clipboard

sentry-rails 5.15.2 to 5.16.1 update breaks gitlab - TZInfo::InvalidTimezoneIdentifier: Invalid identifier: (GMT+00:00) UTC

Open pravi opened this issue 6 months ago • 3 comments

Issue Description

When sentry-rails is updated from 5.10.0 to 5.16.1 (later we found upto 5.15.2 is good) in gitlab, all rake tasks fails with TZInfo::InvalidTimezoneIdentifier: Invalid identifier: (GMT+00:00) UTC https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144973

Reproduction Steps

For now this gitlab MR reproduces the error

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144973

Expected Behavior

This should not break gitlab or any rails app

Actual Behavior

I think sentry is adding extra '(GMT+00:00)' to a valid timezone 'UTC'. I tested with many other timezone values in config/application.rb and all fails.

Ruby Version

3.1

SDK Version

3.1

Integration and Its Version

No response

Sentry Config

No response

pravi avatar Feb 17 '24 20:02 pravi

If we can confirm this is a bug in gitlab, then we can close this issue.

pravi avatar Feb 18 '24 17:02 pravi

hey, here it says it's the string so I think this is on your end

# application.rb:
class Application < Rails::Application
  config.time_zone = 'Eastern Time (US & Canada)'
end

https://api.rubyonrails.org/classes/ActiveSupport/TimeZone.html

sl0thentr0py avatar Mar 06 '24 15:03 sl0thentr0py

I have a similar issue during building stage. Downgrading to 5.15.2 helped.

bin/rails aborted!
TZInfo::InvalidTimezoneIdentifier: Invalid identifier: nil (TZInfo::InvalidTimezoneIdentifier)
/app/vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_source.rb:316:in `validate_timezone_identifier'
/app/vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_sources/zoneinfo_data_source.rb:307:in `load_timezone_info'
/app/vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/data_source.rb:195:in `get_timezone_info'
/app/vendor/bundle/ruby/3.2.0/gems/tzinfo-2.0.6/lib/tzinfo/timezone.rb:128:in `get'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/values/time_zone.rb:208:in `find_tzinfo'
/app/vendor/bundle/ruby/3.2.0/gems/sentry-rails-5.17.0/lib/sentry/rails/railtie.rb:75:in `configure_cron_timezone'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/railtie.rb:226:in `public_send'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/railtie.rb:226:in `method_missing'
/app/vendor/bundle/ruby/3.2.0/gems/sentry-rails-5.17.0/lib/sentry/rails/railtie.rb:43:in `block in <class:Railtie>'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:94:in `block in execute_hook'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:87:in `with_execution_control'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:92:in `execute_hook'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:78:in `block in run_load_hooks'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:77:in `each'
/app/vendor/bundle/ruby/3.2.0/gems/activesupport-7.1.2/lib/active_support/lazy_load_hooks.rb:77:in `run_load_hooks'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/application/finisher.rb:93:in `block in <module:Finisher>'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `instance_exec'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/initializable.rb:32:in `run'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/initializable.rb:60:in `run_initializers'
/app/vendor/bundle/ruby/3.2.0/gems/railties-7.1.2/lib/rails/application.rb:423:in `initialize!'
/app/config/environment.rb:7:in `<main>'

hoverjet avatar Mar 20 '24 11:03 hoverjet