HTTP 500 Errors in Service Templates for Slack- & Mattermost Commands
Summary
HTTP 500 Errors in Admin => Service Templates for Slack Commands & Mattermost Commands
Steps to reproduce
Install GitLab CE/EE 8.15.0, Navigate to /admin/application_settings/services
, Open either "Mattermost Command" or "Slack Command", Get HTTP 500.
The Services itself (on a repository) are working fine. It's just the Service Templates which fail.
Expected behavior
It should open some sort of View.
Actual behavior
It produces a HTTP 500
Relevant logs and/or screenshots
Relevant Log-Snippets from /var/log/gitlab/gitlab-rails/production.log
while opening the Service Templates:
Mattermost Command
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/admin/application_settings/services/120/edit" for 185.64.113.216 at 2016-12-23 14:27:56 +0100
Processing by Admin::ServicesController#edit as HTML
Parameters: {"id"=>"120"}
Completed 500 Internal Server Error in 39ms (ActiveRecord: 2.2ms)
ActionView::Template::Error (undefined method `namespace' for nil:NilClass):
2: - unless @service.activated?
3: .row
4: .col-sm-9.col-sm-offset-3
5: = link_to new_namespace_project_mattermost_path(@project.namespace, @project), class: 'btn btn-lg' do
6: = custom_icon('mattermost_logo', size: 15)
7: = 'Add to Mattermost'
app/views/projects/services/mattermost_slash_commands/_installation_info.html.haml:5:in `_app_views_projects_services_mattermost_slash_commands__installation_info_html_haml__4521797031780580201_69822478283960'
app/views/projects/services/mattermost_slash_commands/_help.html.haml:15:in `_app_views_projects_services_mattermost_slash_commands__help_html_haml__14102244147275674_69822478564300'
app/views/shared/_service_settings.html.haml:4:in `_app_views_shared__service_settings_html_haml__1088018183548042161_69822474459660'
app/views/admin/services/_form.html.haml:7:in `block in _app_views_admin_services__form_html_haml___4411731034725820883_69822474816920'
app/views/admin/services/_form.html.haml:6:in `_app_views_admin_services__form_html_haml___4411731034725820883_69822474816920'
app/views/admin/services/edit.html.haml:2:in `_app_views_admin_services_edit_html_haml___1480301766021000685_69822470783240'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
Slack Command:
==> /var/log/gitlab/gitlab-rails/production.log <==
Started GET "/admin/application_settings/services/125/edit" for 185.64.113.216 at 2016-12-23 14:27:45 +0100
Processing by Admin::ServicesController#edit as HTML
Parameters: {"id"=>"125"}
Completed 500 Internal Server Error in 18ms (ActiveRecord: 1.2ms)
ActionView::Template::Error (undefined method `name_with_namespace' for nil:NilClass):
1: - run_actions_text = "Perform common operations on this project: #{@project.name_with_namespace}"
2:
3: .well
4: This service allows GitLab users to perform common operations on this
app/views/projects/services/slack_slash_commands/_help.html.haml:1:in `_app_views_projects_services_slack_slash_commands__help_html_haml___785054051732106376_69822513778540'
app/views/shared/_service_settings.html.haml:4:in `_app_views_shared__service_settings_html_haml__1088018183548042161_69822535816500'
app/views/admin/services/_form.html.haml:7:in `block in _app_views_admin_services__form_html_haml___4411731034725820883_69822536708740'
app/views/admin/services/_form.html.haml:6:in `_app_views_admin_services__form_html_haml___4411731034725820883_69822536708740'
app/views/admin/services/edit.html.haml:2:in `_app_views_admin_services_edit_html_haml___1480301766021000685_69822535010420'
lib/gitlab/middleware/multipart.rb:93:in `call'
lib/gitlab/request_profiler/middleware.rb:15:in `call'
lib/gitlab/middleware/go.rb:16:in `call'
Output of checks
(If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com)
Results of GitLab application Check
Checking GitLab Shell ...
GitLab Shell version >= 4.1.1 ? ... OK (4.1.1)
Repo base directory exists?
default... yes
Repo storage directories are symlinks?
default... no
Repo paths owned by git:git?
default... yes
Repo paths access is drwxrws---?
default... yes
hooks directories in repos are links: ...
1/1 ... ok
1/2 ... ok
5/3 ... ok
1/4 ... ok
1/5 ... ok
1/6 ... ok
4/7 ... ok
4/8 ... ok
4/9 ... ok
2/10 ... ok
2/11 ... ok
2/12 ... ok
2/13 ... ok
2/14 ... repository is empty
2/15 ... ok
2/16 ... ok
2/17 ... ok
2/18 ... ok
2/19 ... ok
2/20 ... ok
2/22 ... ok
3/23 ... ok
3/24 ... ok
3/25 ... ok
3/26 ... ok
3/27 ... ok
3/28 ... ok
3/29 ... ok
3/30 ... ok
3/31 ... ok
3/32 ... ok
7/33 ... ok
7/34 ... ok
7/35 ... ok
7/36 ... ok
6/37 ... ok
6/38 ... ok
1/39 ... ok
6/40 ... ok
1/41 ... ok
5/42 ... ok
2/43 ... ok
9/44 ... ok
9/45 ... ok
10/46 ... ok
5/47 ... ok
10/48 ... ok
11/49 ... ok
11/50 ... ok
11/51 ... ok
10/52 ... ok
11/53 ... ok
11/54 ... ok
11/55 ... ok
11/56 ... ok
11/57 ... ok
1/58 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
Send ping to redis server: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Sidekiq ...
Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Reply by email ...
Reply by email is disabled in config/gitlab.yml
Checking Reply by email ... Finished
Checking LDAP ...
LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab ...
Git configured with autocrlf=input? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory setup correctly? ... skipped (no tmp uploads folder yet)
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
projects have namespace: ...
1/1 ... yes
1/2 ... yes
5/3 ... yes
1/4 ... yes
1/5 ... yes
1/6 ... yes
4/7 ... yes
4/8 ... yes
4/9 ... yes
2/10 ... yes
2/11 ... yes
2/12 ... yes
2/13 ... yes
2/14 ... yes
2/15 ... yes
2/16 ... yes
2/17 ... yes
2/18 ... yes
2/19 ... yes
2/20 ... yes
2/22 ... yes
3/23 ... yes
3/24 ... yes
3/25 ... yes
3/26 ... yes
3/27 ... yes
3/28 ... yes
3/29 ... yes
3/30 ... yes
3/31 ... yes
3/32 ... yes
7/33 ... yes
7/34 ... yes
7/35 ... yes
7/36 ... yes
6/37 ... yes
6/38 ... yes
1/39 ... yes
6/40 ... yes
1/41 ... yes
5/42 ... yes
2/43 ... yes
9/44 ... yes
9/45 ... yes
10/46 ... yes
5/47 ... yes
10/48 ... yes
11/49 ... yes
11/50 ... yes
11/51 ... yes
10/52 ... yes
11/53 ... yes
11/54 ... yes
11/55 ... yes
11/56 ... yes
11/57 ... yes
1/58 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.1.0 ? ... yes (2.3.3)
Your git bin path is "/opt/gitlab/embedded/bin/git"
Git version >= 2.7.3 ? ... yes (2.8.4)
Active users: 2
Checking GitLab ... Finished
Results of GitLab environment info
System information
System: Ubuntu 14.04
Current User: git
Using RVM: no
Ruby Version: 2.3.3p222
Gem Version: 2.6.6
Bundler Version:1.13.6
Rake Version: 10.5.0
Sidekiq Version:4.2.7
GitLab information
Version: 8.15.0
Revision: 54850bf
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://[REDACTED]
HTTP Clone URL: https://[REDACTED]/some-group/some-project.git
SSH Clone URL: git@[REDACTED]:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: google_oauth2
GitLab Shell
Version: 4.1.1
Repository storage paths:
- default: /var/opt/gitlab/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks/
Git: /opt/gitlab/embedded/bin/git
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)