Reports fail to send on first attempt, succeed on subsequent attempts
validation:requiredalert-reports
### Bug description
When a new Report is created that references a dashboard not previously included in any scheduled report, the first time the schedule runs, the report fails with a 404 error (and eventual timeout):
```
superset_app | 172.18.0.5 - - [01/Jul/2026:10:45:03 +0000] "GET /superset/dashboard/p/ARxNn14J31b/?standalone=3 HTTP/1.1" 404 2 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/149.0.7827.55 Safari/537.36"
[...]
superset_worker | [2026-07-01 10:47:06,856: ERROR/ForkPoolWorker-2] Timed out requesting url http://superset_app:8088/superset/dashboard/p/ARxNn14J31b/?standalone=3
superset_worker | Traceback (most recent call last):
superset_worker | File "/app/superset/utils/webdriver.py", line 281, in get_screenshot
superset_worker | element.wait_for()
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/sync_api/_generated.py", line 20298, in wait_for
superset_worker | self._sync(
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/_impl/_sync_base.py", line 115, in _sync
superset_worker | return task.result()
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/_impl/_locator.py", line 741, in wait_for
superset_worker | await self._frame.wait_for_selector(
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/_impl/_frame.py", line 394, in wait_for_selector
superset_worker | await self._channel.send(
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 69, in send
superset_worker | return await self._connection.wrap_api_call(
superset_worker | File "/app/.venv/lib/python3.10/site-packages/playwright/_impl/_connection.py", line 563, in wrap_api_call
superset_worker | raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
superset_worker | playwright._impl._errors.TimeoutError: Locator.wait_for: Timeout 120000ms exceeded.
superset_worker | Call log:
superset_worker | - waiting for locator(".standalone") to be visible
superset_worker |
superset_worker | [2026-07-01 10:47:07,045: ERROR/ForkPoolWorker-2] Screenshot failed after 126.91s - execution_id: 7ef33984-12e2-47cf-a6e8-93849d43624c
```
The second (or greater) time the report is run, it redirects (302), loads the dashboard and successfully sends an email.
```
superset_app | 1.2.3.4 - - [01/Jul/2026:10:50:03 +0000] "GET /superset/dashboard/p/ARxNn14J31b/?standalone=3 HTTP/1.1" 302 969 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/149.0.7827.55 Safari/537.36"
[...]
superset_worker | [2026-07-01 10:50:18,472: INFO/ForkPoolWorker-1] Screenshot capture took 18.33s - execution_id: 519690e9-759e-4d85-bd38-0b9bc3d1c050
superset_worker | [2026-07-01 10:50:18,473: INFO/ForkPoolWorker-1] building pdf
superset_worker | [2026-07-01 10:50:22,363: INFO/ForkPoolWorker-1] Report sent to email, task_id: 519690e9-759e-4d85-bd38-0b9bc3d1c050, notification content is {'notification_type': 'Report', 'notification_source': <ReportSourceFormat.DASHBOARD: 'dashboard'>, 'notification_format': 'PDF', 'chart_id': None, 'dashboard_id': 14, 'owners': [Report Owner], 'slack_channels': [], 'execution_id': '519690e9-759e-4d85-bd38-0b9bc3d1c050'}
```
If a report is created using a dashboard that has previously been sent as a report, it will successfully send on the first attempt. Basically, the first time (ever) a dashboard is sent as a report, it will fail; on subsequent attempts, it will succeed.
I have consistently seen this behavior with several different reports (with and without tabs, with and without report filters applied, pdf and images, etc.), so it does not appear to be driven by a specific dashboard attribute, at least not one that I've identified.
I think I may have observed the same issue in 5.0.0, but it has been so long since I initially setup the instance that was potentially affected that I cannot recall for certain.
### Screenshots/recordings
N/A
### Superset version
6.1.0
Superset is run in Docker with a custom build, using tag 6.1.0 as the base image; customizations are mainly static assets.
### Python version
I don't know
### Node version
I don't know
### Browser
Chrome
### Additional context
#### Logs
Logs from the same report that failed on the first attempt and succeeded on the second:
- Logs for failed report: [superset_report_fail_logs.txt](https://github.com/user-attachments/files/29549284/superset_report_fail_logs.txt)
- Logs for successful report: [superset_report_success_logs.txt](https://github.com/user-attachments/files/29549288/superset_report_success_logs.txt)
#### Configuration
##### Sessions
```python
SESSION_SERVER_SIDE = True
SESSION_TYPE = 'redis'
SESSION_REDIS = Redis(
host=REDIS_HOST,
port=REDIS_PORT,
db=5,
)
SESSION_USE_SIGNER = True
PERMANENT_SESSION_LIFETIME = timedelta(hours=24)
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
SESSION_COOKIE_SAMESITE = "Lax"
```
##### Feature flags
```python
FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"ALERT_REPORTS_FILTER": True,
"ALERT_REPORT_TABS": True,
"AUTH_ROLES_SYNC_AT_LOGIN": True,
"DASHBOARD_RBAC": True,
"ENABLE_TEMPLATE_PROCESSING": True,
"PLAYWRIGHT_REPORTS_AND_THUMBNAILS": True,
"RLS_IN_SQLLAB": True,
"TAGGING_SYSTEM": True,
}
```
##### Alerts/Reports & webdriver
```python
ALERT_REPORTS_NOTIFICATION_DRY_RUN = False
ALERT_REPORTS_DEFAULT_RETENTION = 30
ALERT_MINIMUM_INTERVAL = int(timedelta(minutes=60).total_seconds())
REPORT_MINIMUM_INTERVAL = int(timedelta(minutes=60).total_seconds())
SCREENSHOT_PLAYWRIGHT_WAIT_EVENT = "domcontentloaded"
SCREENSHOT_PLAYWRIGHT_DEFAULT_TIMEOUT = int(timedelta(seconds=120).total_seconds()*1000)
WEBDRIVER_BASEURL = "http://superset_app:8088/"
WEBDRIVER_BASEURL_USER_FRIENDLY = f"https://{SUPERSET_WEB_SUBDOMAIN}.example.com"
WEBDRIVER_OPTION_ARGS = ["--headless", "--marionette"]
```
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
1 条评论