makeplane/plane · error · APIException

Please check the view

Error message

Please check the view

What it means

In apps/api/plane/api/views/base.py the base view's get_queryset wraps self.model.objects.all() in a broad try/except. Any exception at all (DB error, misconfigured model attribute, import issue) is logged and re-raised as a generic APIException 'Please check the view' with HTTP 400. The message is non-specific because the original exception is swallowed — it deliberately hides the real cause from the response.

Source

Thrown at apps/api/plane/api/views/base.py:168

        expand = [expand for expand in self.request.GET.get("expand", "").split(",") if expand]
        return expand if expand else None


class BaseViewSet(TimezoneMixin, ReadReplicaControlMixin, ModelViewSet, BasePaginator):
    model = None

    authentication_classes = [APIKeyAuthentication]
    permission_classes = [
        IsAuthenticated,
    ]
    use_read_replica = False

    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):
                log_exception(e)
                return Response(
                    {"error": "The payload is not valid"},
                    status=status.HTTP_400_BAD_REQUEST,
                )

            if isinstance(e, ValidationError):

View on GitHub (pinned to 1c8a60f858)

Solutions

  1. Read server logs: log_exception(e) captured the real traceback — find it there, not in the HTTP response.
  2. Ensure the view subclass defines model correctly and the table is migrated.
  3. Check DB connectivity and the use_read_replica setting.
  4. If this masks a recurring DB issue, consider re-raising the original for 5xx instead of a blanket 400.

Example fix

# before
class MyView(BaseAPIView):
    # model attribute missing
    ...

# after
class MyView(BaseAPIView):
    model = MyModel
    ...
Defensive patterns

Strategy: try-catch

Validate before calling

# sanity check the subclass at import time
class MyView(BaseAPIView):
    model = MyModel
    assert MyView.model is not None

Try / catch

try:
    resp = view.get_queryset()
except APIException as e:
    if str(e.detail) == 'Please check the view':
        log_server_traceback();  # real cause is in server logs
        raise

Prevention

When it happens

Trigger: A subclass forgets to set self.model, or sets it to a non-queryset; the database is unreachable during the request; a model manager raises; a read-replica misconfiguration causes a connection error.

Common situations: New view subclass missing the model attribute; DB connection pool exhausted; migration leaving a table in a bad state; custom manager __init__ failing.

Related errors


AI-assisted analysis of makeplane/plane@1c8a60f858 (2026-08-12). Data as JSON: /api/errors/6fd9e93b9c1bdb22. Report an issue: GitHub.