FlowiseAI / Flowise

Drag & drop UI to build your customized LLM flow
https://flowiseai.com
Apache License 2.0
30.98k stars 16.14k forks source link

[QUESTION] [BUG] 500 Internal Server Error When Creating Chatflow via API: Unexpected Token Error #3412

Open Xperience94 opened 5 days ago

Xperience94 commented 5 days ago

Describe the bug

When attempting to create a new chatflow using the Flowise API, I receive a 500 Internal Server Error with the following message: Error: chatflowsService.saveChatflow - Unexpected token u in JSON at position 0

To Reproduce Steps to reproduce the behavior:

Start the Flowise server using npx flowise start on the default port or a custom port. Send a POST request to the /api/v1/chatflows endpoint with the following curl command: curl -L \ -X POST \ -H 'Authorization: Bearer JWT' \ -H 'Content-Type: application/json' \ http://localhost:3000/api/v1/chatflows \ -d '{"name": "Test Chatflow", "description": "This is a test chatflow created via API."}' Observe that the server responds with a 500 Internal Server Error and the message :

Error: chatflowsService.saveChatflow - Unexpected token u in JSON at position 0

Expected behavior I expect the server to successfully create a new chatflow based on the provided data, or at least return a clear error message indicating which fields are missing or incorrectly formatted.

Screenshots N/A (since this issue is encountered via the API and not the UI)

Flow N/A (since the issue is occurring when trying to create a new chatflow and not while interacting with an existing flow)

Setup

Additional context

HenryHengZJ commented 4 days ago

you might need to have an empty flowData like {} image