bytedance/deer-flow · warning
Failed to list uploaded files
Error message
Failed to list uploaded files
What it means
listUploadedFiles GETs /api/threads/{threadId}/uploads/list to enumerate a thread's uploaded files, throwing on any non-ok response with the gateway's detail or the 'Failed to list uploaded files' fallback.
Source
Thrown at frontend/src/core/uploads/api.ts:104
await readErrorDetail(response, "Failed to load upload limits"),
);
}
return response.json();
}
/**
* List all uploaded files for a thread
*/
export async function listUploadedFiles(
threadId: string,
): Promise<ListFilesResponse> {
const response = await fetch(
`${getBackendBaseURL()}/api/threads/${threadId}/uploads/list`,
);
if (!response.ok) {
throw new Error(
await readErrorDetail(response, "Failed to list uploaded files"),
);
}
return response.json();
}
/**
* Delete an uploaded file
*/
export async function deleteUploadedFile(
threadId: string,
filename: string,
): Promise<{ success: boolean; message: string }> {
const encodedFilename = encodeURIComponent(filename);
const response = await fetch(
`${getBackendBaseURL()}/api/threads/${threadId}/uploads/${encodedFilename}`,
{View on GitHub (pinned to 1dd6ba1acb)
Solutions
- Confirm the /uploads/list status code in the Network tab.
- 404: treat as 'no files' if the thread is known-deleted, otherwise correct the thread id.
- 401: re-auth and refetch.
- 5xx: check gateway logs and the storage backend mount.
Example fix
// before: any failure surfaces as an error toast
const files = await listUploadedFiles(threadId);
// after: 404 degrades to an empty list
const res = await fetch(url);
if (res.status === 404) { return { files: [] }; } Defensive patterns
Strategy: fallback
Try / catch
let files: ListFilesResponse;
try { files = await listUploadedFiles(threadId); } catch (e) { if (isNotFound(e)) files = { files: [] }; else { toast(e.message); files = { files: [] }; } } Prevention
- Use React Query with retry only for transient statuses; render an empty list on 404.
- Refresh the list after uploads and deletes to avoid stale UI.
- Centralize readErrorDetail so status codes stay attached for branching.
When it happens
Trigger: Listing files for a deleted thread (404), expired session (401), or gateway storage error (5xx). Also triggered when the route is absent because uploads are disabled in this deployment.
Common situations: Opening a thread's attachments panel after the thread was pruned server-side; background tab with a stale session triggering the list query on focus.
Related errors
- Upload failed
- Failed to load upload limits
- Failed to delete file
- Failed to prepare ${failedConversions} attachment(s) for upl
- Thread is not ready for file upload.
AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14).
Data as JSON: /api/errors/fe5ede53f8472a78.
Report an issue: GitHub.