“圣杯部署”调用以“输入中的未知参数:“层””结尾

时间:2019-07-14 14:09:59

标签: python amazon-web-services deployment aws-lambda chalice

我创建了最基本的圣杯应用程序

from chalice import Chalice

app = Chalice(app_name='testApp')


@app.route('/')
def index():
    return {'hello': 'world'}

具有空的requirements.txt和配置,如下所示:

{
  "version": "2.0",
  "app_name": "testApp",
  "stages": {
    "dev": {
      "api_gateway_stage": "api"
    }
  }
}

第一次部署后立即触发错误

这是我收到的错误:

创建部署程序包。 IAM角色的更新策略:testApp-dev 更新lambda函数:testApp-dev 追溯(最近一次通话):   主文件夹中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ cli__init __。py”     返回cli(obj = {})   在调用中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ core.py”,第722行     返回self.main(* args,** kwargs)   主目录中的第697行“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ core.py”     rv = self.invoke(ctx)   调用中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ core.py”,行1066     返回_process_result(sub_ctx.command.invoke(sub_ctx))   调用中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ core.py”,行895     返回ctx.invoke(self.callback,** ctx.params)   调用中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ core.py”,第535行     返回回调(* args,** kwargs)   文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ click \ decorators.py”,第17行,在new_func中     返回f(get_current_context(),* args,** kwargs)   部署中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ cli__init __。py”     deployd_values = d.deploy(config,chalice_stage_name = stage)   部署中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ deploy \ deployer.py”,第342行     返回self._deploy(config,chalice_stage_name)   _deploy中的第355行“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ deploy \ deployer.py”     self._executor.execute(计划)   执行中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ deploy \ executor.py”,在执行中     self._default_handler)(指令)   _do_apicall中的第43行,文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ deploy \ executor.py”     结果=方法(** final_kwargs)   文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ awsclient.py”,行283,在update_function中     层数=层数   _update_function_config中的第352行的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ awsclient.py”     max_attempts = self.LAMBDA_CREATE_ATTEMPTS   文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ chalice \ awsclient.py”,行1009,位于_call_client_method_with_retries中     响应= method(** kwargs)   _api_call中的文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ botocore \ client.py”,第314行     返回self._make_api_call(operation_name,kwargs)   _make_api_call中的第586行“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ botocore \ client.py”     api_params,operation_model,context = request_context)   文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ botocore \ client.py”,行621,在_convert_to_request_dict中     api_params,operation_model)   文件“ c:\ users \ vic \ appdata \ local \ programs \ python \ python37-32 \ lib \ site-packages \ botocore \ validate.py”,第291行,位于serialize_to_request中     引发ParamValidationError(report = report.generate_report()) botocore.exceptions.ParamValidationError:参数验证失败:

输入:“ Layers”中的未知参数,必须是以下之一:FunctionName,Role,Handler,Description,Timeout,MemorySize,VpcConfig,Environment,Runtime,DeadLetterConfig,KMSKeyArn,TracingConfig,RevisionId

1 个答案:

答案 0 :(得分:0)

故障排除后,发现我的本地配置存在一些问题。在virtualenv(https://virtualenv.pypa.io/en/latest/)中运行圣杯是有帮助的