QuantumNous/new-api · warning · Error
We could not load system tasks.
Error message
We could not load system tasks.
What it means
Thrown by the SystemTasksPanel queryFn when listSystemTasks(TASK_LIMIT) rejects or returns success=false / non-array data. With retry:false the panel immediately shows its error state with this message; polling restarts only when the query refetches.
Source
Thrown at web/src/features/system-info/components/system-tasks-panel.tsx:214
{task.error || '-'}
</TableCell>
</TableRow>
)
})}
</TableBody>
</Table>
</div>
)
}
export function SystemTasksPanel() {
const { t } = useTranslation()
const tasksQuery = useQuery({
queryKey: ['system-info', 'system-tasks'],
queryFn: async () => {
const res = await listSystemTasks(TASK_LIMIT)
if (!res.success || !Array.isArray(res.data)) {
throw new Error(res.message || t('We could not load system tasks.'))
}
return res.data
},
staleTime: 30 * 1000,
retry: false,
refetchInterval: (query) =>
query.state.data?.some((task) => isActiveStatus(task.status))
? ACTIVE_POLL_INTERVAL_MS
: false,
})
const tasks = tasksQuery.data ?? []
const loading = tasksQuery.isLoading
const refreshing = tasksQuery.isFetching && !tasksQuery.isLoading
const hasActiveTasks = tasks.some((task) => isActiveStatus(task.status))
const activeTasks = tasks.filter((task) => isActiveStatus(task.status))
const historyTasks = tasks.filter((task) => !isActiveStatus(task.status))
View on GitHub (pinned to e2c7aa7b10)
Solutions
- Verify the caller is an admin; the system-tasks endpoint is privileged.
- Inspect the raw response: if data is not an array, the frontend service and backend contract have diverged — align listSystemTasks with the actual response shape.
- Check backend logs/migrations for the system tasks table if the handler errors.
- For transient failures, refetch manually or wait for the conditional poll to resume.
Defensive patterns
Strategy: validation
Type guard
function isTaskList(data: unknown): data is SystemTask[] {
return Array.isArray(data) && data.every(
(t): t is SystemTask =>
typeof t === 'object' && t !== null && typeof (t as SystemTask).status === 'string'
)
} Try / catch
queryFn: async () => {
const res = await listSystemTasks(TASK_LIMIT)
if (!res.success || !Array.isArray(res.data)) {
throw new Error(res.message || t('We could not load system tasks.'))
}
return res.data
},
retry: false, Prevention
- Pin frontend and backend versions together so the tasks response envelope stays an array.
- Guard the panel by admin role before mounting.
- Exercise the endpoint in CI contract tests to catch schema drift before deploy.
When it happens
Trigger: GET of the system-tasks list fails: non-admin caller, backend task registry error, type mismatch where data is an object (e.g. paginated envelope) rather than the expected array, or network/backend outage.
Common situations: Non-admin opens system info; backend version skew where the endpoint returns {data:{items:[...]}} instead of a bare array; task store (DB table) missing after a failed migration; proxy 502 during deploy.
Related errors
- We could not load instances.
- Delete failed
- Failed to sign out session
- Failed to sign out other sessions
- Failed to fetch usage
AI-assisted analysis of QuantumNous/new-api@e2c7aa7b10 (2026-08-15).
Data as JSON: /api/errors/77497cf0d72d41ec.
Report an issue: GitHub.