Troubleshooting Guide
Troubleshooting Guide
1. MongoDB Connection Refused
Symptoms: Server fails to start. Log shows mongodb: connection refused or dial tcp: connect: connection refused.
Causes & Fixes:
- MongoDB is not running β start it:
docker-compose up -d mongo - Wrong
MONGODB_URIformat β must be:mongodb://host:port(no trailing slash) - MongoDB is on a different network β ensure app and mongo are on the same Docker network
- Auth required but not in URI β use:
mongodb://user:pass@host:27017/dbname?authSource=admin - Firewall blocking port 27017 β check
ufw statusor security group rules
# Test connectivitymongosh "mongodb://localhost:27017" --eval "db.runCommand({ ping: 1 })"2. Encryption Key Errors
Symptoms: invalid key length, decryption failed, or startup panic related to encryption.
Cause: ENV_KEY_SALT must be exactly 64 hex characters (32 bytes). ENC_KEY_SECRET must be exactly 256 hex characters (128 bytes).
# Count charactersecho -n "$ENV_KEY_SALT" | wc -c # Must be 64echo -n "$ENC_KEY_SECRET" | wc -c # Must be 256
# Generate correct valuesopenssl rand -hex 32 # β 64 chars (for ENV_KEY_SALT)openssl rand -hex 128 # β 256 chars (for ENC_KEY_SECRET)Important: Changing these keys after data has been stored will make all encrypted data (KV values, OAuth tokens, credentials) unreadable. Never rotate keys without a migration plan.
3. Module Not Discovered
Symptoms: Module doesnβt appear in the UI or API after adding it. No error at startup.
Cause: The factory method name doesnβt follow the required naming convention.
Fix: The factory method must:
- Be a method on
*PluginModule(not on your module struct) - Be named exactly
NewModule<CamelName>(case-sensitive) - Return a pointer to your module struct
// β
Correctfunc (p *PluginModule) NewModuleMyTool() *ModuleMyTool { ... }
// β Wrong β receiver is wrongfunc (m *ModuleMyTool) NewModuleMyTool() *ModuleMyTool { ... }
// β Wrong β method name doesn't start with NewModulefunc (p *PluginModule) CreateMyTool() *ModuleMyTool { ... }Also verify the file is in pkg/plugins/layers/v2/ and the package declaration is package layers.
Set APPS_FORCEUPDATE=true and restart to force re-registration.
4. Channel Port Conflicts
Symptoms: Channel fails to start. Error: address already in use or bind: permission denied.
Causes:
- Another process is using a port in the
7701-7799range - Running multiple flow8 instances with overlapping port ranges
- Channel was not properly stopped and port is still held
Fix:
# Find what's using the portlsof -i :7701
# Kill the process if it's a stale flow8 processkill -9 <PID>For multiple instances, configure non-overlapping ranges in each instanceβs CHANNEL_PORT_RANGE (e.g., 7701-7750 and 7751-7799).
5. LibreOffice / Tesseract Not Working
Symptoms: Document conversion or OCR modules fail. Error: soffice not found or tesseract: command not found.
Checklist:
- Verify binaries are installed:
which soffice && soffice --version - Check
CAPS_SOFFICE=trueandCAPS_TESSERACT=truein.env - Verify
.config.yamlhas correctpath.soffice:path:soffice: "/usr/bin/soffice" # Linux# soffice: "/Applications/LibreOffice.app/Contents/MacOS/soffice" # macOS - In Docker, these are pre-installed in the image. If running from source, install system packages.
- LibreOffice may fail if no display is available β set
DISPLAY=:0or use a headless config.
6. CORS Errors
Symptoms: Browser requests blocked with CORS policy: No 'Access-Control-Allow-Origin' header.
Fix: Add the frontend origin to ALLOWED_ORIGINS:
ALLOWED_ORIGINS=http://localhost:3000,https://app.yourcompany.comAlso ensure FRONTEND_URL is set correctly. If using cookies for auth, allowCredentials: true (already set in config.yml) requires that ALLOWED_ORIGINS is not * β it must list explicit origins.
7. OAuth2 Redirect Failures
Symptoms: Microsoft OAuth2 login fails with redirect_uri_mismatch or AADSTS50011.
Fix: The redirect URI registered in Azure AD must exactly match the one flow8 generates:
https://your-domain.com/api/auth/oauth2/microsoft/callbackRegister this exact URL in your Azure AD appβs Redirect URIs (under Authentication). Ensure API_URL is set to the correct public base URL.
8. Session Expiry Issues
Symptoms: Users are logged out unexpectedly or session cookies are not set.
Fixes:
- Increase session TTL in
config/config.yml:auth.session.lifeTime: 86400(24 hours) - Set
COOKIE_DOMAINif frontend is on a subdomain:COOKIE_DOMAIN=.yourcompany.com - Ensure the frontend is sending cookies with requests (
credentials: 'include'in fetch) - Check that TLS is in use β
Securecookies require HTTPS
9. High Memory Usage
Symptoms: Process memory grows over time without leveling off.
Likely causes:
- TTL cache not evicting β verify
ClearTTLCachejob is running (check logs for 1-minute interval) - Retention cleanup not running β verify
RetentionPolicyServicecleanup job is active playsandauditcollections growing unbounded β configure retention policies- Large flow output data stored in memory β reduce
UNIT_OUTPUT_UI_MAX_BYTES
10. Slow Flow Execution
Symptoms: Flows take much longer than expected.
Checklist:
- Add MongoDB indexes (see Database Setup β Recommended Indexes)
- Check if MongoDB is CPU/IO bound:
mongostat - Review module component timeouts β unreachable external services cause waits
- Use the WebSocket stream to identify which specific flowlet is slow
- Enable query profiling in MongoDB:
db.setProfilingLevel(1, { slowms: 100 })
11. MCP Auth Failures
Symptoms: AI agent cannot authenticate with the MCP server on port 4445. Error: invalid token or unauthorized.
Fix:
- Ensure
MCP_JWT_SECRETis set and matches the secret used to sign the JWT - The JWT must include
scope: "mcp"in its claims - Verify the MCP server is running (check logs for
MCP server started on :4445) - Test with a manually generated JWT:
{"userId": "...", "companyId": "...", "scope": "mcp"}
12. Build Failures (Private Modules)
Symptoms: go mod download or go run fails with module not found or authentication required.
Fix:
# Set credentialsexport GOPRIVATE=git.qix.sx/gorgany/gorgany.gitexport GOPROXY=https://goproxy.cn
# Configure Git to inject credentialsgit config --global url."https://USERNAME:TOKEN@github.com/".insteadOf "https://github.com/"
# Clear module cache and retrygo clean -modcachego mod download