We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
AuditLog (required for webhooks) is not created when a segment override (FeatureStateValue) is deleted
FeatureStateValue
Attaching api server logs when this happens
[12/Nov/2024 12:39:28] "GET /api/v1/features/feature-segments/?environment=1&feature=2 HTTP/1.1" 200 52 FeatureSegment for second_button with priority 0 Exception in thread Thread-8 (create_audit_log_from_historical_record): Traceback (most recent call last): File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 218, in __get__ rel_obj = self.field.get_cached_value(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/fields/mixins.py", line 15, in get_cached_value Project proj p1 - Environment Development - Feature second_button - Enabled: True return instance._state.fields_cache[cache_name] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^ KeyError: 'feature_state' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/miniconda3/envs/flagsmith/lib/python3.12/threading.py", line 1073, in _bootstrap_inner self.run() File "/opt/miniconda3/envs/flagsmith/lib/python3.12/threading.py", line 1010, in run self._target(*self._args, **self._kwargs) File "/Users/instinct/Desktop/flagsmith/api/audit/tasks.py", line 94, in create_audit_log_from_historical_record [12/Nov/2024 12:39:28] "GET /api/v1/features/featurestates/?environment=1&feature=2 HTTP/1.1" 200 1057 environment, project = instance.get_environment_and_project() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/instinct/Desktop/flagsmith/api/core/models.py", line 141, in get_environment_and_project environment, project = self._get_environment(), self._get_project() ^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/instinct/Desktop/flagsmith/api/features/models.py", line 1136, in _get_environment return self.feature_state.environment ^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 236, in __get__ rel_obj = self.get_object(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 366, in get_object return super().get_object(instance) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/fields/related_descriptors.py", line 199, in get_object return qs.get(self.field.get_reverse_related_filter(instance)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/miniconda3/envs/flagsmith/lib/python3.12/site-packages/django/db/models/query.py", line 637, in get raise self.model.DoesNotExist( features.models.FeatureState.DoesNotExist: FeatureState matching query does not exist. [12/Nov/2024 12:39:28] "GET /api/v1/projects/1/features/2/ HTTP/1.1" 200 659
main
No errors to be thrown on the api server. Audit Log should get created.
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
How are you running Flagsmith
Describe the bug
AuditLog (required for webhooks) is not created when a segment override (
FeatureStateValue
) is deletedAttaching api server logs when this happens
Steps To Reproduce
Installation
main
branchExpected behavior
No errors to be thrown on the api server.
Audit Log should get created.
Screenshots
No response
The text was updated successfully, but these errors were encountered: