Fix "ERR value is not an integer or out of range" errors Closes #66449 See merge request gitlab-org/gitlab-ce!32126