When uploading files through the api interface(create_by_file), there will be a success and a failure? #5430

Closed
opened 2026-02-21 18:10:56 -05:00 by yindo · 4 comments
Owner

Originally created by @PsycheJ on GitHub (Sep 6, 2024).

Self Checks

  • 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 (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

0.7.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When the create interface is called, there is one success and one failure; in the case of failure, the interface returns File not found.
image

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @PsycheJ on GitHub (Sep 6, 2024). ### Self Checks - [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 (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [X] Please do not modify this template :) and fill in all the required fields. ### Dify version 0.7.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When the create interface is called, there is one success and one failure; in the case of failure, the interface returns File not found. ![image](https://github.com/user-attachments/assets/16f70b52-4224-498e-90f0-58ab59e91488) ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🌚 invalid🤔 cant-reproduce labels 2026-02-21 18:10:56 -05:00
yindo closed this issue 2026-02-21 18:10:56 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 6, 2024):

Yes, when uploading files through the API interface (create_by_file), there will be both success and failure responses. The API provides feedback on both successful and failed attempts to upload files. Here are some possible error messages that indicate failure responses:

  • document_indexing: Document indexing failed.
  • provider_not_initialize: Embedding model not configured.
  • not_found: Document not found.
  • dataset_name_duplicate: Dataset name duplicate.
  • provider_quota_exceeded: Provider quota exceeded.
  • dataset_not_initialized: Dataset not initialized.
  • unsupported_file_type: Unsupported file type. Supported file types are: txt, markdown, md, pdf, html, htm, xlsx, docx, csv.
  • too_many_files: Too many files; only single file uploads are supported.
  • file_too_large: File too large; supports files under 15MB [1][2][3].

Additionally, the "File not found" error occurs if the "file" is not present in the request.files [4][5].

I also found a similar unsolved discussion that might be relevant: I can't upload the image on dify workflow via api [6].

To continue talking to Dosu, mention @dosu.

@dosubot[bot] commented on GitHub (Sep 6, 2024): <!-- Answer --> Yes, when uploading files through the API interface (`create_by_file`), there will be both success and failure responses. The API provides feedback on both successful and failed attempts to upload files. Here are some possible error messages that indicate failure responses: - `document_indexing`: Document indexing failed. - `provider_not_initialize`: Embedding model not configured. - `not_found`: Document not found. - `dataset_name_duplicate`: Dataset name duplicate. - `provider_quota_exceeded`: Provider quota exceeded. - `dataset_not_initialized`: Dataset not initialized. - `unsupported_file_type`: Unsupported file type. Supported file types are: txt, markdown, md, pdf, html, htm, xlsx, docx, csv. - `too_many_files`: Too many files; only single file uploads are supported. - `file_too_large`: File too large; supports files under 15MB <sup>[[1]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/guides/knowledge-base/maintain-dataset-via-api.md)</sup><sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/jp/guides/knowledge-base/maintain-dataset-via-api.md)</sup><sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/zh_CN/features/datasets/maintain-dataset-via-api.md)</sup>. Additionally, the "File not found" error occurs if the "file" is not present in the `request.files` <sup>[[4]](https://github.com/langgenius/dify/blob/main/api/controllers/service_api/dataset/document.py)</sup><sup>[[5]](https://github.com/langgenius/dify-docs/blob/main/jp/features/datasets/maintain-dataset-via-api.md)</sup>. I also found a similar unsolved discussion that might be relevant: [I can't upload the image on dify workflow via api](https://github.com/langgenius/dify/discussions/7482) <sup>[[6]](https://github.com/langgenius/dify/discussions/7482)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
Author
Owner

@crazywoola commented on GitHub (Sep 6, 2024):

There is one thing needs to be clarified.

  • Are those 2 files the same? If these 2 files are identical, the I guess it will happen.
@crazywoola commented on GitHub (Sep 6, 2024): There is one thing needs to be clarified. - Are those 2 files the same? If these 2 files are identical, the I guess it will happen.
Author
Owner

@PsycheJ commented on GitHub (Sep 6, 2024):

There is one thing needs to be clarified.

  • Are those 2 files the same? If these 2 files are identical, the I guess it will happen.

No, it's a different file.

@PsycheJ commented on GitHub (Sep 6, 2024): > There is one thing needs to be clarified. > > * Are those 2 files the same? If these 2 files are identical, the I guess it will happen. No, it's a different file.
Author
Owner

@crazywoola commented on GitHub (Sep 6, 2024):

Can you provide the container logs as well.

@crazywoola commented on GitHub (Sep 6, 2024): Can you provide the container logs as well.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#5430