{"record":{"id":"3369689aa1567c0d","repo":"FlowiseAI/Flowise","slug":"error-chatflowscontroller-checkifchatflowisvalidf-336968","errorCode":null,"errorMessage":"Error: chatflowsController.checkIfChatflowIsValidForUploads - id not provided!","messagePattern":"Error: chatflowsController\\.checkIfChatflowIsValidForUploads - id not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/chatflows/index.ts","lineNumber":38,"sourceCode":"const checkIfChatflowIsValidForStreaming = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.checkIfChatflowIsValidForStreaming - id not provided!`\n            )\n        }\n        const apiResponse = await chatflowsService.checkIfChatflowIsValidForStreaming(req.params.id)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst checkIfChatflowIsValidForUploads = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: chatflowsController.checkIfChatflowIsValidForUploads - id not provided!`\n            )\n        }\n        const apiResponse = await chatflowsService.checkIfChatflowIsValidForUploads(req.params.id)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nconst deleteChatflow = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.id) {\n            throw new InternalFlowiseError(StatusCodes.PRECONDITION_FAILED, `Error: chatflowsController.deleteChatflow - id not provided!`)\n        }\n        const orgId = req.user?.activeOrganizationId\n        if (!orgId) {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/chatflows/index.ts#L20-L56","documentation":"Thrown by checkIfChatflowIsValidForUploads when req.params.id is missing — a 412 PRECONDITION_FAILED guard identical in shape to the streaming check. Fires before the service call, so it is purely a missing-route-param rejection.","triggerScenarios":"Calling the uploads-validity endpoint with an empty or undefined id path segment; mismatched param name between client URL and server route.","commonSituations":"Frontend variable for chatflow id is undefined at call time; SDK upgrade changed endpoint path; proxy rewrite dropped the segment.","solutions":["Ensure the request URL includes a non-empty id.","Validate the client-side id variable is set before calling.","Match client path against the server route definition."],"exampleFix":"// before\nawait api.get(`/api/v1/chatflows/${id}/valid-for-uploads`)\n// after\nif (!id) throw new Error('chatflow id required')\nawait api.get(`/api/v1/chatflows/${id}/valid-for-uploads`)","handlingStrategy":"validation","validationCode":"if (!id || typeof id !== 'string' || id.length === 0) {\n  throw new Error('chatflow id required before checking upload validity')\n}","typeGuard":"function isNonEmptyId(v: unknown): v is string {\n  return typeof v === 'string' && v.trim().length > 0\n}","tryCatchPattern":null,"preventionTips":["Assert id is non-empty before calling.","Use a shared typed client wrapper for chatflow endpoints.","Verify param names on Flowise upgrades."],"tags":["flowise","express","params-validation","precondition","controller"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}