{"record":{"id":"6fd9e93b9c1bdb22","repo":"makeplane/plane","slug":"please-check-the-view","errorCode":null,"errorMessage":"Please check the view","messagePattern":"Please check the view","errorType":"http","errorClass":"APIException","httpStatus":400,"severity":"error","filePath":"apps/api/plane/api/views/base.py","lineNumber":168,"sourceCode":"        expand = [expand for expand in self.request.GET.get(\"expand\", \"\").split(\",\") if expand]\n        return expand if expand else None\n\n\nclass BaseViewSet(TimezoneMixin, ReadReplicaControlMixin, ModelViewSet, BasePaginator):\n    model = None\n\n    authentication_classes = [APIKeyAuthentication]\n    permission_classes = [\n        IsAuthenticated,\n    ]\n    use_read_replica = False\n\n    def get_queryset(self):\n        try:\n            return self.model.objects.all()\n        except Exception as e:\n            log_exception(e)\n            raise APIException(\"Please check the view\", status.HTTP_400_BAD_REQUEST)\n\n    def handle_exception(self, exc):\n        \"\"\"\n        Handle any exception that occurs, by returning an appropriate response,\n        or re-raising the error.\n        \"\"\"\n        try:\n            response = super().handle_exception(exc)\n            return response\n        except Exception as e:\n            if isinstance(e, IntegrityError):\n                log_exception(e)\n                return Response(\n                    {\"error\": \"The payload is not valid\"},\n                    status=status.HTTP_400_BAD_REQUEST,\n                )\n\n            if isinstance(e, ValidationError):","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/api/plane/api/views/base.py#L150-L186","documentation":"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.","triggerScenarios":"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.","commonSituations":"New view subclass missing the model attribute; DB connection pool exhausted; migration leaving a table in a bad state; custom manager __init__ failing.","solutions":["Read server logs: log_exception(e) captured the real traceback — find it there, not in the HTTP response.","Ensure the view subclass defines model correctly and the table is migrated.","Check DB connectivity and the use_read_replica setting.","If this masks a recurring DB issue, consider re-raising the original for 5xx instead of a blanket 400."],"exampleFix":"# before\nclass MyView(BaseAPIView):\n    # model attribute missing\n    ...\n\n# after\nclass MyView(BaseAPIView):\n    model = MyModel\n    ...","handlingStrategy":"try-catch","validationCode":"# sanity check the subclass at import time\nclass MyView(BaseAPIView):\n    model = MyModel\n    assert MyView.model is not None","typeGuard":null,"tryCatchPattern":"try:\n    resp = view.get_queryset()\nexcept APIException as e:\n    if str(e.detail) == 'Please check the view':\n        log_server_traceback();  # real cause is in server logs\n        raise","preventionTips":["Always set model on BaseAPIView subclasses","Watch server logs (log_exception) for the real cause","Validate use_read_replica and DB health","Run migrations before deploying views"],"tags":["django-rest","view","database","error-handling","api"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}