makeplane/plane · error · APIException
Please check the view
Error message
Please check the view
What it means
Generic APIException (HTTP 400) raised by `BaseViewSet.get_queryset` in space/views/base.py when ANY exception occurs while calling `self.model.objects.all()`. The real exception is logged via `log_exception` but masked from the client behind the unhelpful 'Please check the view' message. Because the try wraps a trivial ORM call, this usually indicates a misconfigured view rather than bad client input.
Source
Thrown at apps/api/plane/space/views/base.py:63
class BaseViewSet(TimezoneMixin, ModelViewSet, BasePaginator):
model = None
permission_classes = [IsAuthenticated]
filter_backends = (DjangoFilterBackend, SearchFilter)
authentication_classes = [BaseSessionAuthentication]
filterset_fields = []
search_fields = []
def get_queryset(self):
try:
return self.model.objects.all()
except Exception as e:
log_exception(e)
raise APIException("Please check the view", status.HTTP_400_BAD_REQUEST)
def handle_exception(self, exc):
"""
Handle any exception that occurs, by returning an appropriate response,
or re-raising the error.
"""
try:
response = super().handle_exception(exc)
return response
except Exception as e:
if isinstance(e, IntegrityError):
return Response(
{"error": "The payload is not valid"},
status=status.HTTP_400_BAD_REQUEST,
)
if isinstance(e, ValidationError):
return Response(View on GitHub (pinned to 1c8a60f858)
Solutions
- Ensure your BaseViewSet subclass sets `model = YourModel` (and a proper `get_queryset` override if scoping is needed).
- Check `log_exception` output / server logs for the real underlying exception - the client message hides it.
- Run migrations (`python manage.py migrate`) if the model's table is missing.
- Consider returning 500 (not 400) for genuine server-side failures; 400 implies client error which is misleading here.
Example fix
# before
class MyViewSet(BaseViewSet):
model = None # triggers the catch
# after
class MyViewSet(BaseViewSet):
model = Workspace
def get_queryset(self):
return self.model.objects.filter(workspace__slug=self.workspace_slug) Defensive patterns
Strategy: try-catch
Validate before calling
def viewset_is_well_configured(viewset_cls) -> bool:
# BaseViewSet subclass must define `model`
return getattr(viewset_cls, 'model', None) is not None Try / catch
# In your viewset override, narrow the catch instead of trusting the generic one
def get_queryset(self):
if self.model is None:
raise RuntimeError(f'{type(self).__name__} did not set model')
return self.model.objects.all() Prevention
- Always set `model` (and override get_queryset with scoping) on BaseViewSet subclasses.
- Inspect log_exception output - the client message hides the real cause.
- Keep migrations applied so model tables exist.
- Consider returning 500 for genuine server faults; 400 mislabels them as client errors.
When it happens
Trigger: Any Space-app ModelViewSet request where `self.model` is None or unset, the model table is missing/migrated incorrectly, or the DB connection raises. The handler converts every such failure into a 400 with 'Please check the view'.
Common situations: Subclass of BaseViewSet that forgot to set the `model` class attribute; pointing at a model whose DB table does not exist (missing migration); database connectivity loss mid-request; serializer/permission code that runs inside get_queryset indirectly.
Related errors
AI-assisted analysis of makeplane/plane@1c8a60f858 (2026-08-12).
Data as JSON: /api/errors/59688f19006d8a41.
Report an issue: GitHub.