Plugin authorization fails with 504 Gateway error #12126

Closed
opened 2026-02-21 19:05:54 -05:00 by yindo · 9 comments
Owner

Originally created by @obadakhalili on GitHub (Mar 25, 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 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

1.1.3

Cloud or Self Hosted

Cloud

Steps to reproduce

  • package a plugin I'm building as .difypgk and install it on Dify Cloud
  • try to authorize it

✔️ Expected Behavior

package should be successfully authorized if the credentials are correct.

Actual Behavior

the save button keeps loading indefinitely. inspecting the console tab reveals that the https://cloud.dify.ai/console/api/workspaces/current/tool-provider/builtin/<org-name>/<folder-name>/<plugin-name>/update endpoint returns a 504 Gateway error.

Originally created by @obadakhalili on GitHub (Mar 25, 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 [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 1.1.3 ### Cloud or Self Hosted Cloud ### Steps to reproduce - package a plugin I'm building as `.difypgk` and install it on Dify Cloud - try to authorize it ### ✔️ Expected Behavior package should be successfully authorized if the credentials are correct. ### ❌ Actual Behavior the save button keeps loading indefinitely. inspecting the console tab reveals that the `https://cloud.dify.ai/console/api/workspaces/current/tool-provider/builtin/<org-name>/<folder-name>/<plugin-name>/update` endpoint returns a 504 Gateway error.
yindo added the 🐞 bugcloud labels 2026-02-21 19:05:54 -05:00
yindo closed this issue 2026-02-21 19:05:54 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 25, 2025):

Hello @obadakhalili! I'm here to help you with bugs, questions, and more. Let's work together to resolve your issue.

I found a similar open issue regarding a 504 Gateway error when installing a plugin from a local package file in the Dify cloud version. The suggested solutions include:

  1. Check Network Connectivity: Ensure there are no network issues between your plugin and the endpoint. Verify that the endpoint is accessible and not blocked by any firewall or network restrictions.

  2. Server Load and Timeout Settings: Check if the server handling the request is under heavy load and consider increasing the timeout settings if possible.

  3. Plugin Configuration: Double-check the configuration of your plugin to ensure it is correctly set up to handle requests.

  4. Logs and Monitoring: Review the logs for any errors or warnings that might provide more insight into the issue. Utilize any monitoring tools available in the Dify platform to observe the behavior of your plugin and endpoint.

  5. DNS Resolution: If there are DNS resolution issues, consider using a VPN or adjusting DNS settings to ensure proper access.

Additionally, ensure that the plugin size is within the allowed limits (50 MB) and check the timeout settings, server configuration, and network/DNS issues [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 25, 2025): <!-- Greeting --> Hello @obadakhalili! I'm here to help you with bugs, questions, and more. Let's work together to resolve your issue. <!-- Answer --> I found a similar open issue regarding a 504 Gateway error when installing a plugin from a local package file in the Dify cloud version. The suggested solutions include: 1. **Check Network Connectivity**: Ensure there are no network issues between your plugin and the endpoint. Verify that the endpoint is accessible and not blocked by any firewall or network restrictions. 2. **Server Load and Timeout Settings**: Check if the server handling the request is under heavy load and consider increasing the timeout settings if possible. 3. **Plugin Configuration**: Double-check the configuration of your plugin to ensure it is correctly set up to handle requests. 4. **Logs and Monitoring**: Review the logs for any errors or warnings that might provide more insight into the issue. Utilize any monitoring tools available in the Dify platform to observe the behavior of your plugin and endpoint. 5. **DNS Resolution**: If there are DNS resolution issues, consider using a VPN or adjusting DNS settings to ensure proper access. Additionally, ensure that the plugin size is within the allowed limits (50 MB) and check the timeout settings, server configuration, and network/DNS issues <sup>[[1]](https://github.com/langgenius/dify/issues/15016)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/7c6ee536-5966-4ef3-9ab8-0d0e59723527?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Mar 25, 2025):

Can you try it again?

@crazywoola commented on GitHub (Mar 25, 2025): Can you try it again?
Author
Owner

@obadakhalili commented on GitHub (Mar 25, 2025):

still doesn't work

@obadakhalili commented on GitHub (Mar 25, 2025): still doesn't work
Author
Owner

@obadakhalili commented on GitHub (Mar 27, 2025):

@crazywoola you mentioned here that the Gemini plugin started having this auth issue after they updated the code to write to files.
this issue was in the mem0 plugin, but I think it was fixed in version 0.0.2, after the author removed the SDK and used direct HTTP requests.

I'm using https://github.com/getzep/zep-python in my plugin, which might be writing to files as well.

this might explain why it works in debugging mode but not when installed on the cloud. I'm not sure how the plugin system works internally but I assume lambda functions aren't used when developing locally.

the only two contradictory pieces of info to this logic is that

  • @sanuki-073 says the Gemini plugin worked for him without downgrading when he built the plugin himself and installed it manually.
  • you asked me to try to authorize again to see if the problem disappears which might suggest it is on Dify's end.

what do you think?

@obadakhalili commented on GitHub (Mar 27, 2025): @crazywoola you mentioned [here](https://github.com/langgenius/dify-official-plugins/issues/574#issuecomment-2756754764) that the Gemini plugin started having this auth issue after they updated the code to write to files. [this issue was in the mem0 plugin](https://github.com/Yevanchen/mem0-dify-integrated/issues/1), but I think it was fixed in [version 0.0.2](https://github.com/langgenius/dify-plugins/pull/78), after the author [removed the SDK and used direct HTTP requests](https://github.com/Yevanchen/mem0-dify-integrated/commit/538bd3dd58ee951bf1d7d2cccb5c112246aa383a). I'm using https://github.com/getzep/zep-python in my plugin, which might be writing to files as well. this might explain why it works in debugging mode but not when installed on the cloud. I'm not sure how the plugin system works internally but I assume lambda functions aren't used when developing locally. the only two contradictory pieces of info to this logic is that - @sanuki-073 [says](https://github.com/langgenius/dify-official-plugins/issues/574#issuecomment-2756880693) the Gemini plugin worked for him without downgrading when he built the plugin himself and installed it manually. - you asked me to try to authorize again to see if the problem disappears which might suggest it is on Dify's end. what do you think?
Author
Owner

@Sanuki-073 commented on GitHub (Mar 28, 2025):

@obadakhalili @crazywoola Not sure if this helps, but I uploaded a package of plugin of Gemini that references dify_plugin==0.0.1b68 using Development Tools version 0.0.2 and Python version 3.12.2, and for some reason it worked. I believe the commit identifier used at that time was 7c7fe16 (https://github.com/langgenius/dify-official-plugins/commit/7c7fe16690bc168cb1824ca8784fa5f9e633930d).

@Sanuki-073 commented on GitHub (Mar 28, 2025): @obadakhalili @crazywoola Not sure if this helps, but I uploaded a package of plugin of Gemini that references dify_plugin==0.0.1b68 using Development Tools version 0.0.2 and Python version 3.12.2, and for some reason it worked. I believe the commit identifier used at that time was 7c7fe16 (https://github.com/langgenius/dify-official-plugins/commit/7c7fe16690bc168cb1824ca8784fa5f9e633930d).
Author
Owner

@obadakhalili commented on GitHub (Mar 29, 2025):

I replaced zep_cloud in the plugin's provider code with a direct HTTP request. this must be the only code that runs when authorizing. I packaged the plugin and installed it again, then tried to authorize it, but I still got the same problem. I think this suggests that the issue is at Dify's end.

@obadakhalili commented on GitHub (Mar 29, 2025): I replaced `zep_cloud` in the plugin's provider code with a direct HTTP request. this must be the only code that runs when authorizing. I packaged the plugin and installed it again, then tried to authorize it, but I still got the same problem. I think this suggests that the issue is at Dify's end.
Author
Owner

@dosubot[bot] commented on GitHub (Apr 29, 2025):

Hi, @obadakhalili. I'm Dosu, and I'm helping the Dify team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • Persistent 504 Gateway error when authorizing a plugin on Dify Cloud.
  • My troubleshooting steps did not resolve the issue.
  • Discussions by @crazywoola and @Sanuki-073 pointed to potential plugin code updates and configurations.
  • You suspect the issue might be on Dify's end after further testing.
  • The problem remains unresolved, requiring deeper investigation.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If no updates are provided, the issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Apr 29, 2025): Hi, @obadakhalili. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - Persistent 504 Gateway error when authorizing a plugin on Dify Cloud. - My troubleshooting steps did not resolve the issue. - Discussions by @crazywoola and @Sanuki-073 pointed to potential plugin code updates and configurations. - You suspect the issue might be on Dify's end after further testing. - The problem remains unresolved, requiring deeper investigation. **Next Steps:** - Please confirm if this issue is still relevant to the latest version of the Dify repository by commenting here. - If no updates are provided, the issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Author
Owner

@obadakhalili commented on GitHub (Apr 29, 2025):

the problem was at my end.

@obadakhalili commented on GitHub (Apr 29, 2025): the problem was at my end.
Author
Owner

@dosubot[bot] commented on GitHub (Apr 29, 2025):

Thank you for closing the issue, @obadakhalili! We appreciate your help in keeping the repository organized.

@dosubot[bot] commented on GitHub (Apr 29, 2025): Thank you for closing the issue, @obadakhalili! We appreciate your help in keeping the repository organized.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12126