Skip to content

Encoding issue with old backup file #214

@marocchino

Description

@marocchino

Describe the bug

There have been reports that encoding errors occur after a major version upgrade if there is a backup from a previous version. When this symptom is present, get variant always returns with disabled.

Steps to reproduce the bug

  1. install unleash 5.1.1
  2. make backup file with Unleash::Client.new
  3. update unleash 6.0.8
  4. Unleash::Client.new again

Expected behavior

no error

Logs, error output, etc.

[2024/11/18 18:13:52]   INFO    [Unleash] ERROR: Error when sending report to unleash server. Server responded with http code 400.

---

[1] protodev 3.2.5-p208(main)> Rails.configuration.unleash = Unleash::Client.new
[Unleash] ERROR: Unable to save backup file. Exception thrown Encoding::UndefinedConversionError:'"\xE3" from ASCII-8BIT to UTF-8'
[Unleash] ERROR: stacktrace: ["/data/pksys/pokota/shared/bundle/ruby/3.2.0/gems/unleash-6.0.8/lib/unleash/toggle_fetcher.rb:65:in `write'" 
... 省略 ...

[4] protodev 3.2.5-p208(main)> FeatureToggle.new('ft0000_nextgen', User.find(187), nil, Time.zone.now, country).enabled
[Shard: main_r]  [pokota_protodev2016] replica User Load (2.4ms)  SELECT `users`.* FROM `users` WHERE `users`.`id` = 187 LIMIT 1
[Shard: main_r]  [pokota_protodev2016] replica UserRankPoint Load (2.3ms)  SELECT `user_rank_points`.* FROM `user_rank_points` WHERE `user_rank_points`.`user_id` = 187 LIMIT 1
false

Screenshots

No response

Additional context

No response

Unleash version

No response

Subscription type

Pro

Hosting type

Hosted by Unleash

SDK information (language and version)

ruby 6.0.8

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions