Skip to content

Merges failing to merge due to null value in `squash` column in merge_request

https://sentry.gitlap.com/gitlab/gitlabcom/issues/43593/

PG::NotNullViolation: ERROR:  null value in column "squash" violates not-null constraint
DETAIL:  Failing row contains (4892963, master, feature/add-gitlab-ci, 4062630, 1582545, 796387, Feature/add gitlab ci, 2017-09-03 20:06:59.221616+00, 2017-09-03 20:08:54.915195+00, null, opened, can_be_merged, 4062630, 1, , null, null, ---
force_remove_source_branch: '1'
, f, null, null, null, null, null, null, null, Feature/add gitlab ci, , 0, null, 2, null, null, 11410159, t, null).

  lib/gitlab/database/load_balancing/connection_proxy.rb:75:in `block in write_using_load_balancer'
    connection.send(name, *args, &block)
  lib/gitlab/database/load_balancing/load_balancer.rb:66:in `block in read_write'
    yield ActiveRecord::Base.retrieve_connection
  lib/gitlab/database/load_balancing/load_balancer.rb:116:in `retry_with_backoff'
    return yield
  lib/gitlab/database/load_balancing/load_balancer.rb:65:in `read_write'
    retry_with_backoff do
  lib/gitlab/database/load_balancing/connection_proxy.rb:69:in `write_using_load_balancer'
    result = @load_balancer.read_write do |connection|
...
(197 additional frame(s) were not displayed)

ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR:  null value in column "squash" violates not-null constraint
DETAIL:  Failing row contains (4892963, master, feature/add-gitlab-ci, 4062630, 1582545, 796387, Feature/add gitlab ci, 2017-09-03 20:06:59.221616+00, 2017-09-03 20:08:54.915195+00, null, opened, can_be_merged, 4062630, 1, , null, null, ---
force_remove_source_branch: '1'
, f, null, null, null, null, null, null, null, Feature/add gitlab ci, , 0, null, 2, null, null, 11410159, t, null).
: UPDATE "merge_requests" SET "squash" = NULL, "updated_at" = '2017-09-03 20:08:54.915195' WHERE "merge_requests"."id" = 4892963

ActiveRecord::StatementInvalid: PG::NotNullViolation: ERROR:  null value in column "squash" violates not-null constraint
DETAIL:  Failing row contains (4892963, master, feature/add-gitlab-ci, 4062630, 1582545, 796387, Feature/add gitlab ci, 2017-09-03 20:06:59.221616+00, 2017-09-03 20:08:54.915195+00, null, opened, can_be_merged, 4062630, 1, , null, null, ---
force_remove_source_branch: '1'
, f, null, null, null, null, null, null, null, Feature/add gitlab ci, , 0, null, 2, null, null, 11410159, t, null).
: UPDATE "merge_requests" SET "squash" = NULL, "updated_at" = '2017-09-03 20:08:54.915195' WHERE "merge_requests"."id" = 4892963