Skip to content

Returning "name": "disabled" when getting variants using Python SDK #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
renzpaoloabergos opened this issue Mar 15, 2022 · 5 comments
Closed
Assignees

Comments

@renzpaoloabergos
Copy link

Describe the bug
When using the unleash client's get_variant function, we are receiving unexpected results:

context = {"userId": "YdTFXyyh463XQbZK"}
variant = unleash_client.get_variant("live.gbdt_v5_20220309_active_user", context)

Result:
{'name': 'disabled', 'enabled': True}

To Reproduce
Steps to reproduce the behavior:

  1. Create feature toggle with the name live.gbdt_v5_20220309_active_user
  2. Populate at least 1 random variant
  3. Try getting a variant with that user id and feature toggle name

Expected behavior
We expect it to return a randomized variant with its payload.

Logs

{'userId': 'YdTFXyyh463XQbZK'}
FEATURE TOGGLE: live.gbdt_v5_20220309_active_user
ENABLED:  True
VARIANT:  {'name': 'disabled', 'enabled': True}

Additional context
Add any other context about the problem here.

@ivanklee86
Copy link
Collaborator

Hello!

ucp generally returns a disabled when the feature flag isn't enabled (or there's some other weird provisioning) or there's no variants.

I set up this test feature flag and was able to get the expected behavior.

However, there's the possibility it might set the enabled flag if there was an exception during evaluation: here

However! I did find that I had somehow accidently disabled logging for unleashclient. o.O I'm going to release a new version this AM with a fix. Would you mind retesting after it's released?

@ivanklee86 ivanklee86 self-assigned this Mar 15, 2022
@ivanklee86 ivanklee86 mentioned this issue Mar 15, 2022
15 tasks
@ivanklee86
Copy link
Collaborator

Could you pleas try again with v5.1.1?

@renzpaoloabergos
Copy link
Author

Hi @ivanklee86 tried it and can see logs in our instance, example:

Unable to get feature flag toggles, using cached provisioning.

However, the {'name': 'disabled', 'enabled': True} is still weird. Feature toggle is enabled (also checked if initialized, even lowered the refresh interval) but still uses the disabled variation..

@renzpaoloabergos
Copy link
Author

Thanks for reaching out and trying to explain how it occurs! 💯

@ivarconr
Copy link
Member

Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants