(donlt know if this is bug or not) cannot upload markdown file to gemini 2.5 models #509

Closed
opened 2026-02-16 10:19:36 -05:00 by yindo · 4 comments
Owner

Originally created by @U11Leung on GitHub (Aug 2, 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.7.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

add gemini models in Dify, create a flow or chat whatever, send a .md file and prompt "summarize content"

✔️ Expected Behavior

gemini will read the markdown file and analyze and output the answer

Actual Behavior

error and stop:
[google] Error: PluginInvokeError: {"args":{},"error_type":"ClientError","message":"400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}"}

Originally created by @U11Leung on GitHub (Aug 2, 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.7.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce add gemini models in Dify, create a flow or chat whatever, send a .md file and prompt "summarize content" ### ✔️ Expected Behavior gemini will read the markdown file and analyze and output the answer ### ❌ Actual Behavior error and stop: [google] Error: PluginInvokeError: {"args":{},"error_type":"ClientError","message":"400 INVALID_ARGUMENT. {'error': {'code': 400, 'message': 'Request contains an invalid argument.', 'status': 'INVALID_ARGUMENT'}}"}
yindo added the stale label 2026-02-16 10:19:36 -05:00
yindo closed this issue 2026-02-16 10:19:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 2, 2025):

Markdown file upload is supported in recent Dify versions, but the 400 INVALID_ARGUMENT error from Gemini 2.5 usually means the request payload is missing required parameters or the file isn't formatted as Gemini expects. This can happen if the Gemini plugin version is incompatible—users have reported that downgrading the Gemini plugin to 0.1.5 or 0.1.6 resolves similar issues, as newer plugin versions (like 0.2.x) introduced changes that may break file or multimodal input handling in some flows. Also, Gemini's API often requires a 'text' field even when uploading files, so if Dify is only sending a file link or markdown representation, Gemini may reject it as invalid input.

If you haven't already, try downgrading your Gemini plugin to 0.1.5 or 0.1.6 and restart your services. If the issue persists, enable debug logs and check the payload being sent to Gemini to confirm it includes the required fields (like 'text' or file content, not just a link) reference reference.

Recent code changes confirm markdown files are intended to be supported for upload reference, so this is likely a plugin compatibility or payload formatting issue, not a fundamental limitation.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Aug 2, 2025): <!-- Answer --> Markdown file upload is supported in recent Dify versions, but the 400 INVALID_ARGUMENT error from Gemini 2.5 usually means the request payload is missing required parameters or the file isn't formatted as Gemini expects. This can happen if the Gemini plugin version is incompatible—users have reported that downgrading the Gemini plugin to 0.1.5 or 0.1.6 resolves similar issues, as newer plugin versions (like 0.2.x) introduced changes that may break file or multimodal input handling in some flows. Also, Gemini's API often requires a 'text' field even when uploading files, so if Dify is only sending a file link or markdown representation, Gemini may reject it as invalid input. If you haven't already, try downgrading your Gemini plugin to 0.1.5 or 0.1.6 and restart your services. If the issue persists, enable debug logs and check the payload being sent to Gemini to confirm it includes the required fields (like 'text' or file content, not just a link) [reference](https://github.com/langgenius/dify/issues/20204) [reference](https://github.com/langgenius/dify/issues/12038). Recent code changes confirm markdown files are intended to be supported for upload [reference](https://github.com/langgenius/dify/pull/22719), so this is likely a plugin compatibility or payload formatting issue, not a fundamental limitation. <!-- 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/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/54621b1d-f7cb-4954-809f-71f7c464cf09?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/23307)
Author
Owner

@U11Leung commented on GitHub (Aug 2, 2025):

other info:

changed the file extension to md.txt, it will work, so it's extension related to some extent.

saw MIME type is application/octet-stream
Image

searched in google forum, found this: https://discuss.ai.google.dev/t/unsupported-mime-type-text-md/83918
sit seems text/md won't work,, Dify doesn't use that anyway

is it possible to use text/plain?

@U11Leung commented on GitHub (Aug 2, 2025): other info: changed the file extension to md.txt, it will work, so it's extension related to some extent. saw MIME type is application/octet-stream <img width="343" height="183" alt="Image" src="https://github.com/user-attachments/assets/449e3e42-0833-4231-8a8a-54a4b96f5f54" /> searched in google forum, found this: https://discuss.ai.google.dev/t/unsupported-mime-type-text-md/83918 sit seems text/md won't work,, Dify doesn't use that anyway is it possible to use text/plain?
Author
Owner

@U11Leung commented on GitHub (Aug 2, 2025):

using gemini plugin 0.3.0

@U11Leung commented on GitHub (Aug 2, 2025): using gemini plugin 0.3.0
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi, @U11Leung. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a 400 INVALID_ARGUMENT error when uploading markdown (.md) files to Gemini 2.5 models in Dify v1.7.1.
  • The error was linked to plugin incompatibility and MIME type handling issues.
  • Changing the file extension to .md.txt worked, indicating a MIME type problem.
  • You were using Gemini plugin version 0.3.0, which is incompatible with Dify v1.7.1.
  • Downgrading the Gemini plugin to 0.1.5 or 0.1.6 resolved the issue.

Next Steps:

  • Please confirm if this issue is still relevant with the latest versions of Dify and the Gemini plugin by commenting here.
  • If no further updates are provided, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 20, 2025): Hi, @U11Leung. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a 400 INVALID_ARGUMENT error when uploading markdown (.md) files to Gemini 2.5 models in Dify v1.7.1. - The error was linked to plugin incompatibility and MIME type handling issues. - Changing the file extension to .md.txt worked, indicating a MIME type problem. - You were using Gemini plugin version 0.3.0, which is incompatible with Dify v1.7.1. - Downgrading the Gemini plugin to 0.1.5 or 0.1.6 resolved the issue. **Next Steps:** - Please confirm if this issue is still relevant with the latest versions of Dify and the Gemini plugin by commenting here. - If no further updates are provided, I will automatically close this issue in 5 days. Thank you 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-official-plugins#509