람다 코드 수정 반영시 에러 문제.

0

안녕하세요.

람다 사용중 최근에 코드를 수정하여 deploy 하면 아래와 같은 에러가 발생합니다. 레이어(Pandas, Numpy 등)를 포함하고 있는 함수입니다.

boro3 가 버전업이 되면서 발생하는 문제인것 같습니다. 이전에는 문제가 없었습니다.

어떻게 해결할수 있을까요?

Response { "errorMessage": "Unable to import module 'lambda_function': cannot import name 'DEPRECATED_SERVICE_NAMES' from 'botocore.docs' (/opt/python/lib/python3.8/site-packages/botocore/docs/init.py)", "errorType": "Runtime.ImportModuleError", "stackTrace": [] }

Function Logs START RequestId: 1c801880-6e1d-4794-a1a3-350ee99ad4fd Version: $LATEST 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] Runtime.ImportModuleError: Unable to import module 'lambda_function': cannot import name 'DEPRECATED_SERVICE_NAMES' from 'botocore.docs' (/opt/python/lib/python3.8/site-packages/botocore/docs/init.py) Traceback (most recent call last):END RequestId: 1c801880-6e1d-4794-a1a3-350ee99ad4fd REPORT RequestId: 1c801880-6e1d-4794-a1a3-350ee99ad4fd Duration: 1.50 ms Billed Duration: 2 ms Memory Size: 128 MB Max Memory Used: 56 MB

Request ID 1c801880-6e1d-4794-a1a3-350ee99ad4fd

Jinsoo
질문됨 20일 전353회 조회
1개 답변
0

github 를 찾아보니, 이 오류는 boto3와 botocore 버전 간의 불일치로 인해 발생했을 가능성이 높다고 생각합니다.
https://github.com/boto/boto3/issues/4058#issuecomment-2013844631

아래의 방법으로 해결되는지 한번 시도해보는것도 좋을것 같습니다.
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-create-dependencies
https://docs.aws.amazon.com/lambda/latest/dg/python-package.html#python-package-dependencies-layers

AWS
전문가
hyp
답변함 20일 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인