Exception when triggering Lambda based API from Cloudwatch Events

オープン
#368 コメント 11 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
aws, java, spring-boot
領域
api, backend, cloud

調査の方向性

記録された HttpApiV2ProxyRequest のデシリアライズ失敗から始め、スケジュールされた AWS CloudWatch Events のペイロードと、Java Spring Boot Lambda 統合が想定するリクエスト形式を比較します。スケジュールされた呼び出しで報告された例外が発生しなくなり、意図した API の動作が行われれば完了です。

索引モデルが issue の本文から書いたものです。

説明

To help us debug your issue fill in the basic information below using the options provided

Serverless Java Container version: 1.5.1

Implementations: Spring Boot 2

Framework version: SpringBoot 2.2.6.RELEASE

Frontend service: AWS Cloudwatch Events

Deployment method: Console

Scenario

I'm trying to schedule a trigger for an API which I have written in Java and deployed in Lambda. Another purpose of this to avoid the cold start as I'm not using provisioned concurrency for my Lambda.
I'm not sure what event to pass so that my API gets triggered properly

Expected behavior

I expect the API endpoint to be hit at a specific time and it should do what is implemented

Actual behavior

Since I don't know what even to pass to my trigger so I'm gettings exceptions in my lambda cloudwatch logs

Steps to reproduce

No code sample required, just create any Java-based Spring boot API on lambda and attach a scheduled cloudwatch event to it.
It will give exceptions in the cloudwatch logs.

Full log output

2020-07-22 18:17:04.935 ERROR 1 --- [           main] c.a.s.proxy.AwsProxyExceptionHandler     : Called exception handler for:
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "id" (class com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest), not marked as ignorable (12 known properties: "requestContext", "rawQueryString", "body", "queryStringParameters", "isBase64Encoded", "routeKey", "version", "stageVariables", "rawPath", "cookies", "headers", "pathParameters"])
at [Source: (lambdainternal.util.NativeMemoryAsInputStream); line: 1, column: 22] (through reference chain: com.amazonaws.serverless.proxy.model.HttpApiV2ProxyRequest["id"])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[task/:na]
主要言語
Java
スター
1.6k
フォーク
575
平均マージ
1日 15時間
マージ済み PR(30日)
12

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

aws/serverless-java-container のほかの issue

aws/serverless-java-container の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。