dify icon indicating copy to clipboard operation
dify copied to clipboard

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

Open PsycheJ opened this issue 1 year ago • 4 comments

Self Checks

  • [X] This is only for bug report, if you would like to ask a question, please head to Discussions.
  • [X] I have searched for existing issues search for existing issues, including closed ones.
  • [X] I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [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

✔️ Expected Behavior

No response

❌ Actual Behavior

No response

PsycheJ avatar Sep 06 '24 08:09 PsycheJ

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] avatar Sep 06 '24 08:09 dosubot[bot]

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 avatar Sep 06 '24 09:09 crazywoola

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 avatar Sep 06 '24 09:09 PsycheJ

Can you provide the container logs as well.

crazywoola avatar Sep 06 '24 12:09 crazywoola