mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
OpenAI Compatible Dify App Plugin Generates Incorrect API Endpoint URLs #350
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lukefan on GitHub (Jun 6, 2025).
Self Checks
Dify version
1.4.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Steps to Reproduce:
✔️ Expected Behavior
The plugin should generate API endpoint URLs based on the configured APP_WEB_URL in the .env file, and these URLs should work when used in applications like Cherry Studio.
❌ Actual Behavior
@dosubot[bot] commented on GitHub (Jun 6, 2025):
I couldn't find any existing issues or documentation about this specific URL generation problem, but based on the code, the plugin uses a template (
ENDPOINT_URL_TEMPLATE) and a config value (PLUGIN_DAEMON_URL) to build the endpoint URLs. By default, both are set to uselocalhost, which explains why your generated URLs point there instead of your configured IP. If these values aren't explicitly overridden in your environment or Docker setup, the defaults will be used, regardless of yourAPP_WEB_URLsetting.To fix this, make sure you set both
PLUGIN_DAEMON_URLandENDPOINT_URL_TEMPLATEin your.envfile to use your desired IP address, for example:Restart your containers after making these changes. This should ensure the plugin generates URLs with the correct IP.
The extra
}in the URL suggests a formatting bug—double-check for typos in your config and ensure the template string is exactly{hook_id}. If the problem persists after correcting the config, there may be a bug in how the template is rendered in the code (see implementation).If Cherry Studio still reports "Invalid URL" after these changes, it could be due to a malformed URL or a missing route on your Dify instance. Double-check the full endpoint path and ensure your app is accessible at the configured address.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

@lukefan commented on GitHub (Jun 6, 2025):
DB_PLUGIN_DATABASE=dify_plugin
EXPOSE_PLUGIN_DAEMON_PORT=5002
PLUGIN_DAEMON_PORT=5002
PLUGIN_DAEMON_KEY=lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi
PLUGIN_DAEMON_URL=http://plugin_daemon:5002
PLUGIN_MAX_PACKAGE_SIZE=52428800
PLUGIN_PPROF_ENABLED=false
PLUGIN_DEBUGGING_HOST=0.0.0.0
PLUGIN_DEBUGGING_PORT=5003
EXPOSE_PLUGIN_DEBUGGING_HOST=localhost
EXPOSE_PLUGIN_DEBUGGING_PORT=5003
PLUGIN_DIFY_INNER_API_KEY=QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1
PLUGIN_DIFY_INNER_API_URL=http://api:5001
ENDPOINT_URL_TEMPLATE=http://localhost/e/{hook_id}
I’ve tested the plugin-related configurations, and there are quite a few settings involved. When I tried changing the port from 5002 to 3330, the entire system stopped working—models couldn’t connect at all. Additionally, the original port (5002) wasn’t exposed externally, so it couldn’t be accessed from outside the local environment.
Even when I only modified the two settings you provided (without changing other configurations), the issue persisted: all models became unreachable. The system behaves as if the configuration changes disrupted the model connectivity, regardless of whether the port is adjusted or only partial settings are updated.
When accessing the URL http://192.168.0.66:3330/e/u6p4nh568i323flk/chat/completions/ in the browser, the following error is returned:
"Failed to dispatch endpoint request: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually, please check your spelling and try again."
@sunlight002 commented on GitHub (Jun 21, 2025):
+1
@dosubot[bot] commented on GitHub (Aug 20, 2025):
Hi, @lukefan. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.
Issue Summary:
PLUGIN_DAEMON_URLandENDPOINT_URL_TEMPLATEunless overridden in the.envfile.Next Steps:
Thank you for your understanding and contribution!