Skip to content

UpdateMaxSeatsUsedForGitlabComSubscriptionsWorker attempts to run on Geo secondary

https://sentry.gitlab.net/gitlab/gitlabcom/issues/660683/

PG::ReadOnlySqlTransaction: ERROR:  cannot execute UPDATE in a read-only transaction

  peek/views/pg.rb:17:in `async_exec'
    super(*args)
  peek/views/pg.rb:17:in `async_exec'
    super(*args)
  active_record/connection_adapters/postgresql/database_statements.rb:98:in `block in execute'
    @connection.async_exec(sql)
  active_record/connection_adapters/abstract_adapter.rb:590:in `block in log'
    connection_id:     object_id) { yield }
  active_support/notifications/instrumenter.rb:21:in `instrument'
    yield payload
...
(56 additional frame(s) were not displayed)

ActiveRecord::StatementInvalid: PG::ReadOnlySqlTransaction: ERROR:  cannot execute UPDATE in a read-only transaction
:           UPDATE gitlab_subscriptions AS s SET max_seats_used = v.max_seats_used
          FROM (VALUES (3297, 19)) AS v(id, max_seats_used)
          WHERE s.id = v.id

PG::ReadOnlySqlTransaction: ERROR:  cannot execute UPDATE in a read-only transaction
:           UPDATE gitlab_subscriptions AS s SET max_seats_used = v.max_seats_used
          FROM (VALUES (3297, 19)) AS v(id, max_seats_used)
          WHERE s.id = v.id