{"record":{"id":"ca8b3df05b67fd18","repo":"nicolargo/glances","slug":"unknown-plugin-plugin-available-plugins-self","errorCode":null,"errorMessage":"Unknown plugin {plugin} (available plugins: {self.plugins_list})","messagePattern":"Unknown plugin (.+?) \\(available plugins: (.+?)\\)","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"warning","filePath":"glances/outputs/glances_restful_api.py","lineNumber":1013,"sourceCode":"        \"\"\"\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\n            statval = self.stats.get_plugin(plugin).get_api()\n        except Exception as e:\n            raise HTTPException(status.HTTP_404_NOT_FOUND, f\"Cannot get plugin {plugin} ({str(e)})\")\n\n        return GlancesJSONResponse(statval)\n\n    def _check_if_plugin_available(self, plugin: str) -> None:\n        if plugin in self.plugins_list:\n            return\n\n        raise HTTPException(\n            status.HTTP_400_BAD_REQUEST, f\"Unknown plugin {plugin} (available plugins: {self.plugins_list})\"\n        )\n\n    def _api_top(self, plugin: str, nb: int = 0):\n        \"\"\"Glances API RESTful implementation.\n\n        Return the JSON representation of a given plugin limited to the top nb items.\n        It is used to reduce the payload of the HTTP response (example: processlist).\n\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","sourceCodeStart":995,"sourceCodeEnd":1031,"githubUrl":"https://github.com/nicolargo/glances/blob/a240d8dfb3105a38b5964357ec21768594b0e83e/glances/outputs/glances_restful_api.py#L995-L1031","documentation":"Raised as HTTP 400 when the requested plugin name is not in the server's plugins_list. This is a client error: the endpoint exists but the plugin is unknown or not loaded. The message lists all available plugins to guide correction.","triggerScenarios":"GET /api/4/<plugin> (and /top, /history, /limits, /item, /key variants) with a misspelled plugin name, a plugin disabled via --disable-plugin, or a plugin unavailable on the platform (e.g., 'gpu' with no NVIDIA hardware).","commonSituations":"Clients hardcoding plugin names from a different glances version, typos like 'mem' vs 'memswap', or querying platform-specific plugins on unsupported hosts.","solutions":["GET /api/4/plugins first and use an exact name from the returned list","Check the 400 body — it enumerates available plugins","Re-enable the plugin by removing it from --disable-plugin or adding it to --enable-plugin","Verify the plugin is supported on your OS/hardware"],"exampleFix":"// before\nGET /api/4/gpu\n// after\nGET /api/4/plugins   // confirm name, then\nGET /api/4/gpu","handlingStrategy":"validation","validationCode":"AVAILABLE = set(httpx.get(f'{BASE}/api/4/plugins').json())\nif plugin not in AVAILABLE:\n    raise ValueError(f'{plugin} not in {sorted(AVAILABLE)}')","typeGuard":"def is_known_plugin(name: str, available: list[str]) -> bool:\n    return isinstance(name, str) and name in available","tryCatchPattern":"try:\n    r = httpx.get(f'{BASE}/api/4/{plugin}')\n    r.raise_for_status()\nexcept httpx.HTTPStatusError as e:\n    if e.response.status_code == 400:\n        available = e.response.json()['detail'].split('available plugins: ')[-1]\n        raise ValueError(f'unknown plugin, choose from {available}') from e\n    raise","preventionTips":["Cache /api/4/plugins at client startup and validate names","Use exact names, no aliases or guesses"],"tags":["glances","rest-api","http-400","unknown-plugin"],"backgroundTag":"invalid-request-parameter","analyzedSha":"a240d8dfb3105a38b5964357ec21768594b0e83e","analyzedAt":"2026-08-27T19:15:19.178Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}