Crash while visiting .gitlab-ci.yml
Summary
Pointing a fresh browser window to the blob
URL of .gitlab-ci.yml
leads to a 500 error on a private Mercurial project.
Steps to reproduce
Prerequisite: a Mercurial private project with a .gitlab-ci.yml
file.
- authenticate as Owner of the project
- navigate to the
.gitlab-ci.yml
file – it works. Copy the URL - open a new browser window (not even a private one)
- paste the URL
Example Project
Reproduced on this instance with heptapod/testing-projects/test-gitlab-runners>, which was created for other purposes and happens to be private.
What is the current bug behavior?
The standard Error 500 page gets displayed in the browser.
It does not end up in exceptions_json.log
but can be found in production.log
:
ActionView::Template::Error (undefined method `start_with?' for nil:NilClass):
11: #tree-holder.tree-holder
12: = render 'blob', blob: @blob
13:
14: = render partial: 'pipeline_tour_success' if show_suggest_pipeline_creation_celebration?
15: = render 'shared/web_ide_path'
lib/gitlab/mercurial.rb:27:in `parse_gitlab_branch_for_hg'
app/models/ci/pipeline.rb:891:in `hg_append_predefined_commit_variables'
app/models/ci/pipeline.rb:852:in `block (2 levels) in predefined_commit_variables'
app/models/ci/pipeline.rb:835:in `tap'
app/models/ci/pipeline.rb:835:in `block in predefined_commit_variables'
lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'
app/models/ci/pipeline.rb:834:in `predefined_commit_variables'
app/models/ci/pipeline.rb:814:in `block in predefined_variables'
app/models/ci/pipeline.rb:809:in `tap'
app/models/ci/pipeline.rb:809:in `predefined_variables'
lib/gitlab/ci/variables/builder.rb:39:in `block in config_variables'
lib/gitlab/ci/variables/builder.rb:35:in `tap'
lib/gitlab/ci/variables/builder.rb:35:in `config_variables'
lib/gitlab/ci/config.rb:157:in `block in build_variables'
lib/gitlab/ci/pipeline/logger.rb:27:in `instrument'
lib/gitlab/ci/config.rb:154:in `build_variables'
lib/gitlab/ci/config.rb:149:in `build_context'
lib/gitlab/ci/config.rb:31:in `block in initialize'
lib/gitlab/ci/pipeline/logger.rb:27:in `instrument'
lib/gitlab/ci/config.rb:29:in `initialize'
lib/gitlab/ci/yaml_processor.rb:31:in `new'
lib/gitlab/ci/yaml_processor.rb:31:in `parse_config'
lib/gitlab/ci/yaml_processor.rb:20:in `block in execute'
lib/gitlab/ci/yaml_processor/feature_flags.rb:24:in `with_actor'
lib/gitlab/ci/yaml_processor.rb:19:in `execute'
lib/gitlab/ci/lint.rb:80:in `block in yaml_processor_result'
lib/gitlab/ci/pipeline/logger.rb:27:in `instrument'
lib/gitlab/ci/lint.rb:76:in `yaml_processor_result'
lib/gitlab/ci/lint.rb:62:in `static_validation'
lib/gitlab/ci/lint.rb:38:in `validate'
app/models/blob_viewer/gitlab_ci_yml.rb:20:in `validation_message'
app/models/blob_viewer/gitlab_ci_yml.rb:24:in `valid?'
What is the expected correct behavior?
The normal file content page.
Relevant logs and/or screenshots
To be investigated
Edited by Georges Racinet