diff --git a/changelogs/unreleased/30024-owner-can-t-initialize-git-repo-for-new-project-in-group.yml b/changelogs/unreleased/30024-owner-can-t-initialize-git-repo-for-new-project-in-group.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c43d2732b9acfc331cce20b71fc386430999c37d
--- /dev/null
+++ b/changelogs/unreleased/30024-owner-can-t-initialize-git-repo-for-new-project-in-group.yml
@@ -0,0 +1,4 @@
+---
+title: Disable invalid service templates
+merge_request:
+author:
diff --git a/db/migrate/20170330141723_disable_invalid_service_templates2.rb b/db/migrate/20170330141723_disable_invalid_service_templates2.rb
new file mode 100644
index 0000000000000000000000000000000000000000..8424e56d8a1802c36698bd484663cfafb39f7660
--- /dev/null
+++ b/db/migrate/20170330141723_disable_invalid_service_templates2.rb
@@ -0,0 +1,18 @@
+# This is the same as DisableInvalidServiceTemplates. Later migrations may have
+# inadventently enabled some invalid templates again.
+#
+class DisableInvalidServiceTemplates2 < ActiveRecord::Migration
+  DOWNTIME = false
+
+  unless defined?(Service)
+    class Service < ActiveRecord::Base
+      self.inheritance_column = nil
+    end
+  end
+
+  def up
+    Service.where(template: true, active: true).each do |template|
+      template.update(active: false) unless template.valid?
+    end
+  end
+end
diff --git a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
index 8316ee9eb9fb1cfb996a2f797edfc5618c6d1024..0237c3189a5a679bd38ef75dc117babd4c8f391e 100644
--- a/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
+++ b/db/migrate/20170402231018_remove_index_for_users_current_sign_in_at.rb
@@ -1,6 +1,7 @@
 # See http://doc.gitlab.com/ce/development/migration_style_guide.html
 # for more information on how to write migrations for GitLab.
 
+# rubocop:disable RemoveIndex
 class RemoveIndexForUsersCurrentSignInAt < ActiveRecord::Migration
   include Gitlab::Database::MigrationHelpers