ankane / logstop

Keep personal data out of your logs
MIT License
240 stars 13 forks source link

Rack::Timeout::RequestTimeoutException #7

Closed dalezak closed 4 years ago

dalezak commented 4 years ago

I've been having some timeout issues, and noticed one error report mentioned logstop.rb in scrub at line 21:

18. msg = msg.to_s.dup
19. 
20. # order filters are applied is important
21. msg.gsub!(URL_PASSWORD_REGEX, FILTERED_URL_STR)
22. msg.gsub!(EMAIL_REGEX, FILTERED_STR)
23. msg.gsub!(CREDIT_CARD_REGEX, FILTERED_STR)
24. msg.gsub!(CREDIT_CARD_REGEX_DELIMITERS, FILTERED_STR)

logstop.rb in scrub at line 21
logstop/formatter.rb in call at line 12
logger.rb in format_message at line 582
logger.rb in add at line 472
active_record/session_store/extension/logger_silencer.rb in add_with_threadsafety at line 38
active_support/logger_thread_safe_level.rb in add at line 53
logger.rb in info at line 525

Have you ran into any issues like this before?

ankane commented 4 years ago

Hey @dalezak, rack-timeout will raise an exception in whatever code it's executing when the time limit is reached. My best guess is the process is in the middle of logging some of the time when a timeout occurs.

ankane commented 4 years ago

Closing due to no response

kwent commented 1 year ago

Running into the same issues, could we use https://blog.saeloun.com/2022/08/09/ruby-introduces-regexp-timeout somehow ?

ankane commented 1 year ago

I don't think it's an issue with Logstop, so not sure that'll help.

kwent commented 1 year ago

Might be good to begin rescue Regexp::TimeoutError, and return msg = 'REDACTED'. Kind of deal.