{"record":{"id":"237807459395a28b","repo":"nicolargo/glances","slug":"cannot-get-views-for-plugin-plugin-str-e","errorCode":null,"errorMessage":"Cannot get views for plugin {plugin} ({str(e)})","messagePattern":"Cannot get views for plugin (.+?) \\((.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"error","filePath":"glances/outputs/glances_restful_api.py","lineNumber":1100,"sourceCode":"\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\n            ret = self.stats.get_plugin(plugin).get_views()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get views for plugin {plugin} ({str(e)})\")\n\n        return GlancesJSONResponse(ret)\n\n    def _api_item(self, plugin: str, item: str):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON representation of the couple plugin/item\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 views","sourceCodeStart":1082,"sourceCodeEnd":1118,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_restful_api.py#L1082-L1118","documentation":"Raised when get_views() fails for a known plugin, returned as HTTP 404. The availability check passed, so the plugin's view structure itself could not be produced. Original exception is embedded in the message.","triggerScenarios":"GET /api/4/<plugin>/views where get_views() raises — e.g., a plugin whose items description dict is malformed after a partial upgrade.","commonSituations":"Mixed-version installations, or out-of-tree plugins not following the views schema expected by this glances release.","solutions":["Inspect the 404 body and server logs for the underlying error","Upgrade/reinstall glances to align plugin and core versions","Isolate by querying other plugins' views"],"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    views = httpx.get(f'{BASE}/api/4/{plugin}/views').json()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 404:\n        views = {}  # views are optional display metadata\n    else:\n        raise","preventionTips":["Treat views as optional metadata with a safe default","Keep glances version consistent to avoid view schema drift"],"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"}