Troubleshooting
Common issues and solutions for Bifrost
Troubleshooting
Section titled “Troubleshooting”This guide covers common issues you might encounter with Bifrost.
Workflow Not Discovered
Section titled “Workflow Not Discovered”Symptom: Workflow doesn’t appear in UI or API
Check 1: Decorator Applied
Section titled “Check 1: Decorator Applied”# ✅ Correctfrom bifrost import workflow
@workflowasync def my_workflow(name: str): """Do something useful.""" return {"success": True}
# ❌ Wrong: No decoratorasync def my_workflow(name: str): pass
# ❌ Wrong: Not async@workflowdef my_workflow(name: str): # Should be async def passCheck 2: Filename Rules
Section titled “Check 2: Filename Rules”✅ my_workflow.py (discovered)✅ user_onboarding.py (discovered)
❌ _my_workflow.py (ignored, starts with _)❌ my_workflow (no .py) (ignored)Check 3: Check API Logs
Section titled “Check 3: Check API Logs”docker compose logs api | grep -i errordocker compose logs api | grep -i importLook for syntax errors or import failures.
Workflow Execution Fails
Section titled “Workflow Execution Fails”Symptom: Workflow executes but returns error
Check Error Message
Section titled “Check Error Message”Common errors and fixes:
❌ "TypeError: missing required argument" Fix: Form didn't pass all required parameters
❌ "ImportError: cannot import name..." Fix: Check your imports are correct
❌ "asyncio.TimeoutError" Fix: Increase timeout_seconds in @workflow decoratorUse Proper Error Handling
Section titled “Use Proper Error Handling”from bifrost import workflowimport logging
logger = logging.getLogger(__name__)
@workflowasync def my_workflow(email: str): """Example with error handling.""" try: result = await some_api_call(email) return {"success": True, "data": result} except Exception as e: logger.error(f"API call failed: {e}") return {"success": False, "error": str(e)}Timeout Issues
Section titled “Timeout Issues”Symptom: “Execution timeout” or “asyncio.TimeoutError”
Increase Timeout
Section titled “Increase Timeout”@workflow(timeout_seconds=1800) # 30 minutesasync def long_running_task(): """Takes a while to complete.""" passOptimize with Parallel Execution
Section titled “Optimize with Parallel Execution”import asyncio
@workflowasync def import_users(users: list): """Import users in parallel.""" # ❌ Slow: One at a time # for user in users: # await create_user(user)
# ✅ Fast: Parallel tasks = [create_user(user) for user in users] await asyncio.gather(*tasks)Data Provider Issues
Section titled “Data Provider Issues”Symptom: Dropdown in form is empty
Check Return Format
Section titled “Check Return Format”from bifrost import data_provider
# ✅ Correct format@data_provider(name="get_departments", description="List departments")async def get_departments(): return [ {"label": "Engineering", "value": "eng"}, {"label": "Sales", "value": "sales"} ]
# ❌ Wrong: Not list of dicts@data_provider(name="get_departments", description="List departments")async def get_departments(): return ["Engineering", "Sales"] # Missing label/valueCheck for Exceptions
Section titled “Check for Exceptions”Data providers that throw exceptions will return empty results. Add logging:
@data_provider(name="get_users", description="List users")async def get_users(): try: users = await fetch_users() return [{"label": u["name"], "value": u["id"]} for u in users] except Exception as e: logger.error(f"Failed to fetch users: {e}") return []Service Health
Section titled “Service Health”Check All Services Running
Section titled “Check All Services Running”docker compose psAll services should show “Up” status.
Check API Health
Section titled “Check API Health”curl http://localhost:3000/api/healthView Logs
Section titled “View Logs”# All servicesdocker compose logs -f
# Specific servicedocker compose logs -f apidocker compose logs -f workerPort Conflicts
Section titled “Port Conflicts”Check if ports are in use:
lsof -i :3000 # Clientlsof -i :5432 # PostgreSQLlsof -i :5672 # RabbitMQlsof -i :6379 # Redislsof -i :9000 # MinIOFresh Start
Section titled “Fresh Start”If things are really broken, reset everything:
docker compose down -v # Remove volumesdocker compose up # Start freshThis will delete all data and start with a clean database.
Getting Help
Section titled “Getting Help”- GitHub Issues: github.com/jackmusick/bifrost/issues
- Execution Logs: Workflows page → Execution History → Click execution
- Add Logging: Use Python’s
loggingmodule throughout your workflows