Cron monitor shows "invalid duration" error when no duration is sent in check-in
- Dominant language
- Python
- Stars
- 44.8k
- Forks
- 4.9k
- Avg merge
- 21h 10m
- Merged PRs (30d)
- 635
Description
### Environment
SaaS (https://sentry.io/)
### Steps to Reproduce
1. Create a cron monitor with a schedule (e.g., every 10 minutes)
2. Send heartbeat check-ins using the simple URL format:
GET https://{ORG}.ingest.us.sentry.io/api/{PROJECT_ID}/cron/{MONITOR_SLUG}/{DSN_KEY}/?status=ok
3. Do NOT include any duration parameter in the request
4. Observe the monitor details page after some time
See Linear thread for Zendesk ticket.
### Expected Result
Check-ins should be recorded successfully without duration (since none was sent). No ingestion errors should appear.
### Actual Result
The monitor shows an ingestion error:
"Errors were encountered while ingesting check-ins for this monitor"
- "Invalid duration"
- "A check-in was sent with an invalid duration of '6839405000'"
The duration column shows "—" for affected check-ins. User reports this has occurred on two separate monitors and was never seen before.
### Product Area
Crons
### Link
_No response_
### DSN
_No response_
### Version
_No response_
Contributor guide
Research direction
Start at the cron check-in ingestion entry point for the simple URL shown in the reproduction steps, then reproduce a request without a duration and inspect how the recorded duration is derived. Confirm the fix by verifying that the check-in is accepted without an ingestion error and that its duration displays as "—".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100