Vendored deer-flow upstream (bytedance/deer-flow) plus prompt-injection hardening: - New deerflow.security package: content_delimiter, html_cleaner, sanitizer (8 layers — invisible chars, control chars, symbols, NFC, PUA, tag chars, horizontal whitespace collapse with newline/tab preservation, length cap) - New deerflow.community.searx package: web_search, web_fetch, image_search backed by a private SearX instance, every external string sanitized and wrapped in <<<EXTERNAL_UNTRUSTED_CONTENT>>> delimiters - All native community web providers (ddg_search, tavily, exa, firecrawl, jina_ai, infoquest, image_search) replaced with hard-fail stubs that raise NativeWebToolDisabledError at import time, so a misconfigured tool.use path fails loud rather than silently falling back to unsanitized output - Native client back-doors (jina_client.py, infoquest_client.py) stubbed too - Native-tool tests quarantined under tests/_disabled_native/ (collect_ignore_glob via local conftest.py) - Sanitizer Layer 7 fix: only collapse horizontal whitespace, preserve newlines and tabs so list/table structure survives - Hardened runtime config.yaml references only the searx-backed tools - Factory overlay (backend/) kept in sync with deer-flow tree as a reference / source See HARDENING.md for the full audit trail and verification steps.
11 KiB
Troubleshooting Guide
This document lists common issues encountered during DeerFlow smoke testing and how to resolve them.
Code Update Issues
Issue: git pull Fails with a Merge Conflict Warning
Symptoms:
error: Your local changes to the following files would be overwritten by merge
Solutions:
-
Option A: Commit local changes first
git add . git commit -m "Save local changes" git pull origin main -
Option B: Stash local changes
git stash git pull origin main git stash pop # Restore changes later if needed -
Option C: Discard local changes (use with caution)
git reset --hard HEAD git pull origin main
Local Mode Environment Issues
Issue: Node.js Version Is Too Old
Symptoms:
Node.js version is too old. Requires 22+, got x.x.x
Solutions:
-
Install or upgrade Node.js with nvm:
nvm install 22 nvm use 22 -
Or download and install it from the official website: https://nodejs.org/
-
Verify the version:
node --version
Issue: pnpm Is Not Installed
Symptoms:
command not found: pnpm
Solutions:
-
Install pnpm with npm:
npm install -g pnpm -
Or use the official installation script:
curl -fsSL https://get.pnpm.io/install.sh | sh - -
Verify the installation:
pnpm --version
Issue: uv Is Not Installed
Symptoms:
command not found: uv
Solutions:
-
Use the official installation script:
curl -LsSf https://astral.sh/uv/install.sh | sh -
macOS users can also install it with Homebrew:
brew install uv -
Verify the installation:
uv --version
Issue: nginx Is Not Installed
Symptoms:
command not found: nginx
Solutions:
-
macOS (Homebrew):
brew install nginx -
Ubuntu/Debian:
sudo apt update sudo apt install nginx -
CentOS/RHEL:
sudo yum install nginx -
Verify the installation:
nginx -v
Issue: Port Is Already in Use
Symptoms:
Error: listen EADDRINUSE: address already in use :::2026
Solutions:
-
Find the process using the port:
lsof -i :2026 # macOS/Linux netstat -ano | findstr :2026 # Windows -
Stop that process:
kill -9 <PID> # macOS/Linux taskkill /PID <PID> /F # Windows -
Or stop DeerFlow services first:
make stop
Local Mode Dependency Installation Issues
Issue: make install Fails Due to Network Timeout
Symptoms: Network timeouts or connection failures occur during dependency installation.
Solutions:
-
Configure pnpm to use a mirror registry:
pnpm config set registry https://registry.npmmirror.com -
Configure uv to use a mirror registry:
uv pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple -
Retry the installation:
make install
Issue: Python Dependency Installation Fails
Symptoms:
Errors occur during uv sync.
Solutions:
-
Clean the uv cache:
cd backend uv cache clean -
Resync dependencies:
cd backend uv sync -
View detailed error logs:
cd backend uv sync --verbose
Issue: Frontend Dependency Installation Fails
Symptoms:
Errors occur during pnpm install.
Solutions:
-
Clean the pnpm cache:
cd frontend pnpm store prune -
Remove node_modules and the lock file:
cd frontend rm -rf node_modules pnpm-lock.yaml -
Reinstall:
cd frontend pnpm install
Local Mode Service Startup Issues
Issue: Services Exit Immediately After Startup
Symptoms:
Processes exit quickly after running make dev-daemon.
Solutions:
-
Check log files:
tail -f logs/langgraph.log tail -f logs/gateway.log tail -f logs/frontend.log tail -f logs/nginx.log -
Check whether config.yaml is configured correctly
-
Check environment variables in the .env file
-
Confirm that required ports are not occupied
-
Stop all services and restart:
make stop make dev-daemon
Issue: Nginx Fails to Start Because Temp Directories Do Not Exist
Symptoms:
nginx: [emerg] mkdir() "/opt/homebrew/var/run/nginx/client_body_temp" failed (2: No such file or directory)
Solutions:
Add local temp directory configuration to docker/nginx/nginx.local.conf so nginx uses the repository's temp directory.
Add the following at the beginning of the http block:
client_body_temp_path temp/client_body_temp;
proxy_temp_path temp/proxy_temp;
fastcgi_temp_path temp/fastcgi_temp;
uwsgi_temp_path temp/uwsgi_temp;
scgi_temp_path temp/scgi_temp;
Note: The temp/ directory under the repository root is created automatically by make dev or make dev-daemon.
Issue: Nginx Fails to Start (General)
Symptoms: The nginx process fails to start or reports an error.
Solutions:
-
Check the nginx configuration:
nginx -t -c docker/nginx/nginx.local.conf -p . -
Check nginx logs:
tail -f logs/nginx.log -
Ensure no other nginx process is running:
ps aux | grep nginx -
If needed, stop existing nginx processes:
pkill -9 nginx
Issue: Frontend Compilation Fails
Symptoms:
Compilation errors appear in frontend.log.
Solutions:
-
Check frontend logs:
tail -f logs/frontend.log -
Check whether Node.js version is 22+
-
Reinstall frontend dependencies:
cd frontend rm -rf node_modules .next pnpm install -
Restart services:
make stop make dev-daemon
Issue: Gateway Fails to Start
Symptoms:
Errors appear in gateway.log.
Solutions:
-
Check gateway logs:
tail -f logs/gateway.log -
Check whether config.yaml exists and has valid formatting
-
Check whether Python dependencies are complete:
cd backend uv sync -
Confirm that the LangGraph service is running normally (if not in gateway mode)
Issue: LangGraph Fails to Start
Symptoms:
Errors appear in langgraph.log.
Solutions:
-
Check LangGraph logs:
tail -f logs/langgraph.log -
Check config.yaml
-
Check whether Python dependencies are complete
-
Confirm that port 2024 is not occupied
Docker-Related Issues
Issue: Docker Commands Cannot Run
Symptoms:
Cannot connect to the Docker daemon
Solutions:
- Confirm that Docker Desktop is running
- macOS: check whether the Docker icon appears in the top menu bar
- Linux: run
sudo systemctl start docker - Run
docker infoagain to verify
Issue: make docker-init Fails to Pull the Image
Symptoms:
Error pulling image: connection refused
Solutions:
- Check network connectivity
- Configure a Docker image mirror if needed
- Check whether a proxy is required
- Switch to local installation mode if necessary (recommended)
Configuration File Issues
Issue: config.yaml Is Missing or Invalid
Symptoms:
Error: could not read config.yaml
Solutions:
-
Regenerate the configuration file:
make config -
Check YAML syntax:
- Make sure indentation is correct (use 2 spaces)
- Make sure there are no tab characters
- Check that there is a space after each colon
-
Use a YAML validation tool to check the format
Issue: Model API Key Is Not Configured
Symptoms: After services start, API requests fail with authentication errors.
Solutions:
-
Edit the .env file and add the API key:
OPENAI_API_KEY=your-actual-api-key-here -
Restart services (local mode):
make stop make dev-daemon -
Restart services (Docker mode):
make docker-stop make docker-start -
Confirm that the model configuration in config.yaml references the environment variable correctly
Service Health Check Issues
Issue: Frontend Page Is Not Accessible
Symptoms: The browser shows a connection failure when visiting http://localhost:2026.
Solutions (local mode):
-
Confirm that the nginx process is running:
ps aux | grep nginx -
Check nginx logs:
tail -f logs/nginx.log -
Check firewall settings
Solutions (Docker mode):
-
Confirm that the nginx container is running:
docker ps | grep nginx -
Check nginx logs:
cd docker && docker compose -p deer-flow-dev -f docker-compose-dev.yaml logs nginx -
Check firewall settings
Issue: API Gateway Health Check Fails
Symptoms:
Accessing /health returns an error or times out.
Solutions (local mode):
-
Check gateway logs:
tail -f logs/gateway.log -
Confirm that config.yaml exists and has valid formatting
-
Check whether Python dependencies are complete
-
Confirm that the LangGraph service is running normally
Solutions (Docker mode):
-
Check gateway container logs:
make docker-logs-gateway -
Confirm that config.yaml is mounted correctly
-
Check whether Python dependencies are complete
-
Confirm that the LangGraph service is running normally
Common Diagnostic Commands
Local Mode Diagnostics
View All Service Processes
ps aux | grep -E "(langgraph|uvicorn|next|nginx)" | grep -v grep
View Service Logs
# View all logs
tail -f logs/*.log
# View specific service logs
tail -f logs/langgraph.log
tail -f logs/gateway.log
tail -f logs/frontend.log
tail -f logs/nginx.log
Stop All Services
make stop
Fully Reset the Local Environment
make stop
make clean
make config
make install
make dev-daemon
Docker Mode Diagnostics
View All Container Status
docker ps -a
View Container Resource Usage
docker stats
Enter a Container for Debugging
docker exec -it deer-flow-gateway sh
Clean Up All DeerFlow-Related Containers and Images
make docker-stop
cd docker && docker compose -p deer-flow-dev -f docker-compose-dev.yaml down -v
Fully Reset the Docker Environment
make docker-stop
make clean
make config
make docker-init
make docker-start
Get More Help
If the solutions above do not resolve the issue:
- Check the GitHub issues for the project: https://github.com/bytedance/deer-flow/issues
- Review the project documentation: README.md and the
backend/docs/directory - Open a new issue and include detailed error logs