Plugin daemon fails after ECS task redeployment with connection errors
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #502 di @fatelei — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- aws, go, postgresql
- Ambito
- backend, cloud, databases, infrastructure
Direzione di ricerca
Inizia tracciando i percorsi segnalati in watcher.go, middleware.go e factory.go, quindi esamina come si comportano lo stato dei plugin e le destinazioni dei redirect durante i nuovi deployment dei task ECS. Riproduci sia l’errore di ricaricamento S3 sia il fallimento della connessione causato dalla modifica EFS/IP usando le impostazioni dell’ambiente e i log elencati. Il lavoro è completato quando i plugin installati vengono ricaricati correttamente e le connessioni continuano a funzionare dopo le modifiche all’IP del task senza cleanup o reinstallazione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Self Checks
To make sure we get to you in time, please check the following :)
- 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."
Versions
- dify-plugin-daemon Version: 0.1.3-local
- dify-api Version: 1.4.3
Describe the bug
Plugin daemon experiences network connection failures when ECS tasks are redeployed, causing plugins to become inaccessible. Two distinct but related issues occur:
Important Question: Is deploying new versions and restarting ECS tasks an expected/supported use case for dify-plugin-daemon? We want to understand if this is a supported deployment pattern or if we're using the plugin daemon outside of its intended scope.
- S3 Storage Issue (Previous): When using S3 for plugin storage, plugins fail to load after container restart with error "plugin_unique_identifier is not valid"
- Network Connection Issue (Current): After switching to EFS + local storage and forcing new deployment, plugin daemon fails to connect to itself using old IP addresses
To Reproduce
Steps to reproduce the behavior:
Issue 1: S3 Storage Problem
- Configure dify-plugin-daemon with
PLUGIN_STORAGE_TYPE=aws_s3 - Install plugins (OpenAI, Bedrock) via Dify web interface
- Restart/redeploy ECS service
- Observe error logs:
2025/07/17 04:50:14 watcher.go:73: [ERROR]list installed plugins failed: plugin_unique_identifier is not valid:
Issue 2: Network Connection Problem (After EFS Migration)
- Configure dify-plugin-daemon with
PLUGIN_STORAGE_TYPE=localand EFS mount - Install plugins via Dify web interface
- Force new deployment via ECS service update
- Check logs and see connection errors to old task IP addresses
Expected behavior
Plugin daemon should:
- Successfully reload installed plugins after container restarts/redeployments
- Handle IP address changes gracefully without requiring manual intervention
- Maintain plugin state consistency across deployments
Screenshots
Error Logs - S3 Storage Issue:
2025/07/17 04:50:14 watcher.go:73: [ERROR]list installed plugins failed:
plugin_unique_identifier is not valid:
Error Logs - Network Connection Issue:
2025/07/18 05:14:00 middleware.go:131: [ERROR]redirect request failed: Post "http://169.254.172.2:5002/plugin/a5df51ca-fba9-4170-8369-4ae0eff4f543/dispatch/model/schema": dial tcp 169.254.172.2:5002: connect: cannot assign requested address
2025/07/18 05:14:00 factory.go:28: [ERROR]PluginDaemonInternalServerError: redirect request failed: Post "http://169.254.172.2:5002/plugin/a5df51ca-fba9-4170-8369-4ae0eff4f543/dispatch/model/schema": dial tcp 169.254.172.2:5002: connect: cannot assign requested address
Environment Configuration:
SERVER_HOST=0.0.0.0
SERVER_PORT=5002
PLUGIN_WORKING_PATH=/app/shared_plugins
PLUGIN_INSTALLED_PATH=installed
PLUGIN_PACKAGE_CACHE_PATH=packages
PLUGIN_STORAGE_TYPE=local
Additional context
Infrastructure Details:
- Platform: AWS ECS Fargate
- Network: awsvpc mode with dynamic IP assignment
- Storage:
- Initial setup: S3 for plugin storage
- Current setup: EFS (NFSv4.1) mounted at
/app/shared_plugins
- Database: Aurora PostgreSQL 15.10
Analysis:
- S3 Issue: Suggests plugin metadata in database becomes inconsistent with actual S3 storage
- Network Issue: Plugin daemon appears to cache/store IP addresses internally, causing connection failures when container IP changes
Potential Root Causes:
- Plugin daemon may be storing absolute network references instead of using localhost/relative addressing
- Database plugin metadata may contain stale network configuration
- Plugin state management may not be designed for ephemeral container environments
Workaround Applied:
Complete plugin cleanup and reinstallation after each deployment:
# Clear EFS plugin data
rm -rf /app/shared_plugins/langgenius/
# Clear database plugin references
DELETE FROM plugins;
DELETE FROM plugin_installations;
DELETE FROM plugin_declarations;
Request:
Is there a configuration option or best practice to make plugin daemon more resilient to container restarts and IP address changes in containerized environments like ECS Fargate?
- Lingua principale
- Go
- Stelle
- 462
- Fork
- 326
- Merge medio
- 22h 15m
- PR unite (30g)
- 8
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di langgenius/dify-plugin-daemon
-
Agent strategy run cut by PLUGIN_MAX_EXECUTION_TIMEOUT is reported only as "Internal Server Error"Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
langgenius/dify-plugin-daemon#863 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
langgenius/dify-plugin-daemon#862 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(install): prevent mirror settings from changing dependency resolution inputsForse già presa @WH-2099 l’ha presa 5 giorni fa. Apertaproject#dify-plugin-daemon
langgenius/dify-plugin-daemon#860 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
READONLY error when using Redis 6.2.2 Sentinel cluster on Kubernetes with dify-plugin-daemon 0.6.10-localForse già presa @Souravrajvi0 l’ha presa 60 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
langgenius/dify-plugin-daemon#826 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
uninstall the plugin, but the plugin package is not removedForse già presa @fatelei l’ha presa 111 giorni fa. Apertabug plugin-daemon
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
langgenius/dify-plugin-daemon#797 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di langgenius/dify-plugin-daemon
Issue simili
-
test_archive_is_downloaded_after_logout_login doesn't wait for the storage client after loginAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
I maintainer di solito rispondono entro 1 giorno
-
list_issues and search_issues: inconsistent `fields` allow-lists (`html_url` rejected by list)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
github/github-mcp-server#3960 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
JuliusBrussee/caveman#1594 ·
I maintainer di solito rispondono entro 1 giorno
-
C-bug O-community X-blathers-triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
cockroachdb/cockroach#176264 · 1 commento ·