Flowise icon indicating copy to clipboard operation
Flowise copied to clipboard

[BUG] 500 Error in Attachments API: isValidUUID is not a function

Open BadrLaajali opened this issue 10 months ago • 2 comments

Describe the bug : The /api/v1/attachments/{chatflowId}/{chatId} endpoint returns a 500 Internal Server Error with the message: "Error: attachmentService.createAttachment - (0 , flowise_components_1.isValidUUID) is not a function". This prevents file uploads through the API.

To Reproduce Steps to reproduce the behavior:

  • Set up a Flowise instance with file uploads enabled
  • Try to upload a file using the attachments API endpoint
  • Send a POST request to /api/v1/attachments/{chatflowId}/{chatId} with a file in the form data
  • Receive a 500 error

Expected behavior The API should accept the file upload and return the file information that can be used in subsequent prediction API calls.

Screenshots Error response from Postman:

{ "statusCode": 500, "success": false, "message": "Error: attachmentService.createAttachment - (0 , flowise_components_1.isValidUUID) is not a function", "stack": {} }

Setup Installation: Docker from : https://hub.docker.com/r/elestio/flowiseai Flowise Version: [email protected]

Additional context After investigating the code, I found that the issue appears to be related to the isValidUUID function. This function is defined in validator.ts but seems to be incorrectly exported or not properly included in the build process. The function is being imported from flowise-components in the createAttachment.ts file, but the import is failing at runtime.

This is likely a build/packaging issue rather than a code logic error. The function exists but is not being properly exported from the components package.

BadrLaajali avatar Mar 29 '25 14:03 BadrLaajali

same issue here

Alfulayt avatar Apr 20 '25 14:04 Alfulayt

same issue here,When can this problem be solved

qilongpingchuan avatar Apr 21 '25 03:04 qilongpingchuan

can anyone confirm if this is resolved in 2.2.8? I tested on Docker with the version, works fine

Image

HenryHengZJ avatar May 04 '25 13:05 HenryHengZJ

resolved in version 2.2.8

related: https://github.com/FlowiseAI/Flowise/issues/3645

HenryHengZJ avatar May 05 '25 03:05 HenryHengZJ