我最近添加了很棒的lambda功能配置的并发。
经过几次成功的部署后,我现在遇到了这个问题
无服务器错误---------------------------------------
ServerlessError:发生错误:GraphqlPrivateProvConcLambdaAlias-配置的并发配置无法应用。原因:FUNCTION_ERROR_INIT_FAILURE。在C:\ Users \ theod \ AppData \ Roaming \ npm \ node_modules \ serverless \ lib \ plugins \ aws \ lib \ monitorStack.js:125:33来自上一个事件:在AwsDeploy.monitorStack(C:\ Users \ theod \ AppData \ Roaming \ npm \ node_modules \ serverless \ lib \ plugins \ aws \ lib \ monitorStack.js:28:12)位于C:\ Users \ theod \ AppData \ Roaming \ npm \ node_modules \ serverless \ lib \ plugins \ aws \ lib \ updateStack.js:107:28来自上一个事件:在AwsDeploy.update
这是我的示例serverless.yml文件
service: backend-api
parameters:
region: ap-southeast-2
path: &path /
provider:
name: aws
runtime: nodejs12.x
stage: ${env:STAGE, 'staging'}
region: ap-southeast-2
versionFunctions: true
plugins:
- serverless-webpack
- serverless-pseudo-parameters
- serverless-prune-plugin
# - serverless-offline-scheduler
- serverless-offline
functions:
# GRAPHQL APIs
graphqlPrivate:
handler: src/graphql/private/index.handler
memorySize: 256
timeout: 30
name: ${self:service}-gqlPrivate-${self:provider.stage}
vpc: ${file(./serverless/vpc.yml)}
events:
- http:
path: /graphql/private
method: ANY
cors: true
authorizer:
arn: arn:aws:cognito-idp:#{AWS::Region}:#{AWS::AccountId}:userpool/${self:custom.cognitoArns.private.${self:provider.stage}}
provisionedConcurrency: 10
package:
individually: true
custom:
webpack:
keepOutputDirectory: true
serializedCompile: true
webpackConfig: 'webpack.config.js'
packager: 'npm'
stage: ${opt:stage, self:provider.stage}
prune:
automatic: true
number: 1
任何人都可以解决这个问题?
Your Environment Information ---------------------------
Operating System: win32
Node Version: 12.11.0
Framework Version: 1.61.3
Plugin Version: 3.2.7
SDK Version: 2.3.0
Components Core Version: 1.1.2
Components CLI Version: 1.4.0
FUNCTION_ERROR_INIT_FAILURE明确表示我要部署的函数的处理程序/代码出了点问题,这就是为什么已配置的lambda无法启动/初始化的原因。
解决此问题的方法是先测试没有预配置的并发选项。一旦能够推送lambda,错误肯定会流入您的CW日志中。但是,最好的方法是在本地测试lambda(使用serverless-offline插件或serverless调用),如果它可以正常工作的话。您还可以打包您的应用程序,并使用无服务器cli调用它以检测打包问题。
在我的情况下,有一个运行时错误,我的代码捆绑包查找的需求不是捆绑包的一部分。
截至目前(2020年1月29日),此信息尚未在AWS Lambda上记录
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句