Workhorse returns 200 when Get file archive api call fails
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=471955) </details> <!--IssueSummary end--> <!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "type::bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=type::bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary When the call the [Get file archive api](https://docs.gitlab.com/ee/api/repositories.html#get-file-archive) fails on Gitaly (for example exceeding the 60s timeout for the request), Workhorse responds with a `200` status and the error `"_source.error": "SendArchive: copy 'git archive' output: rpc error: code = Canceled desc = context canceled"`. The status should be an error status such as `5xx`. ### Steps to reproduce N/A ### Example Project N/A ### What is the current *bug* behavior? Workhorse returns as 200 response when the [Get file archive api](https://docs.gitlab.com/ee/api/repositories.html#get-file-archive) fails on Gitaly ### What is the expected *correct* behavior? Workhorse returns a 5xx (or similar) response when the [Get file archive api](https://docs.gitlab.com/ee/api/repositories.html#get-file-archive) fails on Gitaly ### Relevant logs and/or screenshots N/A ### Output of checks N/A This bug happens on GitLab.com #### Results of GitLab environment info N/A ### Possible fixes Fix in the code https://gitlab.com/gitlab-org/gitlab/-/blob/master/workhorse/internal/git/archive.go?ref_type=heads#L118, ``` w.WriteHeader(200) // Don't bother with HTTP 500 from this point on, just return if _, err := io.Copy(w, reader); err != nil { log.WithRequest(r).WithError(&copyError{fmt.Errorf("SendArchive: copy 'git archive' output: %v", err)}).Error() return } ```
issue