Skip to content

FeatureSegment.DoesNotExist in tasks.create_audit_log_from_historical_record #6792

@sentry

Description

@sentry

Likely, should be gated by hasattr:

Sentry Issue: FLAGSMITH-API-5J0

KeyError: 'feature_segment'
  File "django/db/models/fields/related_descriptors.py", line 243, in __get__
    rel_obj = self.field.get_cached_value(instance)
  File "django/db/models/fields/mixins.py", line 37, in get_cached_value
    return instance._state.fields_cache[self.cache_name]

FeatureSegment.DoesNotExist: FeatureSegment matching query does not exist.
(5 additional frame(s) were not displayed)
...
  File "audit/tasks.py", line 117, in create_audit_log_from_historical_record
    log_message = {
  File "features/models.py", line 974, in get_update_log_message
    elif self.feature_segment:

Failed to execute task 'tasks.create_audit_log_from_historical_record', with id 405918555. Exception: FeatureSegment matching query does not exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiIssue related to the REST API

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions