firebase-admin-node: firebase remote config get template api fails throws "Version update time must be a valid date string"
Issue is reproducible in Firebase cloud function and in the local cloud function simulator(started occurring from 13-nov-2020)
- Firebase SDK version: 9.4.0
- Firebase Product: remote config
- Node.js version: 10.10.0
Firebase node admin api “admin.remoteConfig().getTemplate() or config.getTemplateAtVersion” throws error
{"code":"remote-config/invalid-argument","message":"Version update time must be a valid date string"}
The issue is reproducible for all remote config versions updated today(using firebase ui or rest api). Older remote config versions can be fetched.
config.getTemplateAtVersion(today's version) -> fails
config.getTemplateAtVersion(yesterday or previous version) -> works
Steps to reproduce:
update a remote config api using firebase ui. get the template using the admin api
additional information
The version details of today’s config(which doesn’t work) look like
{
"versionNumber": "7771",
"updateTime": "2020-11-13T08:02:12.468168Z",
.....
}
Version details of old remote config (which work)
{
"versionNumber": "7740",
"updateTime": "2020-11-12T14:53:52.351Z",
...
You can see the time format is different for new and old remote config. I guess that’s the reason why api is failing
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 27 (6 by maintainers)
Commits related to this issue
- fix(validator): handle 6-digit millis iso date string (#1088) — committed to ryanoboril/firebase-admin-node by deleted user 4 years ago
- [chore] Release 9.4.1 (#1091) Contains a fix for #1088 — committed to firebase/firebase-admin-node by lahirumaramba 4 years ago
- [chore] Release 9.4.1 (#1091) Contains a fix for #1088 — committed to BorntraegerMarc/firebase-admin-node by lahirumaramba 4 years ago
Thank you for reporting this issue! We are currently working on a fix and this issue will track the progress. Thank you for your patience!
Thank you everyone for your patience! We have included the fix in
9.4.1. We will continue to investigate the cause with the backend teams and will take measures to prevent any similar breaking changes in the future.Updated - error went away immediately. Much appreciated. 😃
Yes, it’s on the way. We are also following up with the backend team to figure out why the date format changed suddenly (and will continue to do so after the release too).
I noticed that the problem seems to be related to the number of places used for the milliseconds This is the version time that is being returned for me
2020-11-13T18:30:14.543720Z, for a valid ISO it should be just 3 instead of 6 before theZ, so2020-11-13T18:30:14.543ZThe code falling is this one:
The
isISODateStringfails with 6 but works with 3 milliseconds places. No idea how that happened, any suggestions on how to fix this is appreciated.