nicolargo/glances · warning · HTTPException
Unknown plugin {plugin} (available plugins: {self.plugins_li
Error message
Unknown plugin {plugin} (available plugins: {self.plugins_list}) What it means
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.
Source
Thrown at glances/outputs/glances_restful_api.py:1013
"""
self._check_if_plugin_available(plugin)
# Update the stat
self.__update_stats(get_plugin_dependencies(plugin))
try:
# Get the RAW value of the stat ID
statval = self.stats.get_plugin(plugin).get_api()
except Exception as e:
raise HTTPException(status.HTTP_404_NOT_FOUND, f"Cannot get plugin {plugin} ({str(e)})")
return GlancesJSONResponse(statval)
def _check_if_plugin_available(self, plugin: str) -> None:
if plugin in self.plugins_list:
return
raise HTTPException(
status.HTTP_400_BAD_REQUEST, f"Unknown plugin {plugin} (available plugins: {self.plugins_list})"
)
def _api_top(self, plugin: str, nb: int = 0):
"""Glances API RESTful implementation.
Return the JSON representation of a given plugin limited to the top nb items.
It is used to reduce the payload of the HTTP response (example: processlist).
HTTP/200 if OK
HTTP/400 if plugin is not found
HTTP/404 if others error
"""
self._check_if_plugin_available(plugin)
# Update the stat
self.__update_stats(get_plugin_dependencies(plugin))
View on GitHub (pinned to a240d8dfb3)
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
Example fix
// before GET /api/4/gpu // after GET /api/4/plugins // confirm name, then GET /api/4/gpu
Defensive patterns
Strategy: validation
Validate before calling
AVAILABLE = set(httpx.get(f'{BASE}/api/4/plugins').json())
if plugin not in AVAILABLE:
raise ValueError(f'{plugin} not in {sorted(AVAILABLE)}') Type guard
def is_known_plugin(name: str, available: list[str]) -> bool:
return isinstance(name, str) and name in available Try / catch
try:
r = httpx.get(f'{BASE}/api/4/{plugin}')
r.raise_for_status()
except httpx.HTTPStatusError as e:
if e.response.status_code == 400:
available = e.response.json()['detail'].split('available plugins: ')[-1]
raise ValueError(f'unknown plugin, choose from {available}') from e
raise Prevention
- Cache /api/4/plugins at client startup and validate names
- Use exact names, no aliases or guesses
When it happens
Trigger: 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).
Common situations: Clients hardcoding plugin names from a different glances version, typos like 'mem' vs 'memswap', or querying platform-specific plugins on unsupported hosts.
Related errors
- Unknown configuration item {section}
- Unknown argument item {item}
- Invalid JSON body
- Missing username or password in request body
- Cannot get help view data ({str(e)})
AI-assisted analysis of nicolargo/glances@a240d8dfb3 (2026-08-27).
Data as JSON: /api/errors/ca8b3df05b67fd18.
Report an issue: GitHub.