You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Function Scheduler failing due to incorrect timestamp format #255
File "/layers/google.python.pip/pip/lib/python3.12/site-packages/firebase_functions/scheduler_fn.py", line 102, in on_schedule_wrapped
schedule_time = _dt.datetime.strptime(
^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.runtime/python/lib/python3.12/_strptime.py", line 653, in _strptime_datetime
tt, fraction, gmtoff_fraction = _strptime(data_string, format)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/layers/google.python.runtime/python/lib/python3.12/_strptime.py", line 432, in _strptime
raise ValueError("time data %r does not match format %r" %
ValueError: time data '2025-10-17T16:50:00.510855-07:00' does not match format '%Y-%m-%dT%H:%M:%S%z'"
This started happening over the weekend with no changes / alterations to our workers. From the internal logic it appears to be sourced at:
So I'm suspecting that the following request.headers.get("X-CloudScheduler-ScheduleTime") has changed? Upgrading the sdk version is likely to be a major endeavour, what's the simplest solution here?
defon_schedule_wrapped(request: _Request) ->_Response:
schedule_time_str=request.headers.get("X-CloudScheduler-ScheduleTime")
ifschedule_time_strisNone:
schedule_time=_dt.utcnow()
else:
try:
# Supports the expected RFC 3339 format and ISO 8601 as wellschedule_time=dateutil_parser.isoparse(schedule_time_str)
exceptValueErrorase:
print(f"Failed to parse RFC 3339 timestamp: {e}")
schedule_time=_dt.utcnow()
Something like the above might be what we would want, since the incoming datetime still satisfies the documented definition, but the current implementation does not.
Activity
BennetVellaExient commentedon Oct 20, 2025
Something like the above might be what we would want, since the incoming datetime still satisfies the documented definition, but the current implementation does not.
Reference:
https://cloud.google.com/scheduler/docs/reference/rpc/google.cloud.scheduler.v1#appenginehttptarget
CorieW commentedon Oct 20, 2025
Hi @BennetVellaExient! Thanks for raising this. It's been received and we will provide updates when available.
BennetVellaExient commentedon Oct 20, 2025
fix-cloudscheduler-scheduletime.patch
Content:
Maybe this is of use.
KoblerS commentedon Nov 4, 2025
any updates on this, since this is crucial for functions to work properly again
BennetVellaExient commentedon Nov 4, 2025
@KoblerS #256 was a proposed solution for this and @CorieW confirmed they're reviewing this today.
KoblerS commentedon Nov 4, 2025
thanks for the quick update! :)
fix: add robust date parsing in schedule_fn (firebase#256)