{"record":{"id":"75b99f0257fe0bc9","repo":"nicolargo/glances","slug":"cannot-get-limits-for-plugin-plugin-str-e","errorCode":null,"errorMessage":"Cannot get limits for plugin {plugin} ({str(e)})","messagePattern":"Cannot get limits for plugin (.+?) \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"glances/outputs/glances_restful_api.py","lineNumber":1079,"sourceCode":"            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get plugin history {plugin} ({str(e)})\")\n\n        return statval\n\n    def _api_limits(self, plugin: str):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON limits of a given plugin\n        HTTP/200 if OK\n        HTTP/400 if plugin is not found\n        HTTP/404 if others error\n        \"\"\"\n        self._check_if_plugin_available(plugin)\n\n        try:\n            # Get the RAW value of the stat limits\n            ret = self.stats.get_plugin(plugin).get_limits()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get limits for plugin {plugin} ({str(e)})\")\n\n        return GlancesJSONResponse(ret)\n\n    def _api_views(self, plugin: str):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON views of a given plugin\n        HTTP/200 if OK\n        HTTP/400 if plugin is not found\n        HTTP/404 if others error\n        \"\"\"\n        if plugin not in self.plugins_list:\n            raise HTTPException(\n                status.HTTP_400_BAD_REQUEST, f\"Unknown plugin {plugin} (available plugins: {self.plugins_list})\"\n            )\n\n        try:\n            # Get the RAW value of the stat views","sourceCodeStart":1061,"sourceCodeEnd":1097,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_restful_api.py#L1061-L1097","documentation":"Raised when get_limits() fails for a specific plugin, returned as HTTP 404. The plugin is known (availability was checked), so the failure is in reading its limits — often defaults plus configuration merge issues. Underlying exception is included.","triggerScenarios":"GET /api/4/<plugin>/limits when get_limits() raises — e.g., malformed configuration values in the plugin's limits section.","commonSituations":"Hand-edited glances.conf with invalid values, or a plugin version whose limits keys changed between releases.","solutions":["Check the embedded exception and server log","Validate the plugin section in glances.conf against current documentation","Upgrade glances so config keys match the plugin implementation"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"AVAILABLE = set(httpx.get(f'{BASE}/api/4/plugins').json())\nassert plugin in AVAILABLE","typeGuard":null,"tryCatchPattern":"try:\n    limits = httpx.get(f'{BASE}/api/4/{plugin}/limits').json()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        limits = {}\n    else:\n        raise","preventionTips":["Validate plugin name first","Lint custom limits config 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"}