{"record":{"id":"2bc81181635b9462","repo":"nicolargo/glances","slug":"cannot-get-views-str-e","errorCode":null,"errorMessage":"Cannot get views ({str(e)})","messagePattern":"Cannot get views \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"glances/outputs/glances_restful_api.py","lineNumber":984,"sourceCode":"            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)\n\n    def _api(self, plugin: str):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON representation 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        # Update the stat\n        self.__update_stats(get_plugin_dependencies(plugin))\n\n        try:\n            # Get the RAW value of the stat ID","sourceCodeStart":966,"sourceCodeEnd":1002,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_restful_api.py#L966-L1002","documentation":"Raised when getAllViewsAsDict() fails on the views endpoint, returned as HTTP 404. Views describe how each plugin item is displayed; failure means one plugin's view structure could not be built. The message embeds the original exception.","triggerScenarios":"GET /api/4/all_views when any plugin's get_views() raises — commonly a plugin whose items dict is missing or has an unexpected shape in this glances version.","commonSituations":"Mixing plugin versions after a partial upgrade, or custom plugins not following the GlancesPlugin views contract.","solutions":["Check the server log for the underlying exception identifying the failing plugin","Upgrade glances fully (core + bundled plugins) to a consistent version","Test per-plugin views via GET /api/4/<plugin>/views to isolate the culprit"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    views = httpx.get(f'{BASE}/api/4/all_views').json()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        views = {}\n    else:\n        raise","preventionTips":["Fetch per-plugin views to isolate failures","Keep glances installation consistent (single version)"],"tags":["glances","rest-api","http-404","views"],"backgroundTag":"http-404-resource-not-found","analyzedSha":"a240d8dfb3105a38b5964357ec21768594b0e83e","analyzedAt":"2026-08-27T19:15:19.178Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}