안녕하세요.
람다 사용중 최근에 코드를 수정하여 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