The symptom and the explanations#
The example is illustrative. A fictional billing-sync service calls a payments provider's API and runs a handful of scheduled jobs. On Friday 20 November 2026 its errors began at 08:00:04 UTC, and on Saturday at 08:00:02. Searching back, the team found the same burst on 27 and 28 October, starting at 07:00 UTC. An engineer in Berlin noticed that a partner export runs at 09:00 Berlin time, which is 08:00 UTC in November, and proposed moving it.
Five clock-driven explanations fit a burst that starts on the hour:
- A scheduled job in cron, a systemd timer, a Kubernetes CronJob or a cloud scheduler fails itself, or loads something the service shares.
- A certificate's
notAfter, a token'sexpor an API key's validity ends at that instant. - A daily quota resets, and work held back until the reset arrives all at once; or a daily quota runs out and the errors end at the reset.
- Writes move to a partition, table, index or log file named for the new day, and it does not exist or is not ready.
- A daylight saving change moves every local-time schedule by an hour against UTC.
Choose the observation where explanations disagree
What each explanation predicts#
| Observation | Scheduled job | Expiry | Quota window | New day's object | DST change |
|---|---|---|---|---|---|
| Errors start on a round time | yes | only if the expiry was set on one | yes, at the reset | yes, at the day boundary | yes |
| Repeats on following days | yes | no, continues until renewed | yes | yes, if creation keeps failing | no |
| Stays round in which zone | the job's zone | none needed | the provider's quota zone | the zone that names the objects | the zone that changed |
| When the errors stop | when the job ends | when the credential is replaced | when the burst drains, or at the next reset | when the object exists | when schedules are fixed |
| Direct reading | the scheduler's list | notAfter or exp | the provider's quota and its reset time | the partition or index list | the zone's rules |
The round onset is what everyone noticed, and every column predicts it. Two rows do most of the separating. Repetition splits an expiry, which happens once and then fails continuously, from everything that repeats. The zone row splits the repeating causes, and it only works across a daylight saving change, when zones that agree for most of the year disagree by an hour.
The lab: read an expiry, then find the clock#
The first part reads a certificate's expiry with openssl. -enddate prints the notAfter date, and -checkend N exits nonzero if the certificate expires within the next N seconds. openssl-x509 The script creates a self-signed certificate valid for one day and checks it against one hour and two days. It needs OpenSSL 1.1.1 or later.
set -eu
openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem \
-days 1 -subj "/CN=ledger.internal.example" 2>/dev/null
openssl x509 -in cert.pem -noout -subject -startdate -enddate
openssl x509 -in cert.pem -noout -checkend 3600 && echo "still valid in 1 hour" || echo "expires within 1 hour"
openssl x509 -in cert.pem -noout -checkend 172800 && echo "still valid in 2 days" || echo "expires within 2 days"
Save it as cert.sh in an empty directory and run sh cert.sh. Predict both -checkend lines first. OpenSSL 3.0.13 printed, on 24 November 2026; your dates will be the day you run it:
subject=CN = ledger.internal.example
notBefore=Nov 24 08:59:16 2026 GMT
notAfter=Nov 25 08:59:16 2026 GMT
Certificate will not expire
still valid in 1 hour
Certificate will expire
expires within 2 days
The notAfter time is the second the certificate was made, plus a day. Certificates expire at whatever instant their issuer set, so a certificate expiry explains a round onset only if its notAfter is that round time.
The second part takes the four onsets from the logs and every schedule that could touch the service, each in its own zone, and reports which schedules fired in the ten minutes before each onset. It uses Python's zoneinfo, which reads the IANA time zone database from the system or the tzdata package. zoneinfo It needs Python 3.9 or later.
from datetime import datetime, timedelta, timezone
from zoneinfo import ZoneInfo
# When the errors started on each day they occurred (UTC, from the logs)
ONSETS = ["2026-10-27T07:00:03", "2026-10-28T07:00:05", "2026-11-20T08:00:04", "2026-11-21T08:00:02"]
# Everything on a clock that could touch the service: (name, minute hour, zone)
SCHEDULES = [
("db-backup", "0 0", "UTC"),
("partner-export", "0 9", "Europe/Berlin"),
("vendor-day-reset", "0 0", "America/Los_Angeles"),
("cache-warm", "*/30 *", "UTC"),
]
def matches(field, value):
if field == "*":
return True
if field.startswith("*/"):
return value % int(field[2:]) == 0
return value in {int(v) for v in field.split(",")}
def fired_within(expr, zone, onset, minutes=10):
minute, hour = expr.split()
for back in range(minutes + 1):
local = (onset - timedelta(minutes=back)).astimezone(ZoneInfo(zone))
if matches(minute, local.minute) and matches(hour, local.hour):
return True
return False
def per_day(expr):
minute, hour = expr.split()
return sum(matches(minute, m) and matches(hour, h) for h in range(24) for m in range(60))
for text in ONSETS:
onset = datetime.fromisoformat(text).replace(tzinfo=timezone.utc)
clocks = " ".join(f"{z.split('/')[-1]} {onset.astimezone(ZoneInfo(z)):%H:%M %Z}"
for z in ("UTC", "Europe/Berlin", "America/Los_Angeles"))
hits = [name for name, expr, zone in SCHEDULES if fired_within(expr, zone, onset)]
print(f"{text}Z {clocks} fired: {', '.join(hits) or 'none'}")
print("runs per day: " + ", ".join(f"{name} {per_day(expr)}" for name, expr, _ in SCHEDULES))
Save it as clocks.py. Before running it, write down which schedules you expect to match all four onsets. The prediction is that the Berlin export matches only the November onsets, because Berlin's clocks went back a week before Los Angeles's did, and that one schedule other than the half-hourly job matches every onset.
python3 clocks.py
Python 3.11 printed:
2026-10-27T07:00:03Z UTC 07:00 UTC Berlin 08:00 CET Los_Angeles 00:00 PDT fired: vendor-day-reset, cache-warm
2026-10-28T07:00:05Z UTC 07:00 UTC Berlin 08:00 CET Los_Angeles 00:00 PDT fired: vendor-day-reset, cache-warm
2026-11-20T08:00:04Z UTC 08:00 UTC Berlin 09:00 CET Los_Angeles 00:00 PST fired: partner-export, vendor-day-reset, cache-warm
2026-11-21T08:00:02Z UTC 08:00 UTC Berlin 09:00 CET Los_Angeles 00:00 PST fired: partner-export, vendor-day-reset, cache-warm
runs per day: db-backup 1, partner-export 1, vendor-day-reset 1, cache-warm 48
In November, the Berlin export and the Los Angeles midnight both sit at 08:00 UTC and cannot be told apart. In the last week of October, Berlin was already on CET while Los Angeles was still on PDT, and the onsets followed Los Angeles: midnight Pacific on every day. The half-hourly cache job also matched every onset, as it would match any onset on the hour or half hour; it runs 48 times a day and the errors started on one of them, so it explains nothing. Moving the Berlin export would not have helped.
The prediction would have failed if the October onsets had matched the export, or if no schedule had matched all four. To try another case, add an onset such as 2026-11-22T00:00:06 and see which schedule claims it.
Read it on a real system#
Count errors per minute around each onset on several days, from the logs or an error counter, and note the first minute of each burst in UTC. CloudWatch Logs Insights groups by bin(1m). stats
filter level = "error" | stats count(*) by bin(1m)
Then list everything on a clock, with its zone. Cronie's daemon runs crontabs on local time, which is why its manual describes special handling for daylight saving changes, and a crontab can set CRON_TZ to use another zone. systemctl list-timers --all shows each timer's next and last run. A systemd calendar expression can end in a zone name. A Kubernetes CronJob without .spec.timeZone runs in the kube-controller-manager's local zone. Cloud Scheduler defaults to UTC and warns that daylight saving time can make jobs run unexpectedly. EventBridge Scheduler's get-schedule returns ScheduleExpressionTimezone. cron(8) · crontab(5) · systemctl · systemd.time · CronJob time zones · Cloud Scheduler time zone · get-schedule
crontab -l; ls /etc/cron.d
systemctl list-timers --all
kubectl get cronjobs -A -o custom-columns=NS:.metadata.namespace,NAME:.metadata.name,SCHEDULE:.spec.schedule,TZ:.spec.timeZone
gcloud scheduler jobs list --location=REGION
aws scheduler list-schedules --profile PROFILE --region REGION --no-cli-pager
aws scheduler get-schedule --profile PROFILE --region REGION --name NAME \
--query '[ScheduleExpression,ScheduleExpressionTimezone]' --no-cli-pager
For an expiry, read notAfter from the certificate the dependency serves, and from any client certificate you present. -servername sets SNI so the server returns the certificate for that name. openssl-s_client A JWT's exp claim is the time on or after which it must not be accepted, as a NumericDate in seconds. RFC 7519 Which certificate in a chain expired is its own question. Which certificate expired?
openssl s_client -connect api.provider.example:443 -servername api.provider.example </dev/null 2>/dev/null \
| openssl x509 -noout -enddate
For a quota, read the provider's documentation for the window. Google Cloud's per-day quotas reset at midnight Pacific Time, and per-minute quotas reset one minute after the first request in a rolling window. Quotas overview A burst of rejected calls just after a reset, with the provider's rate-limit headers on the responses, fits a backlog released at the reset. 429 or 503 from a third-party API
For a day-named object, check that tomorrow's exists. In PostgreSQL, an insert into a partitioned table that matches no partition raises an error, and pg_partition_tree lists the partitions. Partitioning · pg_partition_tree
SELECT relid, isleaf FROM pg_partition_tree('events') ORDER BY relid::text DESC LIMIT 5;
Where the check misleads#
Most schedules sit on round times, and frequent ones match everything. A job that runs every 15 minutes matches any onset on the quarter hour; weigh a match by how many runs did not coincide with errors.
Daylight saving changes come twice a year, so the zone test needs onsets on both sides of one. Without them, every zone that agrees with UTC by a whole hour remains a candidate, and the remaining separation comes from the direct readings: the job's log, the certificate's date, the quota counter.
An onset that is round only in the dashboard can come from aggregation. A one-hour bin puts every error in the hour at the start of the hour; read the first error's own timestamp before you look for a clock.
A clock can be the trigger without being the cause. A cron job that ran without trouble for a year and failed at midnight because a table grew is a capacity problem that a clock made visible.
Questions#
Why do errors start exactly at midnight UTC?
Something on a UTC clock changed state then: a daily job, a new day's partition or log file, a quota or rate window, or a credential whose expiry was set to midnight. Check whether it happens every night, list the scheduled jobs in UTC, and read the notAfter of the certificates involved.
Why did a nightly error move by an hour?
A daylight saving change moved a schedule kept in local time against UTC, or against another zone. The zone in which the onset stays at the same time across the change is the one the schedule follows.
When do Google Cloud daily quotas reset?
At midnight Pacific Time, which is 08:00 UTC in winter and 07:00 UTC in summer. Errors that end or begin at those times in UTC are worth checking against a per-day quota.