flipt icon indicating copy to clipboard operation
flipt copied to clipboard

[Bug]: export fails on variant flag with no rules

Open danilobuerger opened this issue 1 year ago • 10 comments

Bug Description

If you create a variant flag that does not have rules yet, the export will error out with

wrong format for rule segments

Version Info

1.48.1

Search

  • [X] I searched for other open and closed issues before opening this

Steps to Reproduce

  1. create a variant flag
  2. export

Expected Behavior

The export should work even if there are no rules attached

Additional Context

No response

danilobuerger avatar Aug 30 '24 13:08 danilobuerger

Hi @danilobuerger. Thank you for your bug report

I can't repo the problem with your steps. This issue could happen when some rule has the reference to the deleted segment. This most-likely is related to #2403.

erka avatar Aug 30 '24 19:08 erka

I am having the same error, but somehow I am unable to find a rule that references a deleted segment (probably because no segment was ever deleted). So what to do in such a case?

PlkMarudny avatar Oct 09 '24 08:10 PlkMarudny

@PlkMarudny Thank you for the report. Could you please provide an example file which reproduces the issue you have? We really want to find and fix this issue.

erka avatar Oct 09 '24 12:10 erka

Sure, will flipt.db do the trick?

PlkMarudny avatar Oct 09 '24 12:10 PlkMarudny

Yep, it will do the trick. Could you please tell us the version of Flipt you are using as well?

erka avatar Oct 09 '24 12:10 erka

1.47.1

PlkMarudny avatar Oct 09 '24 13:10 PlkMarudny

Sorry @erka . I forgot to answer. My issue was indeed caused by https://github.com/flipt-io/flipt/issues/2403

danilobuerger avatar Oct 09 '24 15:10 danilobuerger

flipt.zip

PlkMarudny avatar Oct 11 '24 08:10 PlkMarudny

@PlkMarudny thank you for sharing this with us.

Just a heads up. There are two flags agency(one rule 8fa497aa-74c9-41fd-bb34-6e288626669b) and content_type(two rules 228724f7-dce9-4e53-9dc5-0dadce2abb0e and 8a698eb0-016e-453d-88ab-d646f4c7fcea) which are broken. Both have rules without segments. The weird thing is that UI doesn't display those rules and it looks like everything is correct. The only insight that something is out of order that content_type flag is missing rule number 5.

erka avatar Oct 11 '24 12:10 erka

@danilobuerger What database do you use for Flipt?

erka avatar Oct 12 '24 16:10 erka

@danilobuerger @PlkMarudny I have addressed the root cause of this issue with #3552. Additionally, I enhanced the error message for the export command and improved the user interface to better display the problem, facilitating easier identification and resolution. Unfortunately, I am unable to resolve the database inconsistency. I apologize for any inconvenience this may have caused.

erka avatar Oct 21 '24 20:10 erka

No problem, I understand. Thanks for that.

On Tue, Oct 22, 2024, 00:13 Roman Dmytrenko @.***> wrote:

@danilobuerger https://github.com/danilobuerger @PlkMarudny https://github.com/PlkMarudny I have addressed the root cause of this issue with ticket #3552 https://github.com/flipt-io/flipt/pull/3552. Additionally, I enhanced the error message for the export command and improved the user interface to better display the problem, facilitating easier identification and resolution. Unfortunately, I am unable to resolve the database inconsistency. I apologize for any inconvenience this may have caused.

— Reply to this email directly, view it on GitHub https://github.com/flipt-io/flipt/issues/3417#issuecomment-2427627784, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBI255TIMEWNURMW4U7YMLZ4VN47AVCNFSM6AAAAABNMPDL2GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMRXGYZDONZYGQ . You are receiving this because you were mentioned.Message ID: @.***>

PlkMarudny avatar Oct 22 '24 07:10 PlkMarudny

Thats awesome, thanks for fixing it!

danilobuerger avatar Oct 22 '24 14:10 danilobuerger