Skip to content

[Bug]: Listing images in UI fails with DynamoDB and many repositories #2627

@fabianmp

Description

@fabianmp

zot version

v2.1.0

Describe the bug

If there are more than 100 repositories the UI fails to list them on the start/explore page when using DynamoDB as database.
The page stays in loading state. Looking at the request it returns with status 200 but the response contains a DynamoDB error

operation error DynamoDB: BatchGetItem, https response error StatusCode: 400, api error ValidationException: 1 validation error detected: Value '[...]' at 'requestItems.<TABLE_NAME>.member.keys' failed to satisfy constraint: Member must have length less than or equal to 100

The issue seems to appear in https://github.com/project-zot/zot/blob/main/pkg/meta/dynamodb/dynamodb.go#L1975 where BatchGetItems only allows to retrieve up to 100 items.

To reproduce

  1. Configure zot to use DynamoDB as remote cache
  2. Push more than 100 different images
  3. Try to view the explore page in the UI
  4. Page seems to be in loading state, search request returns with error

Expected behavior

List of repositories is diplayed

Screenshots

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrm-externalRoadmap item submitted by non-maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions