myENA / radosgwadmin

Ceph Rados Gateway Admin API Go Language Bindings
Mozilla Public License 2.0
6 stars 2 forks source link

BucketStats: parsing time fails: cannot parse "0.000000" as "2006" #9

Open jgraichen opened 9 months ago

jgraichen commented 9 months ago

When trying to load bucket stats, all I get is a time parsing error, for all buckets:

parsing time "0.000000" as "2006-01-02 15:04:05.000000": cannot parse "0.000000" as "2006"

Example:

        stats, err := aa.BucketStats(context.Background(), "", "")

My ceph version is Quincy (17).

imunhatep commented 1 month ago

Updating DateTime formats solves the issue. Ceph 18.x

// RadosTimeFormat - this is the most common rados time format
const RadosTimeFormat string = "2006-01-02T15:04:05.000000Z07:00"

// RadosBucketTimeFormat - used for bucket calls
const RadosBucketTimeFormat string = "2006-01-02T15:04:05.000000"

Error before changing format:

error="parsing time \"2024-07-24T12:10:49.619137Z\" as \"2006-01-02 15:04:05.000000\": cannot parse \"T12:10:49.619137Z\" as \" \""