aws-solutions / data-transfer-hub

Seamless User Interface for replicating data into AWS.
https://aws-solutions.github.io/data-transfer-hub/en/
Apache License 2.0
136 stars 22 forks source link

ECR Plugin issue when an image with many tags #153

Closed YikaiHu closed 2 months ago

YikaiHu commented 3 months ago

Describe the bug When transferring an image with many tags, this issue may occur.

LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/latest/dg/runtimes-update.html

[ERROR] ParamValidationError: Parameter validation failed:
Unknown parameter in input: "repositoryName", must be one of: registryId, repositoryNames, nextToken, maxResults
Unknown parameter in input: "filter", must be one of: registryId, repositoryNames, nextToken, maxResults
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 28, in lambda_handler
    result = image_helper.generate_repo_tag_map_list()
  File "/var/task/util/ecr_helper.py", line 117, in generate_repo_tag_map_list
    image_tags = self._get_ecr_image_tags(repo_name)
  File "/var/task/util/ecr_helper.py", line 201, in _get_ecr_image_tags
    response = self._ecr.describe_repositories(
  File "/var/runtime/botocore/client.py", line 553, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/var/runtime/botocore/client.py", line 962, in _make_api_call
    request_dict = self._convert_to_request_dict(
  File "/var/runtime/botocore/client.py", line 1036, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
  File "/var/runtime/botocore/validate.py", line 381, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())

Please complete the following information about the solution:

YikaiHu commented 3 months ago

We will patch this issue in next release.

Currently the workaround is manually replacing describe_repositories with describe_images in the _get_ecr_image_tags.