FlowiseAI/Flowise · warning · InternalFlowiseError
Error: chatMessageController.getAllChatMessages - id not pro
Error message
Error: chatMessageController.getAllChatMessages - id not provided!
What it means
Thrown by getAllChatMessages with HTTP 412 when req.params is undefined or req.params.id is falsy. Mounted via routes/chat-messages/index.ts:11 as GET ['/', '/:id'] under the /chatmessage prefix (routes/index.ts:83 — note the SINGULAR 'chatmessage', not 'chat-messages'), i.e. GET /api/v1/chatmessage/:id. Two gotchas: (1) clients using /api/v1/chat-messages/<id> get an Express 404, not this error; (2) the id guard sits at line 83, AFTER several req.query reads (messageId, startDate, endDate, feedback, feedbackType, page, limit) — those reads are side-effect-free so ordering does not change the result, but it is an unusual code layout.
Source
Thrown at packages/server/src/controllers/chat-messages/index.ts:83
}
const activeWorkspaceId = req.user?.activeWorkspaceId
const sortOrder = req.query?.order as string | undefined
const chatId = req.query?.chatId as string | undefined
const memoryType = req.query?.memoryType as string | undefined
const sessionId = req.query?.sessionId as string | undefined
const messageId = req.query?.messageId as string | undefined
const startDate = req.query?.startDate as string | undefined
const endDate = req.query?.endDate as string | undefined
const feedback = req.query?.feedback as boolean | undefined
const { page, limit } = getPageAndLimitParams(req)
let feedbackTypeFilters = req.query?.feedbackType as ChatMessageRatingType[] | undefined
if (feedbackTypeFilters) {
feedbackTypeFilters = getFeedbackTypeFilters(feedbackTypeFilters)
}
if (typeof req.params === 'undefined' || !req.params.id) {
throw new InternalFlowiseError(
StatusCodes.PRECONDITION_FAILED,
`Error: chatMessageController.getAllChatMessages - id not provided!`
)
}
const apiResponse = await chatMessagesService.getAllChatMessages(
req.params.id,
chatTypes,
sortOrder,
chatId,
memoryType,
sessionId,
startDate,
endDate,
messageId,
feedback,
feedbackTypeFilters,
activeWorkspaceId,
page,View on GitHub (pinned to abe4a8601a)
Solutions
- Call GET /api/v1/chatmessage/<id> with the chatflow id (use the singular 'chatmessage' prefix).
- Guard the id is a non-empty string before building the URL.
- If integrating, double-check the exact mount prefix — it is /chatmessage, not /chat-messages.
Example fix
// before (wrong prefix + empty id)
await fetch(`${BASE}/api/v1/chat-messages/`, { headers })
// after (correct singular prefix, concrete id)
if (!chatflowId) throw new Error('chatflow id required')
await fetch(`${BASE}/api/v1/chatmessage/${encodeURIComponent(chatflowId)}`, { headers }) Defensive patterns
Strategy: validation
Validate before calling
function assertId(id: unknown): string {
if (typeof id !== 'string' || id.trim() === '') {
throw new Error('chatflow id is required')
}
return id
}
const id = assertId(selectedChatflowId)
await fetch(`${BASE}/api/v1/chatmessage/${encodeURIComponent(id)}`, { headers }) // singular 'chatmessage' Type guard
const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0
Prevention
- Use the correct singular prefix: /api/v1/chatmessage, not /chat-messages.
- Always include the chatflow id; never GET the collection root expecting a single resource's messages.
- Centralize the chatmessage URL behind a helper that rejects empty ids and uses the singular prefix.
When it happens
Trigger: GET /api/v1/chatmessage/ (root form, no id) — e.g. a client that lists messages for a chatflow but builds the URL with an empty chatflow id. A caller who omits the final id segment entirely. (Using the plural /chat-messages path yields a routing 404 instead.)
Common situations: Chat-history panel loaded before a chatflow id is selected; client using the wrong path segment name ('chat-messages' vs 'chatmessage'); test hitting the collection root.
Related errors
- Error: chatMessagesController.removeAllChatMessages - id not
- Error: apikeyController.deleteApiKey - id not provided!
- Error: apikeyController.verifyApiKey - apikey not provided!
- Error: assistantsController.deleteAssistant - id not provide
- Error: assistantsController.getAssistantById - id not provid
AI-assisted analysis of FlowiseAI/Flowise@abe4a8601a (2026-08-12).
Data as JSON: /api/errors/4decce8f01f39d8c.
Report an issue: GitHub.