502 response while submitting merge request

I'm not able to merge a branch with a relatively big number of changes. After I press "submit new merge request" page hangs for a while with a throbber and I get 502 response. See attachments: gitlab_error_1 gitlab_error_2