stripe/stripe-ruby

Encoding::UndefinedConversionError with STRIPE_LOG_LEVEL=debug

EugeneGrigorenko opened this issue · 1 comments

Describe the bug

When retrieving invoices with log-level debug I'm getting UndefinedConversionError for any invoice except those created manually using UI.

This does not happen when I change STRIPE_LOG_LEVEL to info.

To Reproduce

  1. Set Stripe.log_level to debug
  2. Try fetching an invoice.

Expected behavior

Should not error out and return the invoice

Code snippets

irb(main):090:0> invoice = Stripe::Invoice.retrieve( '<id>')
INFO Request to Stripe API method=get num_retries=0 path=/v1/invoices/<id>
DEBU Request details query= process_id=33848 thread_object_id=67660 log_timestamp=1047648.317347
DEBU ConnectionManager starting request method_name=GET path="/v1/invoices/<id>?" process_id=33848 thread_object_id=67660 connection_manager_object_id=110300 connection_object_id=110320 log_timestamp=1047648.317607
DEBU ConnectionManager request complete method_name=GET path="/v1/invoices/<id>?" process_id=33848 thread_object_id=67660 connection_manager_object_id=110300 connection_object_id=110320 response_object_id=942060 log_timestamp=1047648.582633
INFO Response from Stripe API api_version=2020-08-27 elapsed=0.2655479999957606 method=get path=/v1/invoices/<id> request_id=req_ZBmj0CEgCXyk0t status=200
ERRO Request error elapsed=0.26612899999599904 error_message="\"\xC3\" from ASCII-8BIT to UTF-8" method=get path=/v1/invoices/in_1L08IbDSlLoj86tb07LHpLaA
/Users/eugenegrigorenko/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/stripe-6.0.0/lib/stripe/util.rb:369:in `write': "\xC3" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)
irb(main):091:0>


### OS

macOS

### Language version

3.1.0

### Library version

stripe (6.0.0)

### API version

2020-08-27

### Additional context

_No response_

Thanks for the report @EugeneGrigorenko and sorry you're having issues.

The team will investigate this and hopefully have a fix out shortly!