-
Are you certain it's a bug?
Is the issue caused by a plugin?
Are you using the latest version?
Is there an existing issue for this?
Issue descriptionI wrote a python fastAPI code with Mangum handler and user serverless to deploy it on lambda. It deployed perfectly yesterday. Today, I added some unit test and now it's giving me a weird handler error. Service configuration (serverless.yml) contentservice: phone-verify
package:
individually: true
provider:
name: aws
runtime: python3.8
region: ap-south-1
stage: ${opt:stage, "dev"}
plugins:
- serverless-python-requirements
custom:
pythonRequirements:
dockerizePip: true
layer:
name: phone-verify-layer
description: Phone Verify Layer
compatibleRuntimes:
- python3.8
functions:
handler: main.handler
package:
patterns:
- "main.py"
- "!.gitignore"
- "!requirements.txt"
- "!package.json"
- "!package-lock.json"
- "!.serverless/**"
- "!.git/**"
- "!venv/**"
- "!node_modules/**"
- "!.pytest_cache/**"
- "!test/**"
- "!.idea/**"
environment:
STAGE: ${self:provider.stage}
API_KEY: redacted
API_KEY_NAME: redacted
CLIENT_ID: redacted
CLIENT_SECRET: redacted
layers:
- { Ref: PythonRequirementsLambdaLayer }
events:
- http:
method: any
path: /{proxy+} Command name and used flagssls deploy --stage staging Command outputServerless Error ----------------------------------------
Unexpected "handler" function configuration: Expected object received 'main.handler')
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 14.17.1
Framework Version: 2.59.0
Plugin Version: 5.4.4
SDK Version: 4.3.0
Components Version: 3.17.1 Environment informationFramework Core: 2.59.0
Plugin: 5.4.4
SDK: 4.3.0
Components: 3.17.1 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
@merrcury error message is correct. Note that directly under Framework assumed |
Beta Was this translation helpful? Give feedback.
-
HI @medikoo, Serverless: Configuration warning:
Serverless: at 'functions.package': unrecognized property 'patterns'
Serverless: at 'functions.handler': should be object
Serverless: at 'functions.environment': unrecognized property 'STAGE'
Serverless: at 'functions.environment': unrecognized property 'API_KEY'
Serverless: at 'functions.environment': unrecognized property 'API_KEY_NAME'
Serverless: at 'functions.environment': unrecognized property 'CLIENT_ID'
Serverless: at 'functions.environment': unrecognized property 'CLIENT_SECRET'
Serverless: at 'functions.layers': should be object
Serverless: at 'functions.events': should be object I checked patterns as a property of functions.package but still a warning. Environment and handlers also as per docs. I feel I might be missing something silly. Would you throw some light on mistakes? FYI, I am using Apple M1 |
Beta Was this translation helpful? Give feedback.
-
@merrcury you're using unsupported configuration format. What Framework supports is: functions:
functionName:
# function setting What you have is: functions:
# function settings All errors and warnings you see are valid. |
Beta Was this translation helpful? Give feedback.
@merrcury you're using unsupported configuration format.
What Framework supports is:
What you have is:
All errors and warnings you see are valid.