HTTP 500 Errors for Mattermost Commands
Summary
We try to use the 'Add to Mattermost' function of the 'Mattermost Commands' integration and get 500 Errors.
Steps to reproduce
Install gitlab via omnibus, activate mattermost, and:
- Press the 'Add to Mattermost' button in the 'Mattermost Commands' integration for any project.
Expected behavior
Not really sure, probably no 500 errors though.
Actual behavior
500
Relevant logs and/or screenshots
application.log:
Started GET "/namespace/project/mattermost/new" for xx.xx.xx.xx at 2017-01-24 10:54:46 +0100
Processing by Projects::MattermostsController#new as HTML
Parameters: {"namespace_id"=>"multiverse", "project_id"=>"client"}
Completed 500 Internal Server Error in 101ms (ActiveRecord: 4.6ms)
ActionView::Template::Error (undefined method `[]' for nil:NilClass):
8: = @teams.one? ? 'The team' : 'Select the team'
9: where the slash commands will be used in
10: - selected_id = @teams.one? ? @teams.keys.first : 0
11: - options = mattermost_teams_options(@teams)
12: - options = options_for_select(options, selected_id)
13: = f.select(:team_id, options, {}, { class: 'form-control', disabled: @teams.one?, selected: selected_id })
14: = f.hidden_field(:team_id, value: selected_id) if @teams.one?
app/helpers/mattermost_helper.rb:4:in `block in mattermost_teams_options'
app/helpers/mattermost_helper.rb:3:in `map'
app/helpers/mattermost_helper.rb:3:in `mattermost_teams_options'
app/views/projects/mattermosts/_team_selection.html.haml:11:in `block in _app_views_projects_mattermosts__team_selection_html_haml__3687833298212898590_70226048619660'
app/views/projects/mattermosts/_team_selection.html.haml:5:in `_app_views_projects_mattermosts__team_selection_html_haml__3687833298212898590_70226048619660'
app/views/projects/mattermosts/new.html.haml:8:in `_app_views_projects_mattermosts_new_html_haml___223883984647076583_70226045293560'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/rails_queue_duration.rb:20:in `call'
lib/gitlab/metrics/rack_middleware.rb:29:in `block in call'
lib/gitlab/metrics/transaction.rb:49:in `run'
lib/gitlab/metrics/rack_middleware.rb:29:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
Results of GitLab application Check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)
(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)
(we will only investigate if the tests are passing)
Results of GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:env:info
)
(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
)
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)