Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/34358 and https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12573.