{"record":{"id":"c9ef08e5aea88cb4","repo":"FlowiseAI/Flowise","slug":"logids-must-be-a-string","errorCode":null,"errorMessage":"logIds must be a string[]","messagePattern":"logIds must be a string\\[\\]","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":400,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":407,"sourceCode":"\nconst deleteScheduleTriggerLogs = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (!req.params?.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                'Error: chatflowsController.deleteScheduleTriggerLogs - id not provided!'\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {\n            throw new InternalFlowiseError(\n                StatusCodes.NOT_FOUND,\n                'Error: chatflowsController.deleteScheduleTriggerLogs - workspace not found!'\n            )\n        }\n        const logIds: unknown = req.body?.logIds\n        if (!Array.isArray(logIds) || logIds.some((x) => typeof x !== 'string')) {\n            throw new InternalFlowiseError(StatusCodes.BAD_REQUEST, 'logIds must be a string[]')\n        }\n        const result = await scheduleService.deleteTriggerLogs(req.params.id, workspaceId, logIds as string[])\n        return res.json(result)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst toggleScheduleEnabled = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (!req.params?.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                'Error: chatflowsController.toggleScheduleEnabled - id not provided!'\n            )\n        }\n        const workspaceId = req.user?.activeWorkspaceId\n        if (!workspaceId) {","sourceCodeStart":389,"sourceCodeEnd":425,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L389-L425","documentation":"Thrown by deleteScheduleTriggerLogs when req.body.logIds is not an array of strings. This is a shape-validation guard (BAD_REQUEST / 400), stricter than the param guards. It rejects arrays containing non-strings and any non-array value, because the service expects string[] log identifiers.","triggerScenarios":"The request body omits logIds, sends a single string instead of an array, sends numeric ids, or sends an array containing numbers/objects/null.","commonSituations":"Frontend sends selected row ids as numbers from a DB, a single id instead of [id], JSON body not parsed (Content-Type missing so req.body is a string/undefined), or a stale payload format after a contract change.","solutions":["Send { \"logIds\": [\"<id1>\", \"<id2>\"] } with Content-Type: application/json.","Coerce each selected id to a string before sending (String(id)).","Ensure body-parsing middleware (express.json()) runs before this route, otherwise req.body is undefined and fails the check."],"exampleFix":"// before\nfetch(url, { method: 'DELETE', body: JSON.stringify({ logIds: [1, 2] }) })\n// after\nfetch(url, {\n  method: 'DELETE',\n  headers: { 'Content-Type': 'application/json' },\n  body: JSON.stringify({ logIds: ['1', '2'] })\n})","handlingStrategy":"type-guard","validationCode":"function toLogIdsPayload(v: unknown): string[] {\n  const arr = Array.isArray(v) ? v : v == null ? [] : [v]\n  return arr.map((x) => String(x))\n}","typeGuard":"const isStringArray = (v: unknown): v is string[] => Array.isArray(v) && v.every((x) => typeof x === 'string')","tryCatchPattern":"try { await api.deleteTriggerLogs(id, logIds) } catch (e) { if (e.statusCode === 400 && /logIds/.test(e.message)) { logIds = logIds.map(String); await api.deleteTriggerLogs(id, logIds) } else throw e }","preventionTips":["Always set Content-Type: application/json so the body parses.","Coerce ids to strings before sending.","Confirm express.json() is mounted globally."],"tags":["flowise","controller","validation","bad-request","body-shape","scheduling","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}