You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Projects imported from SaaS into a self-hosted environment with enable_dynamo_db: true cannot be used and require manual intervention. The API returns 500 on some requests, and the frontend incorrectly displays this error message:
Steps To Reproduce
Import an organisation from SaaS, making sure a project has enable_dynamo_db: true. Alternatively, manually enable enable_dynamo_db on any self-hosted project from Django Admin
The frontend calls GET /api/v1/projects/<project_id>/features when loading, which returns a 500 and shows an incorrect error message. Users are blocked at this point
API stacktrace
django.request ERROR Internal Server Error: /api/v1/projects/3/features/
Traceback (most recent call last):
File "/build/.venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/rest_framework/viewsets.py", line 124, in view
return self.dispatch(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/build/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/build/.venv/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/django/utils/decorators.py", line 46, in _wrapper
return bound_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/rest_framework/mixins.py", line 42, in list
serializer = self.get_serializer(page, many=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/build/.venv/lib/python3.11/site-packages/rest_framework/generics.py", line 113, in get_serializer
kwargs.setdefault('context', self.get_serializer_context())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/features/views.py", line 218, in get_serializer_context
context["overrides_data"] = get_overrides_data(
^^^^^^^^^^^^^^^^^^^
File "/app/features/features_service.py", line 33, in get_overrides_data
return get_edge_overrides_data(environment, feature_ids)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/features/features_service.py", line 106, in get_edge_overrides_data
for identity_overrides_v2_list in get_overrides_data_future.result():
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/edge_api/identities/edge_identity_service.py", line 33, in get_edge_identity_overrides_for_feature_ids
ddb_environment_v2_wrapper.get_identity_overrides_by_environment_id(
File "/app/environments/dynamodb/wrappers/environment_wrapper.py", line 103, in get_identity_overrides_by_environment_id
results = [future.result() for future in futures]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/environments/dynamodb/wrappers/environment_wrapper.py", line 103, in <listcomp>
results = [future.result() for future in futures]
^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
return self.__get_result()
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
raise self._exception
File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/environments/dynamodb/wrappers/environment_wrapper.py", line 112, in get_identity_overrides_page
query_response = self.table.query(
^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'query'
Expected behavior
Support importing SaaS orgs directly without manual intervention, and display a correct error message in response to 500 errors.
I don't have an opinion as to how this can be achieved - for example, overriding the value of enable_dynamo_db during export or import, or ignoring its value altogether when self-hosting.
Screenshots
No response
The text was updated successfully, but these errors were encountered:
How are you running Flagsmith
Describe the bug
Projects imported from SaaS into a self-hosted environment with
enable_dynamo_db: true
cannot be used and require manual intervention. The API returns 500 on some requests, and the frontend incorrectly displays this error message:Steps To Reproduce
enable_dynamo_db: true
. Alternatively, manually enableenable_dynamo_db
on any self-hosted project from Django AdminGET /api/v1/projects/<project_id>/features
when loading, which returns a 500 and shows an incorrect error message. Users are blocked at this pointAPI stacktrace
Expected behavior
Support importing SaaS orgs directly without manual intervention, and display a correct error message in response to 500 errors.
I don't have an opinion as to how this can be achieved - for example, overriding the value of
enable_dynamo_db
during export or import, or ignoring its value altogether when self-hosting.Screenshots
No response
The text was updated successfully, but these errors were encountered: