Troubleshooting
QueueProtocol Not Resolved
Section titled “QueueProtocol Not Resolved”Error:
ContainerError: No binding registered for QueueProtocolCause: QueueModule.configure(config) was not added to your module’s imports, or the backends list is empty.
Fix:
@module(imports=[QueueModule.configure(config)])class AppModule(Module): passVerify config.backends has at least one entry with primary=True.
Redis Backend: Connection Refused
Section titled “Redis Backend: Connection Refused”Error:
lexigram.queue.exceptions.RedisQueueError: Connection refusedCause: Redis server is not running or the URL is wrong.
Fix: Check the url in RedisDriverConfig:
NamedQueueConfig( name="default", driver="redis", redis=RedisDriverConfig(url="redis://localhost:6379/1"),)Kafka Backend: Leader Not Available
Section titled “Kafka Backend: Leader Not Available”Error:
lexigram.queue.exceptions.KafkaQueueError: LeaderNotAvailableCause: Kafka broker is unreachable, or topic does not exist and auto-creation is disabled.
Fix: Verify KafkaDriverConfig.bootstrap_servers and broker availability:
kafka-topics.sh --bootstrap-server localhost:9092 --listSQS Backend: Access Denied
Section titled “SQS Backend: Access Denied”Error:
lexigram.queue.exceptions.SQSQueueError: AccessDeniedCause: AWS credentials lack permission to publish/subscribe to the queue.
Fix: Update IAM policy to include sqs:SendMessage and sqs:ReceiveMessage.
Azure Service Bus: Authentication Failed
Section titled “Azure Service Bus: Authentication Failed”Error:
lexigram.queue.exceptions.AzureServiceBusQueueError: Authentication failedCause: Connection string is invalid or expired.
Fix: Regenerate the connection string in the Azure portal and update AzureServiceBusDriverConfig.connection_str.
GCP Pub/Sub: Topic Not Found
Section titled “GCP Pub/Sub: Topic Not Found”Error:
lexigram.queue.exceptions.GCPPubSubQueueError: Topic not foundCause: The Pub/Sub topic does not exist in the GCP project.
Fix: Create the topic or verify GCPPubSubDriverConfig.topic_id and project_id.
Unsupported Queue Driver
Section titled “Unsupported Queue Driver”Error:
ValueError: Unsupported queue driver: my_driverCause: The driver field in NamedQueueConfig is not one of the supported values.
Fix: Use one of: memory, redis, rabbitmq, kafka, sqs, azure_servicebus, gcp_pubsub.
No Primary Backend Defined
Section titled “No Primary Backend Defined”Runtime behavior: QueueProtocol fails to resolve for unnamed injection.
Cause: No backend has primary=True when you attempt unnamed QueueProtocol resolution.
Fix: Set primary=True on at least one backend entry, or use named injection (Annotated[QueueProtocol, Named("name")]).
Debug Tips
Section titled “Debug Tips”- Enable logging: set
queue.backends[i].enable_logging(future) or use the framework logger atDEBUGlevel. - Check backend health:
queue.health_check(timeout=5.0)returns aggregated status for all backends. - Verify container bindings:
container.is_registered(QueueProtocol)andcontainer.find(QueueProtocol, name="events"). - Override memory backend in tests using
QueueModule.stub()— no external broker required.