lfnovo/open-notebook · error · HTTPException
Error auto-assigning defaults: {str(e)}
Error message
Error auto-assigning defaults: {str(e)} What it means
Generic 500 from the auto-assign defaults endpoint when automatically assigning default models fails. The handler ranks discovered models per provider priority; unexpected exceptions during discovery, ranking, or the defaults update land here.
Source
Thrown at api/routers/models.py:846
setattr(defaults, slot_name, model_id)
# Save updated defaults if any assignments were made
if assigned:
await defaults.update()
return AutoAssignResult(
assigned=assigned,
skipped=skipped,
missing=missing,
)
except HTTPException:
raise
except OpenNotebookError:
raise
except Exception as e:
logger.error(f"Error auto-assigning defaults: {str(e)}")
raise HTTPException(
status_code=500, detail=f"Error auto-assigning defaults: {str(e)}"
)
View on GitHub (pinned to a7de90d38a)
Solutions
- Check API logs for 'Error auto-assigning defaults'
- Ensure at least one provider is configured with valid credentials
- Run discovery/sync manually first (POST /models/sync) to confirm it works
- Retry auto-assign after fixing the underlying provider issue
Defensive patterns
Strategy: try-catch
Validate before calling
const avail = await api.getProviderAvailability();
if (!Object.values(avail).some(v => v.available)) throw new Error('configure a provider first'); Try / catch
try { await api.autoAssignDefaults(); } catch (e) { if (e.status === 500) { await syncProviders(); await retryOnce(); } } Prevention
- Configure at least one working provider before auto-assign
- Run manual sync first to verify discovery works
- Review server logs for the root cause
When it happens
Trigger: POSTing auto-assign when no providers are configured/discoverable, when discovery raises unexpectedly, or when writing defaults fails (DB error).
Common situations: Fresh install with no API keys so discovery returns garbage or throws; DB unavailable; conflicting concurrent defaults update.
Related errors
- Error fetching default models: {str(e)}
- Error updating default models: {str(e)}
- Error fetching models: {str(e)}
- Error creating model: {str(e)}
- Error deleting model: {str(e)}
AI-assisted analysis of lfnovo/open-notebook@a7de90d38a (2026-08-27).
Data as JSON: /api/errors/2d463fc7883f857e.
Report an issue: GitHub.