Strip gRPC debug_error_string from Gitaly exceptions

The upgrade of gRPC brought along a debug_error_string that makes it harder for Sentry to group similar exceptions together.

This merge request reverts !40938 (merged) because it wasn't actually working when gRPC exceptions were wrapped in Gitlab::Git::CommandError via wrapped_gitaly_errors.

A much simpler approach is to strip debug_error_string when a Gitlab::Git::BaseError is created. With this change, we have effectively the same exception strings as we did before the upgrade of gRPC.

Note that it appears Sentry retains a backtrace of the original gRPC exception that contains the debug_error_string, so if we really want to look at it the information is still there.

This should solve #238465.

Sample Sentry entry from https://sentry.gitlab.net/gitlab/gitlab-geo-internal-develop-is/issues/1803201:

image

If you scroll down, you can see the original gRPC exception:

image

Edited by Stan Hu

Merge request reports

Loading