dify email tool attachment error #617

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

Originally created by @hharch on GitHub (Sep 4, 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

1.7.2

Plugin version

0.0.7

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

send email with attachment

✔️ Error log

error log: Run failed: Failed to invoke tool EmailDemo: An error occurred in the plugin, please contact the author of langgenius/email/email for help, error type: UnsupportedProtocol, error details: Request URL is missing an 'http://' or 'https://' protocol.

Originally created by @hharch on GitHub (Sep 4, 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 1.7.2 ### Plugin version 0.0.7 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce send email with attachment ### ✔️ Error log error log: Run failed: Failed to invoke tool EmailDemo: An error occurred in the plugin, please contact the author of langgenius/email/email for help, error type: UnsupportedProtocol, error details: Request URL is missing an 'http://' or 'https://' protocol.
yindo added the bug label 2026-02-16 10:19:55 -05:00
yindo closed this issue 2026-02-16 10:19:55 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Sep 4, 2025):

Hi @hharch! I'm Dosu and I’m helping the dify-official-plugins team.

This error happens because the email plugin expects file URLs (for attachments) to include the protocol (http:// or https://), but your environment isn't providing them. To fix it, set the FILES_URL and CONSOLE_API_URL environment variables in your Docker .env file to a valid base URL with the protocol included (for example, FILES_URL=http://host.docker.internal). After updating the .env file (usually found at /dify/docker/.env), restart your containers with docker compose up -d for the changes to take effect. This should resolve the "UnsupportedProtocol" error when sending emails with attachments [source 1] [source 2].

This issue is common in self-hosted setups and is not related to your SMTP server configuration. The plugin and platform rely on these environment variables to construct valid URLs for file attachments [source 3].

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 (Sep 4, 2025): <!-- Greeting --> Hi @hharch! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. <!-- Answer --> This error happens because the email plugin expects file URLs (for attachments) to include the protocol (http:// or https://), but your environment isn't providing them. To fix it, set the FILES_URL and CONSOLE_API_URL environment variables in your Docker .env file to a valid base URL with the protocol included (for example, `FILES_URL=http://host.docker.internal`). After updating the .env file (usually found at `/dify/docker/.env`), restart your containers with `docker compose up -d` for the changes to take effect. This should resolve the "UnsupportedProtocol" error when sending emails with attachments [[source 1]](https://github.com/langgenius/dify-official-plugins/issues/387) [[source 2]](https://github.com/langgenius/dify/issues/18257). This issue is common in self-hosted setups and is not related to your SMTP server configuration. The plugin and platform rely on these environment variables to construct valid URLs for file attachments [[source 3]](https://github.com/langgenius/dify-official-plugins/issues/927). <!-- 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/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?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/1657)
Author
Owner

@hharch commented on GitHub (Sep 4, 2025):

Hi @hharch! I'm Dosu and I’m helping the dify-official-plugins team.

This error happens because the email plugin expects file URLs (for attachments) to include the protocol (http:// or https://), but your environment isn't providing them. To fix it, set the FILES_URL and CONSOLE_API_URL environment variables in your Docker .env file to a valid base URL with the protocol included (for example, FILES_URL=http://host.docker.internal). After updating the .env file (usually found at /dify/docker/.env), restart your containers with docker compose up -d for the changes to take effect. This should resolve the "UnsupportedProtocol" error when sending emails with attachments [source 1] [source 2].

This issue is common in self-hosted setups and is not related to your SMTP server configuration. The plugin and platform rely on these environment variables to construct valid URLs for file attachments [source 3].

To reply, just mention @dosu.

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

Got it,3Q,solved

@hharch commented on GitHub (Sep 4, 2025): > Hi [@hharch](https://github.com/hharch)! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify-official-plugins team. > > This error happens because the email plugin expects file URLs (for attachments) to include the protocol (http:// or https://), but your environment isn't providing them. To fix it, set the FILES_URL and CONSOLE_API_URL environment variables in your Docker .env file to a valid base URL with the protocol included (for example, `FILES_URL=http://host.docker.internal`). After updating the .env file (usually found at `/dify/docker/.env`), restart your containers with `docker compose up -d` for the changes to take effect. This should resolve the "UnsupportedProtocol" error when sending emails with attachments [[source 1]](https://github.com/langgenius/dify-official-plugins/issues/387) [[source 2]](https://github.com/langgenius/dify/issues/18257). > > This issue is common in self-hosted setups and is not related to your SMTP server configuration. The plugin and platform rely on these environment variables to construct valid URLs for file attachments [[source 3]](https://github.com/langgenius/dify-official-plugins/issues/927). > > _To reply, just mention [@dosu](https://go.dosu.dev/dosubot)._ > > How did I do? [Good](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/1cdca166-6913-4a6f-bd7d-309f3f28829f?feedback_type=other)  [![Join Discord](https://camo.githubusercontent.com/d562c2df5e4567ea41d37f1d91a4da0839d8341037045b103b2da268998de17f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6a6f696e2d3538363546323f6c6f676f3d646973636f7264266c6f676f436f6c6f723d7768697465266c6162656c3d)](https://go.dosu.dev/discord-bot) [![Share on X](https://camo.githubusercontent.com/4649f705e2396d6f328dbc8e800a0509c9c17b3b20253b36706c393df124b93d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f582d73686172652d626c61636b)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/1657) Got it,3Q,solved
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#617