FlowiseAI/Flowise · error · Error

${error}

Error message

${error}

What it means

The outer catch-all of OpenAIAssistant agent's run. Any exception not handled by the inner tool/thread handlers is reported via onChainError then re-thrown as `new Error(error)` — stringifying the original (often an OpenAI SDK error) and losing its type, status, and stack. This is the same anti-pattern as errors 20/25/28.

Source

Thrown at packages/components/nodes/agents/OpenAIAssistant/OpenAIAssistant.ts:940

                }
            }

            let llmOutput = returnVal.replace(imageRegex, '')
            llmOutput = llmOutput.replace('<br/>', '')

            await analyticHandlers.onLLMEnd(llmIds, llmOutput)
            await analyticHandlers.onChainEnd(parentIds, messageData, true)

            return {
                text: returnVal,
                usedTools,
                artifacts,
                fileAnnotations,
                assistant: { assistantId: openAIAssistantId, threadId, runId: runThreadId, messages: messageData }
            }
        } catch (error) {
            await analyticHandlers.onChainError(parentIds, error, true)
            throw new Error(error)
        }
    }
}

const downloadImg = async (
    openai: OpenAI,
    fileId: string,
    fileName: string,
    orgId: string,
    ...paths: string[]
): Promise<{ filePath: string; totalSize: number }> => {
    const response = await openai.files.content(fileId)

    // Extract the binary data from the Response object
    const image_data = await response.arrayBuffer()

    // Convert the binary data to a Buffer
    const image_data_buffer = Buffer.from(image_data)

View on GitHub (pinned to abe4a8601a)

Solutions

  1. Check server logs and analytics (onChainError fires with the original error reference).
  2. Identify the OpenAI status: 401 → key; 429 → rate limit/quota; 5xx → provider; 404 → wrong assistant/thread id.
  3. Fix the specific upstream/credential/config issue.
  4. Patch to `throw new Error(error instanceof Error ? error.message : String(error), { cause: error })`.

Example fix

// before
        } catch (error) {
            await analyticHandlers.onChainError(parentIds, error, true)
            throw new Error(error)
        }
// after
        } catch (error) {
            const message = error instanceof Error ? error.message : String(error)
            await analyticHandlers.onChainError(parentIds, error, true)
            throw new Error(message, { cause: error })
        }
Defensive patterns

Strategy: try-catch

Try / catch

try {
  await assistantNode.run(nodeData, input, options)
} catch (e) {
  // original error stringified; use onChainError analytics + logs for the cause
  const msg = (e as Error).message
  if (/401|Unauthorized/.test(msg)) fixKey()
  else if (/429|rate/i.test(msg)) backoff()
  throw e
}

Prevention

When it happens

Trigger: Any uncaught failure during assistant execution: assistant retrieval, message listing, streaming setup, file annotation handling, downloadImg, or an error that escapes the inner try blocks.

Common situations: OpenAI SDK throws a 401/429/5xx not caught inner; message-list pagination fails; a file annotation references a missing file; streaming setup error.

Related errors


AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12). Data as JSON: /api/errors/0bd46c6887920ea9. Report an issue: GitHub.