Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab
GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 34,939
    • Issues 34,939
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 1,272
    • Merge Requests 1,272
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GitLab.org
  • GitLabGitLab
  • Issues
  • #285475

Closed
Open
Opened Nov 20, 2020 by Catalin Irimie@catDeveloper

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
13.7
Milestone
13.7 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: gitlab-org/gitlab#285475