When milliseconds of a DateTime are above 999500 python string formatting rounds up the value. This leads to an ISO 8601 date format strings with a value of 60 for the [ss] (second ) part. Solr considers such date format strings invalid and throws an error, e.g.:
Invalid Date in Date Math String:'2015-04-07T14:43:60.000Z'
This will result in the corresponding object not being indexed or updated in solr by ftw.solr.
With this PR we fix the issue by splitting the seconds part of a DateTime into separate seconds and milliseconds parts and also pass them as separate arguments to string formatting.
additionally i've reproduced the timestamp issue locally. i have verified that with this fix the solr error no longer pops up and bin/instance solr sync is successful and manages to update all objects in solr.
When milliseconds of a
DateTime
are above 999500 python string formatting rounds up the value. This leads to an ISO 8601 date format strings with a value of 60 for the [ss] (second ) part. Solr considers such date format strings invalid and throws an error, e.g.:This will result in the corresponding object not being indexed or updated in solr by
ftw.solr
.With this PR we fix the issue by splitting the
seconds
part of aDateTime
into separate seconds and milliseconds parts and also pass them as separate arguments to string formatting.additionally i've reproduced the timestamp issue locally. i have verified that with this fix the solr error no longer pops up and
bin/instance solr sync
is successful and manages to update all objects in solr.Fixes #157.