Error 500/503 with invalid wiki revisions
Summary
Invalid version_id
parameters on wiki pages trigger exceptions.
What is the current bug behavior?
- 500 if parameter contains whitespace
- 503 if parameter is not a valid SHA in the repository
What is the expected correct behavior?
If the page exists:
- Redirect to the wiki page's history (e.g. https://gitlab.com/gitlab-org/design-management/-/wikis/UI-Lexicon/history) and display an error message.
If the page does not exist:
- Redirect to the new page form (e.g. https://gitlab.com/gitlab-org/design-management/-/wikis/new-page)
Relevant logs and/or screenshots
https://sentry.gitlab.net/gitlab/gitlabcom/issues/1308699/
GRPC::InvalidArgument: 3:WikiFindPage: revision can't contain whitespace
grpc/generic/active_call.rb:31:in `check_status'
fail GRPC::BadStatus.new_status_exception(
grpc/generic/active_call.rb:181:in `attach_status_results_and_complete_call'
recv_status_batch_result.check_status
grpc/generic/active_call.rb:170:in `receive_and_check_status'
attach_status_results_and_complete_call(batch_result)
grpc/generic/active_call.rb:338:in `each_remote_read_then_finish'
receive_and_check_status
unicorn worker[12] -D -E production -c /var/opt/gitlab/gitlab-rails/etc/unicorn.rb /opt/gitlab/embedded/service/gitlab-rails/config.ru:1:in `each'
ArgumentError: 3:WikiFindPage: revision can't contain whitespace
gitlab/git/wraps_gitaly_errors.rb:11:in `rescue in wrapped_gitaly_errors'
raise ArgumentError.new(e)
gitlab/git/wraps_gitaly_errors.rb:6:in `wrapped_gitaly_errors'
def wrapped_gitaly_errors(&block)
gitlab/metrics/instrumentation.rb:161:in `block in wrapped_gitaly_errors'
.measure { super }
gitlab/metrics/method_call.rb:36:in `measure'
retval = yield
gitlab/metrics/instrumentation.rb:161:in `wrapped_gitaly_errors'
.measure { super }
...
(145 additional frame(s) were not displayed)
ArgumentError: 3:WikiFindPage: revision can't contain whitespace
Output of checks
This bug happens on GitLab.com
Edited by Markus Koller