Invalid upload file error in published Advanced Chat app but not in Studio Preview #35760
Replies: 3 comments 4 replies
|
Hi @masaoy0730! I'm Dosu and I’m helping the dify team. Your suspicion is on the right track — this appears to be a file access control issue between Studio Preview and published app execution, not a problem with your workflow configuration. Root cause: When Knowledge Retrieval returns context containing image references from indexed documents, those images are stored as Why Studio Preview works: It runs under an account-level execution context where This is compounded by a related regression tracked in #32606 — the Workarounds to try:
Regarding SVG specifically — SVG is listed as a supported image extension [8], so it's not being rejected by file type. The error affects all image types from Knowledge Retrieval equally when accessed by end-users. This does appear to be a bug — the system should not fail with "Invalid upload file" when the files originate from Knowledge Retrieval context rather than user uploads. You may want to file this as a separate issue if re-indexing doesn't resolve it, since the access control gap for knowledge base context files in published apps hasn't been explicitly addressed yet. To reply, just mention @dosu. Share context across your team and agents. Try Dosu. |
|
Hi, |
|
@dosu I would like to know if there are any updates on this bug? I am experiencing the same issue in version 1.14.x. I'd like to check if there is an official fix in any newer version, or clarify where the workaround should actually be implemented. The workaround suggested by @ibondarenko1 mentions api/services/file_service.py, but in Dify 1.14.x, the architecture has changed and the file access controller logic is located elsewhere. |
Uh oh!
There was an error while loading. Please reload this page.
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Hello,
I would like to report a possible bug or ask for advice regarding an Invalid upload file error in an Advanced Chat app.
Environment
Summary of the issue
The workflow works correctly in Studio Preview, but fails when running the published app from the app/web UI.
In Studio Preview:
In the published app execution:
What I already tried
I tried the following, but the issue still occurs in the published app:
Current workflow structure
The workflow is basically:
Start -> Knowledge Retrieval -> LLM -> Answer
Important observation
This issue only appears in the published app execution. Studio Preview works normally.
Also, in some API/plugin logs, I noticed many asset fetches for document images, including many .svg, .png, and .jpg files. This made me suspect that the retrieved Knowledge context may contain image/file references from indexed documents. Even when the user uploads no file, the LLM node might be receiving or validating some file-like object from the retrieved context.
Suspected bug
My suspicion is that, in published app execution, when Knowledge Retrieval returns context that includes document image/file references, the LLM node or workflow runtime may validate those references as uploaded files. If one of them is unsupported, empty, invalid, or SVG-related, the workflow fails with: Invalid upload file
This seems inconsistent because:
Expected behavior
If the user does not upload a file and the LLM node does not explicitly reference sys.files, the workflow should not fail with Invalid upload file.
If the issue is caused by image/file references inside retrieved Knowledge context, Dify should either:
Questions
I was excited to discover that when using gemini-3.1-pro, Dify can generate answers based not only on the text in Knowledge documents, but also on images contained in those documents.
However, although it works correctly in Studio Preview, it fails with an error when running the published app, so I cannot use this functionality in production.
I would like to be able to use gemini-3.1-pro with Vision enabled for Knowledge documents, even when the end user does not upload any image files during the chat.
Thank you.
2. Additional context or comments
No response
All reactions