Skip to content

500 Error when viewing a .gitlab-ci.yml include block with an array

Example YAML:

image: python:3.6-alpine

include :
      compiler: gcc
      compiler: g++-5

https://sentry.gitlab.net/gitlab/gitlabcom/issues/583844/

NoMethodError: undefined method `strip' for [:compiler, "g++-5"]:Array
  gitlab/url_sanitizer.rb:18:in `valid?'
    uri = Addressable::URI.parse(url.strip)
  gitlab/ci/config/external/mapper.rb:23:in `build_external_file'
    if ::Gitlab::UrlSanitizer.valid?(location)
  gitlab/ci/config/external/mapper.rb:15:in `block in process'
    locations.map { |location| build_external_file(location) }
  gitlab/ci/config/external/mapper.rb:15:in `map'
    locations.map { |location| build_external_file(location) }
  gitlab/ci/config/external/mapper.rb:15:in `process'
    locations.map { |location| build_external_file(location) }
...
(201 additional frame(s) were not displayed)

ActionView::Template::Error: undefined method `strip' for [:compiler, "g++-5"]:Array

ActionView::Template::Error: undefined method `strip' for [:compiler, "g++-5"]:Array
Edited by Stan Hu