{"record":{"id":"59823e9d3eceeb76","repo":"nicolargo/glances","slug":"cannot-get-limits-str-e","errorCode":null,"errorMessage":"Cannot get limits ({str(e)})","messagePattern":"Cannot get limits \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"glances/outputs/glances_restful_api.py","lineNumber":968,"sourceCode":"            statval = self.stats.getAllAsDict()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get stats ({str(e)})\")\n\n        return GlancesJSONResponse(statval)\n\n    def _api_all_limits(self):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON representation of all the plugins limits\n        HTTP/200 if OK\n        HTTP/400 if plugin is not found\n        HTTP/404 if others error\n        \"\"\"\n        try:\n            # Get the RAW value of the stat limits\n            limits = self.stats.getAllLimitsAsDict()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get limits ({str(e)})\")\n\n        return GlancesJSONResponse(limits)\n\n    def _api_all_views(self):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON representation of all the plugins views\n        HTTP/200 if OK\n        HTTP/400 if plugin is not found\n        HTTP/404 if others error\n        \"\"\"\n        try:\n            # Get the RAW value of the stat view\n            limits = self.stats.getAllViewsAsDict()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get views ({str(e)})\")\n\n        return GlancesJSONResponse(limits)","sourceCodeStart":950,"sourceCodeEnd":986,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_restful_api.py#L950-L986","documentation":"Raised when getAllLimitsAsDict() fails on the limits endpoint, returned as HTTP 404. Limits describe care/warning/critical thresholds across plugins; failure means the limits model could not be composed. Underlying exception text is included.","triggerScenarios":"GET /api/4/all_limits when aggregating per-plugin limits raises — e.g., a plugin with a malformed limits configuration (glances.conf) or a missing get_limits implementation.","commonSituations":"Custom configuration files with invalid section keys, or third-party/out-of-tree plugins that do not implement the limits API.","solutions":["Inspect the server log for the wrapped exception to find the offending plugin","Validate the [limits] sections and plugin config keys in glances.conf","Disable suspect plugins and retry the endpoint"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    limits = httpx.get(f'{BASE}/api/4/all_limits').json()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        limits = {}  # limits are optional metadata\n    else:\n        raise","preventionTips":["Treat limits as optional enrichment, not critical data","Validate custom limits sections in glances.conf"],"tags":["glances","rest-api","http-404","limits"],"backgroundTag":"http-404-resource-not-found","analyzedSha":"a240d8dfb3105a38b5964357ec21768594b0e83e","analyzedAt":"2026-08-27T19:15:19.178Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}