{"record":{"id":"c1d0ef6cb9ac000a","repo":"getredash/redash","slug":"request-exceeded-timeout","errorCode":null,"errorMessage":"Request exceeded timeout.","messagePattern":"Request exceeded timeout\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"redash/query_runner/cloudwatch_insights.py","lineNumber":144,"sourceCode":"\n        return log_groups\n\n    def run_query(self, query, user):\n        logs = self._get_client()\n\n        query = parse_query(query)\n        query_id = logs.start_query(**query)[\"queryId\"]\n\n        elapsed = 0\n        while True:\n            result = logs.get_query_results(queryId=query_id)\n            if result[\"status\"] == \"Complete\":\n                data = parse_response(result)\n                break\n            if result[\"status\"] in (\"Failed\", \"Timeout\", \"Unknown\", \"Cancelled\"):\n                raise Exception(\"CloudWatch Insights Query Execution Status: {}\".format(result[\"status\"]))\n            elif elapsed > TIMEOUT:\n                raise Exception(\"Request exceeded timeout.\")\n            else:\n                time.sleep(POLL_INTERVAL)\n                elapsed += POLL_INTERVAL\n\n        return data, None\n\n\nregister(CloudWatchInsights)\n","sourceCodeStart":126,"sourceCodeEnd":153,"githubUrl":"https://github.com/getredash/redash/blob/ca79fe988d81cdac9675b412f3dfcab107bc1fbc/redash/query_runner/cloudwatch_insights.py#L126-L153","documentation":"Companion guard in the same CloudWatch Insights polling loop: if elapsed polling time exceeds the module's TIMEOUT while the query is still neither Complete nor in a terminal failed state, Redash gives up — the query may still finish on AWS's side later.","triggerScenarios":"An Insights query that keeps returning a running/scheduled status longer than the runner's hard-coded TIMEOUT while Redash polls every POLL_INTERVAL seconds.","commonSituations":"Very broad time ranges or unfiltered scans over huge log groups, AWS throttling slowing progress, or transient AWS slowness.","solutions":["Narrow the query time range and add filter clauses to reduce scanned data","Split the query by log group or time window","Retry when CloudWatch Logs is degraded (check the AWS health dashboard)","If consistently slow, raise TIMEOUT/POLL_INTERVAL in your own fork"],"exampleFix":"# before\nfields @timestamp | filter @message like /Exception/\n\n# after\nfields @timestamp | filter @message like /Exception/ | filter @timestamp > now() - 3600s","handlingStrategy":"retry","validationCode":"# bound the work: require a time filter in every scheduled query\nassert '@timestamp >' in query or 'filter @timestamp' in query","typeGuard":null,"tryCatchPattern":"for attempt in range(2):\n    try:\n        data, err = runner.run_query(q, u); break\n    except Exception as e:\n        if 'exceeded timeout' in str(e) and attempt == 0:\n            q = add_narrower_time_filter(q); continue\n        raise","preventionTips":["Default dashboards to relative time ranges (e.g. -1h)","Split broad scans across multiple scheduled queries","Monitor Insights query durations to catch growth early"],"tags":["redash","aws","cloudwatch-insights","timeout"],"backgroundTag":"query-timeout","analyzedSha":"ca79fe988d81cdac9675b412f3dfcab107bc1fbc","analyzedAt":"2026-08-28T18:32:34.637Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}