ArgumentError: invalid byte sequence in UTF-8
This exception causes HTTP 500 errors and makes SRE pagers go off. The HTTP status code should be something like 400 or 404 instead.
This issue was surfaced while investigating &327. Note that it is very similar to #610 (closed).
https://sentry.gitlab.net/gitlab/gitlabcom/issues/1559593/?referrer=gitlab_plugin
ArgumentError: invalid byte sequence in UTF-8
rack/utils.rb:599:in `split'
parts = path_info.split PATH_SEPS
rack/utils.rb:599:in `clean_path_info'
parts = path_info.split PATH_SEPS
rack/cors.rb:155:in `evaluate_path'
path = Rack::Utils.clean_path_info(Rack::Utils.unescape(path)) if path
rack/cors.rb:67:in `call'
path = evaluate_path(env)
rack/tempfile_reaper.rb:15:in `call'
status, headers, body = @app.call(env)
...
(50 additional frame(s) were not displayed)
ArgumentError: invalid byte sequence in UTF-8
Proposal
In gitlab-org/gitlab!45701 (merged) we started handling invalid strings in request parameters.
But invalid strings could also be passed in authentication headers used by the GitHttpClientController, which we should also reject (gitlab-org/gitlab!46985 (merged)).
Edited by Bob Van Landuyt