lfnovo/open-notebook · error · HTTPException
Error syncing models. Check server logs for details.
Error message
Error syncing models. Check server logs for details.
What it means
500 from POST /api/v1/models/sync/{provider} when syncing models for one provider fails. Like discovery, the response detail is intentionally generic; the specific exception is logged as 'Error syncing models for {provider}'.
Source
Thrown at api/routers/models.py:597
try:
# Provision DB-stored credentials into env vars before discovery
await provision_provider_keys(provider)
discovered, new, existing = await sync_provider_models(
provider, auto_register=True
)
return ProviderSyncResponse(
provider=provider,
discovered=discovered,
new=new,
existing=existing,
)
except HTTPException:
raise
except OpenNotebookError:
raise
except Exception as e:
logger.error(f"Error syncing models for {provider}: {str(e)}")
raise HTTPException(status_code=500, detail="Error syncing models. Check server logs for details.")
@router.post("/models/sync", response_model=AllProvidersSyncResponse)
async def sync_all_models():
"""
Sync models for all configured providers.
Discovers and registers models from all providers that have
valid API keys configured. This is useful for initial setup
or periodic refresh of available models.
"""
try:
results = await sync_all_providers()
response_results = {}
total_discovered = 0
total_new = 0
View on GitHub (pinned to a7de90d38a)
Solutions
- Check server logs for 'Error syncing models for {provider}'
- Validate the provider's API key/env config
- Test the provider via POST /models/{id}/test to isolate
- Retry after rate-limit window
Defensive patterns
Strategy: retry
Validate before calling
const avail = await api.getProviderAvailability();
if (!avail[provider]?.available) throw new Error('fix provider credentials first'); Try / catch
try { await api.syncModels(provider); } catch (e) { if (e.status === 500) { await wait(5000); await retryOnce(); } } Prevention
- Validate provider credentials via /test before sync
- Back off on repeated 500s (likely rate limit)
- Watch server logs — client detail is intentionally vague
When it happens
Trigger: Sync with a provider whose credentials are invalid, whose API is unreachable, or whose discovery integration throws an unexpected error type.
Common situations: Expired API key, provider outage, rate limiting, or partially configured provider entries created manually.
Related errors
- Error checking provider availability: {str(e)}
- Error discovering models. Check server logs for details.
- Error syncing all models: {str(e)}
- Error fetching models: {str(e)}
- Error creating model: {str(e)}
AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27).
Data as JSON: /api/errors/8c1d1b76a144961c.
Report an issue: GitHub.