Gemini Plugins cannot upload file #822

Closed
opened 2026-02-16 10:20:37 -05:00 by yindo · 6 comments
Owner

Originally created by @rty813 on GitHub (Nov 20, 2025).

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 Dify issues & Dify Official Plugins, 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

v1.8.1

Plugin version

0.6.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I passed a file into "Vision", but got an error when using it: Run failed: [google] Error: req_id: 41b1902800 PluginInvokeError: {"args":{"description":"[models] Error: 'Failed to create file. Upload URL did not returned from the create file request.'"},"error_type":"InvokeError","message":"[models] Error: 'Failed to create file. Upload URL did not returned from the create file request.'"}
Image

Below is my plugin configuration
Image

✔️ Error log

No response

Originally created by @rty813 on GitHub (Nov 20, 2025). ### 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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/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 v1.8.1 ### Plugin version 0.6.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I passed a file into "Vision", but got an error when using it: `Run failed: [google] Error: req_id: 41b1902800 PluginInvokeError: {"args":{"description":"[models] Error: 'Failed to create file. Upload URL did not returned from the create file request.'"},"error_type":"InvokeError","message":"[models] Error: 'Failed to create file. Upload URL did not returned from the create file request.'"}` <img width="389" height="792" alt="Image" src="https://github.com/user-attachments/assets/284b5457-7140-4cbb-8838-65e8eb1eb1b9" /> Below is my plugin configuration <img width="403" height="424" alt="Image" src="https://github.com/user-attachments/assets/3b61bb6e-a22e-4ac6-b1eb-38c4b0f00f54" /> ### ✔️ Error log _No response_
yindo added the bug label 2026-02-16 10:20:37 -05:00
yindo closed this issue 2026-02-16 10:20:37 -05:00
Author
Owner

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

The error "Failed to create file. Upload URL did not returned from the create file request" in the Gemini plugin usually means the plugin couldn't get a valid upload URL from the backend, so the file upload couldn't proceed. In self-hosted Docker setups, this is often caused by misconfiguration of the FILES_URL or network accessibility issues.

The Gemini plugin fetches files from the Dify file store using the configured FILES_URL, then uploads them to Google GenAI. If the file isn't accessible at the specified URL, or if the GenAI SDK doesn't return a valid upload URL, you'll see this error. Double-check that your FILES_URL (and INTERNAL_FILES_URL, if set) is reachable from inside your Docker network and uses the correct protocol, host, and port. Also, make sure your API key and endpoint settings are correct and that there are no firewall or reverse proxy issues blocking access to the file server.

Recent code and merged PRs do not indicate a bug in the plugin itself, so the most likely cause is configuration or network-related. If you adjust your FILES_URL and ensure all services can reach it, the upload should work as expected. For more details on how the plugin handles file uploads, see the relevant code logic here.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Nov 20, 2025): <!-- Answer --> The error "Failed to create file. Upload URL did not returned from the create file request" in the Gemini plugin usually means the plugin couldn't get a valid upload URL from the backend, so the file upload couldn't proceed. In self-hosted Docker setups, this is often caused by misconfiguration of the FILES_URL or network accessibility issues. The Gemini plugin fetches files from the Dify file store using the configured FILES_URL, then uploads them to Google GenAI. If the file isn't accessible at the specified URL, or if the GenAI SDK doesn't return a valid upload URL, you'll see this error. Double-check that your FILES_URL (and INTERNAL_FILES_URL, if set) is reachable from inside your Docker network and uses the correct protocol, host, and port. Also, make sure your API key and endpoint settings are correct and that there are no firewall or reverse proxy issues blocking access to the file server. Recent code and merged PRs do not indicate a bug in the plugin itself, so the most likely cause is configuration or network-related. If you adjust your FILES_URL and ensure all services can reach it, the upload should work as expected. For more details on how the plugin handles file uploads, see the relevant code logic [here](https://github.com/langgenius/dify-official-plugins/blob/b16191ba0270af13159ef06a7fe5cb3fc218f6de/models/gemini/models/llm/llm.py#L124-L962). <!-- 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/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/4b5de989-b100-43fe-a3a3-de9ca41b1beb?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/2110)
Author
Owner

@rty813 commented on GitHub (Nov 21, 2025):

@dosu How should I fill in FILES_URL? I've already entered the domain name of the Dify website, but it doesn't seem to work.

@rty813 commented on GitHub (Nov 21, 2025): [@dosu](https://go.dosu.dev/dosubot) How should I fill in FILES_URL? I've already entered the domain name of the Dify website, but it doesn't seem to work.
Author
Owner

@dosubot[bot] commented on GitHub (Nov 21, 2025):

For a self-hosted Dify (Docker) setup, FILES_URL should point to the internal API service so plugins can fetch files directly. In most Docker Compose deployments, set FILES_URL in your .env file to http://api:5001 (not just your website domain). Make sure port 5001 is exposed in your docker-compose.yaml file—if it's missing, add ports: - "5001:5001" to the API service and restart your containers. This allows the Gemini plugin to access files without redirect or timeout errors. If you deploy outside Docker Compose, use http://<your-host-ip>:5001 instead. More details and examples are available in the plugin docs and related issues (example, code reference).

If you still have trouble, share your current FILES_URL value and Docker setup details.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Nov 21, 2025): <!-- Answer --> For a self-hosted Dify (Docker) setup, FILES_URL should point to the internal API service so plugins can fetch files directly. In most Docker Compose deployments, set `FILES_URL` in your `.env` file to `http://api:5001` (not just your website domain). Make sure port 5001 is exposed in your `docker-compose.yaml` file—if it's missing, add `ports: - "5001:5001"` to the API service and restart your containers. This allows the Gemini plugin to access files without redirect or timeout errors. If you deploy outside Docker Compose, use `http://<your-host-ip>:5001` instead. More details and examples are available in the plugin docs and related issues ([example](https://github.com/langgenius/dify-official-plugins/issues/1816), [code reference](https://github.com/langgenius/dify-official-plugins/blob/4a352e759c87e475153ccf2ff5e2b357bc28d205/tools/mineru/README.md#L139-L161)). If you still have trouble, share your current FILES_URL value and Docker setup details. <!-- 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/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0e1d2554-68ea-4a67-9ba2-3f8999964a43?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/2110)
Author
Owner

@rty813 commented on GitHub (Nov 21, 2025):

@dosu I have set FILES_URL to http://api:5001, but the same error still persists

@rty813 commented on GitHub (Nov 21, 2025): [@dosu](https://go.dosu.dev/dosubot) I have set FILES_URL to http://api:5001, but the same error still persists
Author
Owner

@dosubot[bot] commented on GitHub (Nov 21, 2025):

If you've set FILES_URL to http://api:5001 but the Gemini plugin still can't upload files, the most common cause is that port 5001 isn't exposed in your docker-compose.yaml file. Make sure your API service includes ports: - "5001:5001"—otherwise, the plugin can't reach the file server, even if the URL is correct. After updating, restart your containers for changes to take effect. This fix has resolved similar issues for other users in self-hosted Docker setups (details).

If the error persists, try setting FILES_URL to http://host.docker.internal in your .env file and restart Docker. This workaround has helped in cases where inter-container networking was problematic (details).

Also, check if you have an INTERNAL_FILES_URL variable—if so, set it to the internal Docker API URL (http://api:5001). This ensures plugins use the correct address inside the Docker network.

If none of these work, review your plugin and API container logs for more detailed error messages. Let me know if you need help checking your Docker config or environment variables.

To reply, just mention @dosu.


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

@dosubot[bot] commented on GitHub (Nov 21, 2025): <!-- Answer --> If you've set `FILES_URL` to `http://api:5001` but the Gemini plugin still can't upload files, the most common cause is that port 5001 isn't exposed in your `docker-compose.yaml` file. Make sure your API service includes `ports: - "5001:5001"`—otherwise, the plugin can't reach the file server, even if the URL is correct. After updating, restart your containers for changes to take effect. This fix has resolved similar issues for other users in self-hosted Docker setups ([details](https://github.com/langgenius/dify-official-plugins/issues/1816)). If the error persists, try setting `FILES_URL` to `http://host.docker.internal` in your `.env` file and restart Docker. This workaround has helped in cases where inter-container networking was problematic ([details](https://github.com/langgenius/dify-official-plugins/issues/387)). Also, check if you have an `INTERNAL_FILES_URL` variable—if so, set it to the internal Docker API URL (`http://api:5001`). This ensures plugins use the correct address inside the Docker network. If none of these work, review your plugin and API container logs for more detailed error messages. Let me know if you need help checking your Docker config or environment variables. <!-- 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/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/71eafec8-38c5-4889-9c3c-5db6a57f92f1?feedback_type=other)</sup>&nbsp;&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-official-plugins/issues/2110)
Author
Owner

@IAn2018cs commented on GitHub (Dec 20, 2025):

@dosu I have set FILES_URL to http://api:5001, but the same error still persists

Is the problem solved? I also encountered this problem.

@IAn2018cs commented on GitHub (Dec 20, 2025): > [@dosu](https://go.dosu.dev/dosubot) I have set FILES_URL to http://api:5001, but the same error still persists Is the problem solved? I also encountered this problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#822