Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,763
    • Issues 44,763
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,331
    • Merge requests 1,331
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #285475
Closed
Open
Issue created Nov 20, 2020 by Catalin Irimie@catContributor

Cannot list container repository registries and images on Geo secondary

Summary

!41846 (merged) seems to have introduced package tracking, but broke the pages for Geo secondaries as the Package::CreateEventService attempts to write even in readonly databases (i.e. Geo)

Steps to reproduce

  1. Set up a Geo primary and secondary
  2. Set up container registry replication for Geo (optional, you can also reproduce just by going to the page, without tags)
  3. Go to a project's Container Registry page, observe the error:

image

What is the current bug behavior?

Container registry repositories and images don't work on Geo secondaries.

What is the expected correct behavior?

Container registry repositories and images should be visible

Relevant logs and/or screenshots

ActiveRecord::StatementInvalid (PG::ReadOnlySqlTransaction: ERROR:  cannot execute INSERT in a read-only transaction
):

app/services/packages/create_event_service.rb:8:in `execute'
lib/gitlab/metrics/instrumentation.rb:160:in `block in execute'
lib/gitlab/metrics/method_call.rb:27:in `measure'
lib/gitlab/metrics/instrumentation.rb:160:in `execute'
app/helpers/packages_helper.rb:52:in `track_package_event'
app/controllers/projects/registry/repositories_controller.rb:18:in `block (2 levels) in index'
app/controllers/projects/registry/repositories_controller.rb:12:in `index'

Possible fixes

Make the Package::CreateEventService aware of read-only databases.

Premium Customer ran into this in ZD (internal only)

Assignee
Assign to
Time tracking