LLM Node Throws file validation failed for file Error on Second File Upload in WebApp Chatflow #21369

Closed
opened 2026-02-21 20:12:13 -05:00 by yindo · 3 comments
Owner

Originally created by @zlove520 on GitHub (Dec 30, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.10.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Create a new Chatflow in the Dify WebApp and add a File Upload component.
Connect the File Upload component to an LLM Node (e.g., prompt completion node).
Deploy the Chatflow and access it via the WebApp interface.
First upload: Select any valid file (e.g., .txt, .pdf) and submit it. Verify that the LLM node executes successfully and returns the expected response.
Second upload: Without refreshing the page, select a file (same or different from the first one) and submit it again.
Observe that the LLM node fails with the file validation failed for file error.

✔️ Expected Behavior

The LLM node should process the uploaded file successfully for every upload attempt, not just the first one.

Actual Behavior

The second and subsequent file uploads trigger a file validation failure in the LLM node.

Originally created by @zlove520 on GitHub (Dec 30, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.10.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Create a new Chatflow in the Dify WebApp and add a File Upload component. Connect the File Upload component to an LLM Node (e.g., prompt completion node). Deploy the Chatflow and access it via the WebApp interface. First upload: Select any valid file (e.g., .txt, .pdf) and submit it. Verify that the LLM node executes successfully and returns the expected response. Second upload: Without refreshing the page, select a file (same or different from the first one) and submit it again. Observe that the LLM node fails with the file validation failed for file error. ### ✔️ Expected Behavior The LLM node should process the uploaded file successfully for every upload attempt, not just the first one. ### ❌ Actual Behavior The second and subsequent file uploads trigger a file validation failure in the LLM node.
yindo added the 🐞 bug label 2026-02-21 20:12:13 -05:00
yindo closed this issue 2026-02-21 20:12:13 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 30, 2025):

This issue happens because the file upload state in the web app isn't automatically cleared between uploads. After the first upload, the file state persists, so when you upload a second file (without refreshing), the backend sees stale or duplicate file entries and fails validation. The root cause is that the file state (FileEntity[]) is not reset after each chat turn or upload, so the LLM node tries to re-validate old files and returns a "file validation failed" error on subsequent uploads. There is a function to clear files, but it's not triggered automatically between uploads, which leads to this problem. Recent changes have improved state synchronization, but unless you are on a version with those fixes, a temporary workaround is to manually clear the file state or refresh the page between uploads to avoid the error.
See code details

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 30, 2025): <!-- Answer --> This issue happens because the file upload state in the web app isn't automatically cleared between uploads. After the first upload, the file state persists, so when you upload a second file (without refreshing), the backend sees stale or duplicate file entries and fails validation. The root cause is that the file state (FileEntity[]) is not reset after each chat turn or upload, so the LLM node tries to re-validate old files and returns a "file validation failed" error on subsequent uploads. There is a function to clear files, but it's not triggered automatically between uploads, which leads to this problem. Recent changes have improved state synchronization, but unless you are on a version with those fixes, a temporary workaround is to manually clear the file state or refresh the page between uploads to avoid the error. [See code details](https://github.com/langgenius/dify/blob/bf76f10653650220b740261b47a1eface37467a4/web/app/components/base/file-uploader/hooks.ts#L34-L367) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/820d8c64-8df8-4d87-bca4-d632fb73897c?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20issue%20happens%20because%20the%20file%20upload%20state%20in%20the%20web%20app%20isn%27t%20automatically%20cleared%20between%20uploads.%20After%20the%20first%20upload%2C%20the%20file%20state%20persists%2C%20so%20when%20you%20upload%20a%20second%20file%20%28without%20refreshing%29%2C%20the%20backend%20sees%20stale%20or%20duplicate%20file%20entries%20and%20fails%20validation.%20The%20root%20cause%20is%20that%20the%20file%20state%20%28FileEntity%5B%5D%29%20is%20not%20reset%20after%20each%20chat%20turn%20or%20upload%2C%20so%20the%20LLM%20node%20tries%20to%20re-validate%20old%20files%20and%20returns%20a%20%22file%20validation%20failed%22%20error%20on%20subsequent%20uploads.%20There%20is%20a%20function%20to%20clear%20files%2C%20but%20it%27s%20not%20triggered%20automatically%20between%20uploads%2C%20which%20leads%20to%20this%20problem.%20Recent%20changes%20have%20improved%20state%20synchronization%2C%20but%20unless%20you%20are%20on%20a%20version%20with%20those%20fixes%2C%20a%20temporary%20workaround%20is%20to%20manually%20clear%20the%20file%20state%20or%20refresh%20the%20page%20between%20uploads%20to%20avoid%20the%20error.%20%20%0A%5BSee%20code%20details%5D%28https%3A//github.com/langgenius/dify/blob/bf76f10653650220b740261b47a1eface37467a4/web/app/components/base/file-uploader/hooks.ts%23L34-L367%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/30380)
Author
Owner

@hjlarry commented on GitHub (Dec 30, 2025):

Can you confirm if this issue also occurs on cloud.dify.ai?

@hjlarry commented on GitHub (Dec 30, 2025): Can you confirm if this issue also occurs on cloud.dify.ai?
Author
Owner

@dosubot[bot] commented on GitHub (Jan 30, 2026):

Hi, @zlove520. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported that in Dify v1.10.1 self-hosted via Docker, the LLM node processes the first file upload correctly but fails with a "file validation failed" error on subsequent uploads without a page refresh.
  • The problem is caused by the file upload state not being cleared automatically between uploads, leading to stale file entries and validation failure.
  • A manual clear of the file upload component or refreshing the page works as a temporary workaround.
  • The maintainer asked if this issue also occurs on the cloud.dify.ai platform, but there has been no update on that.

What's Next:

  • Please let me know if this issue is still relevant with the latest version of Dify or if it also happens on the cloud platform by commenting here.
  • If I don’t hear back within 15 days, I will automatically close this issue.

Thanks for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 30, 2026): Hi, @zlove520. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported that in Dify v1.10.1 self-hosted via Docker, the LLM node processes the first file upload correctly but fails with a "file validation failed" error on subsequent uploads without a page refresh. - The problem is caused by the file upload state not being cleared automatically between uploads, leading to stale file entries and validation failure. - A manual clear of the file upload component or refreshing the page works as a temporary workaround. - The maintainer asked if this issue also occurs on the cloud.dify.ai platform, but there has been no update on that. **What's Next:** - Please let me know if this issue is still relevant with the latest version of Dify or if it also happens on the cloud platform by commenting here. - If I don’t hear back within 15 days, I will automatically close this issue. Thanks for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#21369