python - 用于弹性搜索清理 Python 的 AWS lambda 问题
问题描述
我在我的组织中继承了一段 lambda,它没有处理以下错误,它作为 python Lambda 代码运行,因为每天都作为 cron 作业触发:
aws lambda invoke --function-name es-cleanup-lambda outfile --payload '{"es_endpoint":"search-t-1.es.amazonaws.com"}'
{"errorMessage": "'AWSPreparedRequest' object has no attribute 'hooks'", "errorType": "AttributeError", "stackTrace": [["/var/task/es-cleanup.py", 169, "lambda_handler", "for index in es.get_indices():"], ["/var/task/es-cleanup.py", 154, "get_indices", "return self.send_to_es(\"/_cat/indices\")"], ["/var/task/es-cleanup.py", 125, "send_to_es", "res = session.send(preq)"], ["/var/runtime/botocore/vendored/requests/sessions.py", 634, "send", "hooks = request.hooks"]]
不知道为什么 AWSprepared 方法调用缺少钩子,我们认为我现在需要以某种方式更新 boto Lib。
解决方案
推荐阅读
- c++ - gmock:使用 unique_ptr 时 EXPECT_CALL 崩溃
- protocol-buffers - Protobuf 3 java:如何仅区分和更新输入对象中的那些字段?场景:例如持久化到数据库
- salt-stack - 盐状态不能与支柱数据结合使用
- reporting-services - SSRS Visual Studio 2017 (SSDT) - 日期参数格式
- javascript - 我想在 Click 事件上从 html 按钮调用 javascript 类,该怎么做?
- scala.js - 未在 scalajs 中导出本机 javascript 类
- c# - 如果只有某些对象属性为空,如何以更优雅的方式检查 C#?
- apache-flink - 是否可以将 flink 数据流的输出捕获到列表中
- python - 将全局变量设置回其默认值
- mysql - 错误代码:1241。Workbench,MySQL,无法解析参数