Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C container-registry
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 203
    • Issues 203
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 13
    • Merge requests 13
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • container-registry
  • Issues
  • #341
Closed
Open
Issue created Apr 09, 2021 by Will Chandler@wchandlerDeveloper

Empty Tag returned by 'v2/<REPO>/tags/list' when S3 returns 'Contents' as well as 'CommonPrefixes' on ListObjects

Typically S3 returns just CommonPrefixes when querying a directory. However, in some cases it may return the _tags directory passed as prefix as Content as well. The S3 backend will return both files and directories, so we strip the full tags directory path and return an empty string to the caller.

This in turn will cause the UI to error out when attempting to view tags because the tag name is empty:

ActionController::UrlGenerationError (No route matches {:action=>"destroy", :controller=>"projects/registry/tags", :id=>"", :namespace_id=>#<Group id:740 @dcube_core>, :project_id=>#<Project id:5296 dcube_core/python_dienst_template>, :repository_id=>#<ContainerRepository id: 1, project_id: 5296, name: "", created_at: "2019-02-27 09:06:06", updated_at: "2019-02-27 09:06:06">} missing required keys: [:id]):

Example output from S3:

{
  "Contents": [
    {
      "Key": "docker/registry/v2/repositories/group/project/production/_manifests/tags/",
      "LastModified": "2021-03-03T09:04:14+00:00",
      "ETag": "\"123abc\"",
      "Size": 0,
      "StorageClass": "STANDARD",
      "Owner": {
        "DisplayName": "abc123",
        "ID": "12345"
      }
    }
  ],
  "CommonPrefixes": [
    {
      "Prefix": "docker/registry/v2/repositories/group/project/production/_manifests/tags/tag1/"
    },
    {
      "Prefix": "docker/registry/v2/repositories/group/project/production/_manifests/tags/tag2/"
    },
    {
      "Prefix": "docker/registry/v2/repositories/group/project/production/_manifests/tags/tag3/"
    }
  ]
}

/cc @hswimelar

Edited Apr 10, 2021 by Will Chandler
Assignee
Assign to
Time tracking