Troubleshooting
Overview
This guide covers common issues and solutions you may encounter when developing with Tasker and deploying Tasker-based workflows to production. It's organized into development-time issues and deployment-time issues for easy navigation.
Development Troubleshooting
Task Handler Issues
"Task handler not found" or "NameError: uninitialized constant"
Symptoms:
# Error when trying to create or execute tasks
NameError: uninitialized constant OrderProcess
# or
Tasker::TaskHandler::NotFoundError: Task handler 'order_process' not foundCommon Causes & Solutions:
File naming mismatch
# Ensure file name matches class name app/tasks/order_process.rb # File name should be snake_case class OrderProcess # Class name should be CamelCaseYAML configuration mismatch
# config/tasker/tasks/order_process.yaml name: order_process # Must match file name task_handler_class: OrderProcess # Must match class name exactlyModule namespace issues
# If using module namespaces, ensure they're consistent # YAML: module_namespace: ECommerce # File: app/tasks/e_commerce/order_process.rb module ECommerce class OrderProcess < Tasker::TaskHandler::BaseRails autoloading not picking up changes
# Restart Rails server to reload task handlers bundle exec rails server # Or in development, force reload Rails.application.reloader.reload!
"Step handler not found" or Step execution failures
Symptoms:
Solutions:
Check file structure and naming
Verify YAML step configuration
Check inheritance
Step Dependency Issues
Steps not executing in expected order
Symptoms:
Steps run simultaneously when they should be sequential
Steps wait indefinitely for dependencies
Circular dependency errors
Diagnosis & Solutions:
Check dependency configuration
Verify step names match exactly
Check for circular dependencies
Debug dependency resolution
Diamond pattern dependency issues
Problem: Steps with multiple dependency paths not executing correctly
Solution:
Step Implementation Issues
Steps marked as failed when they should succeed
Symptoms:
Step completes successfully but shows as "error" state
Expected return values not stored in step.results
Common Causes & Solutions:
Exception handling masking success
Incorrect return values
Data not passed between steps correctly
Symptoms:
Dependent steps can't access previous step results
nil or empty results from previous steps
Solutions:
Check step name references
Verify previous step completed successfully
Handle missing or malformed results
Retry Logic Issues
Steps not retrying when they should
Symptoms:
Failed steps go directly to error state instead of retrying
Retry count not incrementing
Solutions:
Check retry configuration
Verify exception types
Check retry state in database
Infinite retry loops
Symptoms:
Steps retry indefinitely
High CPU usage from constant retrying
Solutions:
Check retry limits
Implement exponential backoff awareness
JSON Schema Validation Issues
Task requests failing validation
Symptoms:
Solutions:
Check schema definition in YAML
Validate context before task creation
Deployment Troubleshooting
Observability & Monitoring
Tasks stuck in pending state
Symptoms:
Tasks created but never progress beyond 'pending'
No step execution occurring
Diagnosis Steps:
Check ActiveJob backend
Verify database connectivity
Check SQL function availability
Monitor workflow coordination
No step execution events
Symptoms:
Tasks and steps exist but no lifecycle events
Missing telemetry data
Solutions:
Verify event system configuration
Check event subscribers
Enable telemetry
Performance Issues
Slow step readiness calculations
Symptoms:
Long delays between step completions and dependent step execution
High database CPU usage
Solutions:
Check SQL function performance
Verify database indexes
Monitor function call frequency
Memory leaks in long-running tasks
Symptoms:
Memory usage grows over time
Application becomes unresponsive
Solutions:
Check step result sizes
Implement result cleanup
Error Analysis
Analyzing step failure patterns
Diagnostic Queries:
Debugging specific task execution
Logging & Observability Setup
Structured logging configuration
Custom event subscribers for monitoring
Production health checks
Diagnostic Tools & Commands
Useful Rails Console Commands
Database Queries for Analysis
Getting Help
Documentation Resources
Quick Start Guide - Basic workflow creation
Developer Guide - Comprehensive implementation guide
Event System - Observability and monitoring setup
Authentication - Security configuration
System Overview - Architecture and advanced configuration
Community & Support
Check the GitHub issues for similar problems
Review test examples in the
spec/directoryExamine example implementations in
spec/examples/
Debug Mode
Enable verbose logging for deeper insight:
Remember: Tasker is designed to be resilient and self-healing. Many transient issues will resolve themselves through the retry mechanism. Focus on patterns of persistent failures rather than isolated incidents.
Last updated