500 Internal Server Error after update to 13.12.0

Hi,

I’m using Gitlab CE (Omnibus) on CentOS 7.9 and yesterday I updated from 13.11.3 to 13.12.0 (using gitlab-ce-13.12.0-ce.0.el7.x86_64.rpm) . Now I have issues with one specific project when trying to:

  • create merge requests
  • create issues
  • visit Projects → Settings → Integrations
  • visit Projects → Settings → Operations

In the browser the response is 500 Internal Server Error. In production.log the error is:

Completed 500 Internal Server Error in 85ms (ActiveRecord: 12.7ms | Elasticsearch: 0.0ms | Allocations: 50361)

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'BuildsEmailService'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Integration.inheritance_column to use another column for that information.)

I don’t know if it is something with the 13.12.0 release (bug?) or something broken with my installation. Grateful for any tips that may solve my issue.

Thank’s

Full exception

Started POST "/<redacted>/<redacted>/-/issues" for <redacted> at 2021-05-25 11:52:17 +0200
Processing by Projects::IssuesController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "issue"=>{"title"=>"[FILTERED]", "description"=>"[FILTERED]", "confidential"=>"0", "assignee_ids"=>["0"], "label_ids"=>[""], "due_date"=>"", "issue_type"=>"issue", "lock_version"=>"0"}, "namespace_id"=>"<redacted>", "project_id"=>"<redacted>"}
Completed 500 Internal Server Error in 115ms (ActiveRecord: 39.5ms | Elasticsearch: 0.0ms | Allocations: 43761)

ActiveRecord::SubclassNotFound (The single-table inheritance mechanism failed to locate the subclass: 'BuildsEmailService'. This error is raised because the column 'type' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Integration.inheritance_column to use another column for that information.):

app/models/project.rb:1517:in `block in execute_services'
lib/after_commit_queue.rb:29:in `instance_eval'
lib/after_commit_queue.rb:29:in `run_after_commit_or_now'
app/models/project.rb:1516:in `execute_services'
app/services/issues/base_service.rb:62:in `execute_hooks'
app/services/issuable_base_service.rb:199:in `create'
app/services/issues/create_service.rb:15:in `execute'
app/controllers/projects/issues_controller.rb:137:in `create'
app/controllers/application_controller.rb:490:in `set_current_admin'
lib/gitlab/session.rb:11:in `with_session'
app/controllers/application_controller.rb:481:in `set_session_storage'
lib/gitlab/i18n.rb:99:in `with_locale'
lib/gitlab/i18n.rb:105:in `with_user_locale'
app/controllers/application_controller.rb:475:in `set_locale'
app/controllers/application_controller.rb:468:in `block in set_current_context'
lib/gitlab/application_context.rb:70:in `block in use'
lib/gitlab/application_context.rb:70:in `use'
lib/gitlab/application_context.rb:27:in `with_context'
app/controllers/application_controller.rb:459:in `set_current_context'
lib/gitlab/middleware/speedscope.rb:13:in `call'
lib/gitlab/request_profiler/middleware.rb:17:in `call'
lib/gitlab/jira/middleware.rb:19:in `call'
lib/gitlab/middleware/go.rb:20:in `call'
lib/gitlab/etag_caching/middleware.rb:21:in `call'
lib/gitlab/middleware/multipart.rb:172:in `call'
lib/gitlab/middleware/read_only/controller.rb:50:in `call'
lib/gitlab/middleware/read_only.rb:18:in `call'
lib/gitlab/middleware/same_site_cookies.rb:27:in `call'
lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'
lib/gitlab/middleware/basic_health_check.rb:25:in `call'
lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'
lib/gitlab/middleware/request_context.rb:21:in `call'
config/initializers/fix_local_cache_middleware.rb:11:in `call'
lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'
lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'
lib/gitlab/middleware/release_env.rb:12:in `call'

To solve the issue I had to do the following:

  1. Connect to database: gitlab-rails dbconsole
  2. Select from services table for the affected project and then delete the row with type BuildsEmailService
gitlabhq_production=> select id, type from services where project_id=24;
  id  |         type
------+-----------------------
 1815 | MattermostService
  416 | BuildsEmailService
 2441 | PipelinesEmailService
 3217 | SlackService
(4 rows)

gitlabhq_production=> DELETE FROM services where id = 416;