Cannot Delete Gitlab Group if Mattermost Team has been Created

I am running Gitlab Omnibus 10.2 with Mattermost integration. I have allowed Gitlab to create Mattermost teams when I adding new groups in Gitlab. Now, some of those groups are no longer necessary and I would like to permanently remove them, but I can’t. Whenever I attempt to remove a group that has or had a Mattermost team I receive the following error. Is this a bug?

2017-11-27_19:39:30.25308 2017-11-27T19:39:30.252Z 25017 TID-ovyt3r0o8 GroupDestroyWorker JID-a9d22a6a62db9c006b0f440a INFO: start
2017-11-27_19:39:30.48918 2017-11-27T19:39:30.489Z 25017 TID-ovyt3r0o8 GroupDestroyWorker JID-a9d22a6a62db9c006b0f440a INFO: fail: 0.237 sec
2017-11-27_19:39:30.48929 2017-11-27T19:39:30.489Z 25017 TID-ovyt3r0o8 WARN: {“context”:“Job raised exception”,“job”:{“class”:“GroupDestroyWorker”,“args”:[44,2],“retry”:3,“queue”:“group_destroy”,“backtrace”:5,“jid”:“a9d22a6a62db9c006b0f440a”,“created_at”:1511811570.251277,“enqueued_at”:1511811570.2518585,“error_message”:“undefined method delete' for #<Mattermost::Session:0x00007fb6deeb6440>","error_class":"NoMethodError","failed_at":1511811570.4888506,"retry_count":0,"error_backtrace":["/opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:28:in delete’”,"/opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:45:in block in session_delete'","/opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:42:in block in with_session’","/opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:145:in with_lease'","/opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:38:in with_session’"]},“jobstr”:"{“class”:“GroupDestroyWorker”,“args”:[44,2],“retry”:3,“queue”:“group_destroy”,“backtrace”:5,“jid”:“a9d22a6a62db9c006b0f440a”,“created_at”:1511811570.251277,“enqueued_at”:1511811570.2518585}"}
2017-11-27_19:39:30.49070 2017-11-27T19:39:30.490Z 25017 TID-ovyt3r0o8 WARN: NoMethodError: undefined method delete' for #<Mattermost::Session:0x00007fb6deeb6440> 2017-11-27_19:39:30.49075 2017-11-27T19:39:30.490Z 25017 TID-ovyt3r0o8 WARN: /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:28:in delete’
2017-11-27_19:39:30.49076 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:45:in block in session_delete' 2017-11-27_19:39:30.49076 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:42:in block in with_session’
2017-11-27_19:39:30.49076 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:145:in with_lease' 2017-11-27_19:39:30.49076 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/session.rb:38:in with_session’
2017-11-27_19:39:30.49077 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:12:in with_session' 2017-11-27_19:39:30.49077 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/client.rb:44:in session_delete’
2017-11-27_19:39:30.49077 /opt/gitlab/embedded/service/gitlab-rails/lib/mattermost/team.rb:22:in destroy' 2017-11-27_19:39:30.49078 /opt/gitlab/embedded/service/gitlab-rails/app/models/chat_team.rb:8:in remove_mattermost_team’
2017-11-27_19:39:30.49078 /opt/gitlab/embedded/service/gitlab-rails/app/services/groups/destroy_service.rb:24:in execute' 2017-11-27_19:39:30.49078 /opt/gitlab/embedded/service/gitlab-rails/app/workers/group_destroy_worker.rb:15:in perform’
2017-11-27_19:39:30.49079 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:199:in execute_job' 2017-11-27_19:39:30.49079 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:170:in block (2 levels) in process’
2017-11-27_19:39:30.49079 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:128:in block in invoke' 2017-11-27_19:39:30.49079 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/sidekiq_status/server_middleware.rb:5:in call’
2017-11-27_19:39:30.49080 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:130:in block in invoke' 2017-11-27_19:39:30.49080 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/sidekiq_middleware/request_store_middleware.rb:6:in call’
2017-11-27_19:39:30.49080 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:130:in block in invoke' 2017-11-27_19:39:30.49080 /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/sidekiq_middleware/memory_killer.rb:16:in call’
2017-11-27_19:39:30.49080 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:130:in block in invoke' 2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/server/active_record.rb:15:in call’
2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:130:in block in invoke' 2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sentry-raven-2.5.3/lib/raven/integrations/sidekiq.rb:7:in call’
2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:130:in block in invoke' 2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/middleware/chain.rb:133:in invoke’
2017-11-27_19:39:30.49081 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:169:in block in process' 2017-11-27_19:39:30.49082 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:141:in block (6 levels) in dispatch’
2017-11-27_19:39:30.49082 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/job_retry.rb:97:in local' 2017-11-27_19:39:30.49082 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:140:in block (5 levels) in dispatch’
2017-11-27_19:39:30.49082 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq.rb:36:in block in <module:Sidekiq>' 2017-11-27_19:39:30.49082 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:136:in block (4 levels) in dispatch’
2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:215:in stats' 2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:131:in block (3 levels) in dispatch’
2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/job_logger.rb:7:in call' 2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:130:in block (2 levels) in dispatch’
2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/job_retry.rb:72:in global' 2017-11-27_19:39:30.49083 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:129:in block in dispatch’
2017-11-27_19:39:30.49084 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/logging.rb:44:in with_context' 2017-11-27_19:39:30.49084 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/logging.rb:38:in with_job_hash_context’
2017-11-27_19:39:30.49084 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:128:in dispatch' 2017-11-27_19:39:30.49085 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:168:in process’
2017-11-27_19:39:30.49085 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:85:in process_one' 2017-11-27_19:39:30.49085 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/processor.rb:73:in run’
2017-11-27_19:39:30.49085 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/util.rb:16:in watchdog' 2017-11-27_19:39:30.49085 /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/sidekiq-5.0.4/lib/sidekiq/util.rb:25:in block in safe_thread’
2017-11-27_19:39:56.20010 2017-11-27T19:39:56.200Z 25017 TID-ovyqfeow0 GroupDestroyWorker JID-a9d22a6a62db9c006b0f440a INFO: start
2017-11-27_19:39:56.38646 2017-11-27T19:39:56.386Z 25017 TID-ovyqfeow0 GroupDestroyWorker JID-a9d22a6a62db9c006b0f440a INFO: fail: 0.186 sec

I’m having this problem too - in fact upgraded to 10.2 from 9.5.4 to try to fix. I’m running on Kubernetes. I deleted all the teams in my Mattermost installation to no avail (nobody was using it anyway, and the integration is not as dreamy as it was in an earlier GitLab demo - I have to create a slash command for each project, and that’s just tedious).

Looks like it will be fixed in 10.6