0

We have a large rails4-app in production on several client machines. Recently we discovered an odd bug. After some unknown time (can be hours) in the rails app the I18n.localize(date) breaks. The format falls back to the default (2018-08-21) instead of "21.08.2018". Everything else in the context of I18n seems to work normal. Inside the rails console the behaviour is also as expected.

This change is application-wide. If i do a restart (soft restart via unicorn is enough), everything is back to normal until it happens again. Our test-suite does not have any errors and its hard to track down the error.

We did some gem updates few days back, so i started with downgrading again . Is there a way to track the error down? Whats happening inside the memory/application, that causes the date formats to break.

Versions:

  • Rails 4.2.10
  • Ruby 2.3.1
  • i18n 0.9.1

We use a yml-file for the formats

de:
  date:
    formats:
     default: "%d.%m.%Y"
     short_year: "%d.%m.%y"
     short: "%e. %b"
     long: "%e. %B %Y"
     only_day: "%e"
Skully
  • 485
  • 4
  • 13
  • One possible issue might be due to different versions of Gem. Do you have `Gemfile.lock` checked to git? – Deepak Mahakale Aug 23 '18 at 08:46
  • No that isn't the problem, the .lock-file is checked in. – Skully Aug 23 '18 at 09:00
  • Weird. Is it possible you edit your i18n files in runtime? Is this change happening on the whole system or in just some parts? Maybe some gem or library is playing with i18n.locale in some places and the change remains for the rest of a request, or maybe among requests? – dgilperez Aug 24 '18 at 15:58

0 Answers0