Uncaught errors throwing unhelpful 500s during web-based merge conflict resolution
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
When GitLab fails to save a merge conflict resolution, it can respond with a 500 error that contains no details about the failure, which can be frustrating as a dead-end for someone attempting to resolve an already somewhat frustrating problem (who loves a merge conflict?)
Steps to reproduce
Here's a Kibana dashboard with a breakdown of the various errors that throw 500 responses back to the client.
Some of these may be fixable, but I believe most of them should just gracefully hand the error message back to the client so the problem can be fixed. e.g. the commit message has an invalid format.
Example Project
I've personally had
13:running pre-receive hooks: GitLab: For signed Web commits, the commit must be equal to the author.
happen to me on a merge request from gitlab-community/gitlab
to gitlab-org/gitlab
, but depending on the underlying error it could happen in various projects.
What is the current bug behavior?
A vague error message telling me to try again, even though subsequent attempts will fail in the exact same way:
What is the expected correct behavior?
I should get a helpful message back in the red error notice bar.
Results of GitLab application Check
Possible fixes
- Add more Exception handling to `ConflictsController#resolve_conflicts to pass back error messages from more types of errors.
- For errors that are client-addressable, change the response status to something in 4xx with the instructions for fixing the request. If it's not something we can fix, we shouldn't be treating them as server-side errors.