LocalStack

CloudWatch Logs StartQuery API fails with TypeError when called from Grafana

warning
availabilityUpdated Jan 25, 2025(via Exa)
Technologies:
How to detect:

When Grafana or other clients invoke the CloudWatch Logs StartQuery API against LocalStack, the request fails with HTTP 500 InternalError. The underlying cause is a TypeError in the moto library backend where it attempts to iterate over None when log_group_names is not properly passed. Basic log operations like get-log-events continue to work normally.

Recommended action:

Use awslocal logs get-log-events as a workaround for direct log retrieval. Monitor LocalStack logs for 'TypeError: NoneType object is not iterable' errors in moto/logs/models.py. Upgrade LocalStack to a version beyond 4.0.4.dev135 where this issue was resolved. For Grafana integration, consider alternative log data sources until the issue is fixed.