Troubleshooting¶
Common issues and solutions when working with Temporal-boost.
Table of Contents¶
- Connection Issues
- Worker Issues
- Activity Issues
- Workflow Issues
- Performance Issues
- Configuration Issues
- Deployment Issues
Connection Issues¶
Cannot Connect to Temporal Server¶
Symptoms: - Connection timeout errors - "Connection refused" errors - Worker fails to start
Solutions:
-
Verify Temporal server is running:
-
Check environment variables:
-
Verify network connectivity:
-
Check firewall rules:
- Ensure port 7233 is open
-
Check security group settings
-
For TLS connections:
TLS Handshake Errors¶
Symptoms: - SSL/TLS errors - Certificate validation failures
Solutions:
-
Verify TLS configuration:
-
For Temporal Cloud:
- Ensure
TEMPORAL_API_KEYis set -
Verify API key is valid
-
For self-hosted with TLS:
- Verify certificate configuration
- Check certificate expiration
Worker Issues¶
Worker Not Starting¶
Symptoms: - Worker fails to initialize - No tasks being processed
Solutions:
-
Check worker registration:
-
Verify worker configuration:
-
Check for reserved names:
- Don't use: "run", "cron", "exec", "all"
-
Use descriptive, unique names
-
Verify activities/workflows are defined:
Unexpected metrics_endpoint Argument¶
Older quick start examples, including the README shipped with Temporal-boost 2.0.2, passed
metrics_endpoint to app.add_worker(). This reaches the SDK's Worker constructor, which does
not accept it, causing TypeError: Worker.__init__() got an unexpected keyword argument 'metrics_endpoint'.
Temporal-boost now rejects the argument during worker registration, even if its value is None.
Direct TemporalWorkerBuilder construction also rejects it.
Remove metrics_endpoint and configure the returned worker's runtime instead:
from temporalio import activity
from temporal_boost import BoostApp
app = BoostApp()
@activity.defn
async def greet(name: str) -> str:
return f"Hello, {name}!"
worker = app.add_worker("worker_1", "task_q_1", activities=[greet])
worker.configure_temporal_runtime(prometheus_bind_address="0.0.0.0:9000")
if __name__ == "__main__":
app.run()
This runtime API is already available in Temporal-boost 2.0.2. Upgrading temporalio from 1.18.1 to
1.20.0 alone does not fix the old example: neither version accepts metrics_endpoint on Worker.
If metrics are unnecessary, remove the argument without configuring an exporter.
Configure the runtime before reading temporal_client_runtime or starting the worker. Each concurrent
runtime needs a distinct Prometheus endpoint; see metrics across workers and processes.
Worker Not Processing Tasks¶
Symptoms: - Worker is running but no tasks processed - Tasks stuck in queue
Solutions:
-
Verify task queue name matches:
-
Check worker is connected:
- Look for connection logs
-
Verify Temporal server is accessible
-
Check task queue in Temporal UI:
- Verify tasks are in the queue
-
Check for pending tasks
-
Verify activity/workflow names:
Activity Issues¶
Activity Not Found¶
Symptoms: - "Activity not found" errors - Activity not executing
Solutions:
-
Verify activity name matches:
-
Check activity is registered:
-
Verify task queue matches:
- Activity must be in worker on same queue
Activity Timeout¶
Symptoms: - Activity timeout errors - "Activity timeout" messages
Solutions:
-
Increase timeout:
-
Check activity execution time:
- Log activity start/end times
-
Optimize slow operations
-
Use heartbeat for long-running activities:
Activity Retry Issues¶
Symptoms: - Activities retrying indefinitely - No retries happening
Solutions:
-
Configure retry policy:
-
Check error types:
- Temporal errors are retried
- Application errors may not be retried
Workflow Issues¶
Workflow Not Starting¶
Symptoms: - Workflow not executing - No workflow runs
Solutions:
-
Verify workflow is registered:
-
Check workflow name:
-
Verify client connection:
Workflow Determinism Errors¶
Symptoms: - "Non-deterministic workflow" errors - Workflow execution failures
Solutions:
-
Don't use random:
-
Don't use datetime.now():
-
Don't perform I/O:
Workflow Timeout¶
Symptoms: - Workflow execution timeout - Long-running workflows fail
Solutions:
-
Use continue-as-new for long workflows:
@workflow.defn(sandboxed=False, name="LongWorkflow") class LongWorkflow: @workflow.run async def run(self, data: list) -> None: for i, item in enumerate(data): if i > 0 and i % 100 == 0: await workflow.continue_as_new(data[i:]) await workflow.execute_activity( process_item, item, task_queue="queue", ) -
Split into multiple workflows:
- Break long workflows into smaller ones
- Use child workflows
Performance Issues¶
High Memory Usage¶
Symptoms: - Memory usage growing - Out of memory errors
Solutions:
-
Reduce concurrency:
-
Limit activity result size:
- Don't return large objects
-
Use external storage for large data
-
Monitor memory:
Slow Workflow Execution¶
Symptoms: - Workflows taking too long - Low throughput
Solutions:
-
Increase concurrency:
-
Use parallel activities:
-
Optimize activity execution:
- Reduce I/O operations
- Use connection pooling
-
Cache results when appropriate
-
Use sticky workflows:
Application Import Errors¶
The external launcher distinguishes these failures:
| Error | Meaning | Next step |
|---|---|---|
Import string ... must be in format ... |
Malformed module:attribute path |
Use package.module:app or package.module:container.app, without expressions. |
Could not import module ... with a chained ModuleNotFoundError |
The requested module or a package prefix is unavailable | Check the module name and launch directory; install the project or set PYTHONPATH for a src layout. |
ModuleNotFoundError: No module named ... naming a dependency |
The application was found, but one of its imports failed | Install or correct that dependency using the original traceback. The importer does not retry other directories. |
Attribute ... not found in module ... |
The module loaded, but the dotted attribute path failed | Check the exported app object and nested attribute names. The original AttributeError is retained as the cause. |
SyntaxError, ImportError, or another application exception |
Python failed while executing application code | Fix the reported source error; directory fallback does not handle application initialization errors. |
A failed import restores sys.path. A successful fallback retains only the directory that resolved
the app so later application imports work. See application import lookup
for the bounded current-directory/parent search and module-cache behavior.
Configuration Issues¶
Environment Variables Not Loading¶
Symptoms: - Configuration not applied - Using default values
Solutions:
-
Verify environment variables:
-
Load from .env before the first package import: The package does not load it automatically. Install
For the installed CLI, prepare the environment before starting the command; loading it inside the imported app module is too late. Environment changes after package import do not refresh defaults.python-dotenvseparately for this direct script example: -
Check variable names:
- Use exact names:
TEMPORAL_TARGET_HOST -
Case-sensitive
-
Verify in code:
Explicit app and worker endpoint/namespace settings override the imported environment. Check configuration priority when a configured value differs from the process environment.
Prometheus Metrics Not Working¶
Symptoms: - Metrics endpoint not accessible - No metrics collected
Solutions:
-
Verify bind address:
-
Check port availability:
-
Verify endpoint:
-
Check runtime configuration:
Deployment Issues¶
Docker Container Issues¶
Symptoms: - Container not starting - Connection errors in container
Solutions:
-
Check network configuration:
-
Verify environment variables:
-
Check logs:
Kubernetes Deployment Issues¶
Symptoms: - Pods not starting - Connection errors
Solutions:
-
Verify service connectivity:
-
Check DNS resolution:
-
Verify secrets:
Debugging Tips¶
Enable Debug Mode¶
Or:
Enable Verbose Logging¶
Check Temporal UI¶
- Access Temporal UI at
http://localhost:8088 - View running workflows
- Check task queues
- Inspect workflow history
Common Log Patterns¶
# Log worker startup
logger.info(f"Worker {worker.name} starting")
# Log activity execution
logger.info(f"Executing activity: {activity_name}")
# Log workflow state
logger.info(f"Workflow state: {workflow_state}")
Getting Help¶
If issues persist:
- Check Temporal documentation
- Review Temporal Python SDK docs
- Check GitHub issues: temporal-boost issues
- Enable debug logging and review logs
- Check Temporal server logs