Lambdas are broken after a new deployment to a serverless application breaking production functionality

0

We deployed a new version of a serverless (python) application yesterday. All the CloudFormation events have it looking like a successful deployment.

The error is that every lambda gets the Handler 'handler' missing on module 'routes/file_name' We have not made any changes to the structure of our code, nor any changes at all from the AWS console. The changes we made are to use a newer version of Google Ads library, and also deployed from a new machine that required an updated version of serverless and node packages (plus whatever changed in their dependencies.)

$node --version
v16.19.1
$serverless --version
Running "serverless" from node_modules
1.30.1

I tried

  • Rolling back one of the lambdas by specifying an older version int he API Gateway function that acts as a pass-through to the lambda.
  • Deploying a previous version of our code, which I believe is exactly what was already being used by the lambda
  • Creating an alias of an old version of the lambda, but couldn't figure out what to do with it.

I also double-checked the CloudWatch logs and verified that things were working correctly before the new deplioyment.

And finally, we deployed another app with a single lamda that gets its input from an SQS queue, with the same (broken) result.

This is causing a production outage of functionality that is important to our customers.

질문됨 일 년 전351회 조회
1개 답변
0

the error "Handler 'handler' missing on module 'routes/file_name'" indicates that AWS Lambda cannot find the specified handler in the given module.

to resolve the "Handler 'handler' missing on module 'routes/file_name'" error, follow these steps:

  1. Check your serverless.yml file to ensure the handler is specified correctly (e.g., routes/yourFile.handler).
  2. Verify the handler functions are correctly exported in their respective files (e.g., routes/file_name.py).
  3. Inspect the generated package in the .serverless directory to ensure the file structure and required files are present.
  4. Try creating a new virtual environment, reinstall your dependencies, and redeploy your serverless application.
  5. Roll back to the previous working versions of the Serverless Framework, Node.js, or other dependencies, and redeploy.

These steps should help you identify and fix the issue causing your Lambda functions to break in production.

profile picture
전문가
답변함 일 년 전

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

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

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

관련 콘텐츠