sgl-project/sglang · error · ValueError
Error while unloading LRU LoRA adapter '{lru_lora_name}': {u
Error message
Error while unloading LRU LoRA adapter '{lru_lora_name}': {unload_result.error_message} What it means
During LRU eviction inside load_lora_adapter, the attempt to unload the chosen adapter failed and returned an error message, so the load aborts.
Source
Thrown at python/sglang/srt/managers/tokenizer_control_mixin.py:669
exclude_pinned=True
)
if lru_lora_name is None:
raise ValueError(
"Didn't find any LoRA adapters when trying to evict LRU LoRA adapter. "
f"LoRA registry is: {self.lora_registry._registry}"
)
logger.info(
f"Unloading least recently used LoRA adapter '{lru_lora_name}' "
f"(current number of adapters: {self.lora_registry.num_registered_loras}, "
f"max allowed: {self.server_args.max_loaded_loras})"
)
unload_result = await self._unload_lora_adapter_locked(
UnloadLoRAAdapterReqInput(lora_name=lru_lora_name)
)
if not unload_result.success:
raise ValueError(
f"Error while unloading LRU LoRA adapter '{lru_lora_name}': "
f"{unload_result.error_message}"
)
del result.loaded_adapters[lru_lora_name]
return result
except ValueError as e:
return LoadLoRAAdapterReqOutput(
success=False,
error_message=str(e),
)
async def load_lora_adapter_from_tensors(
self: TokenizerManager,
obj: LoadLoRAAdapterFromTensorsReqInput,
_: Optional[fastapi.Request] = None,
) -> LoadLoRAAdapterFromTensorsReqOutput:
self.auto_create_handle_loop()View on GitHub (pinned to 0132848349)
Solutions
- Retry the load after in-flight requests using that adapter finish
- Inspect server logs for the underlying unload error message included in the exception
- Unoad the adapter manually via /unload_lora_adapter and inspect the error
Defensive patterns
Strategy: retry
Try / catch
for attempt in range(3):
try:
return await client.load_lora_adapter(req)
except ValueError as e:
if 'unloading LRU' in str(e) and attempt < 2:
await asyncio.sleep(2); continue
raise Prevention
- Drain requests using soon-to-be-evicted adapters before loading new ones
- Watch scheduler logs for unload failures
When it happens
Trigger: _unload_lora_adapter_locked for the LRU adapter returns success=False (scheduler-side unload failure), e.g. adapter in use by in-flight requests or backend unload error.
Common situations: High concurrency with adapters hot in flight; LoRA backend errors during weight unloading.
Related errors
- LoRA with name {lora_name} does not exist. Loaded LoRAs: {se
- Didn't find any LoRA adapters when trying to evict LRU LoRA
- Got LoRA adapter that has never been loaded: {lora_path}\nAl
- LoRA batch_info must provide max_len or seg_lens.
- LoRA batch_info must provide max_len or seg_lens.
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/989d0b51ccd197db.
Report an issue: GitHub.