ERROR: json: cannot unmarshal string into Go struct field Statistics.statistics.commit_count of type int64

A customer submitted a support ticket (Internal Link) reporting an error that had been previously seen in another issue.

They are on glab version 1.35.0 with GitLab version 15.4.6 and authentication with GitLab succeeds but any attempt to retrieve information results in the error: "ERROR: json: cannot unmarshal string into Go struct field Statistics.statistics.commit_count of type int64".

An API call to the /api/v4/projects/65158?license=true&statistics=true&with_custom_attributes=true endpoint shows that commit_count, storage_size, and repository_size are all returning strings instead of integers:

"commit_count":"1182.0","storage_size":"158085541.8","repository_size":"2936012.8"

This is the same root cause seen in the earlier issue. This was suggested to be a configuration problem and the issue was closed, however this customer provided their configuration in the ticket and there does not appear to be any misconfiguration that would be causing this issue.

Is there an update that can be made to account for data in the string format, or should there be an issue for the API team instead?

Edited Dec 07, 2023 by Ryan Castro
Assignee Loading
Time tracking Loading