aws / aws/serverless-java-container

Exception when triggering Lambda based API from Cloudwatch Events

Ouverte
#368 11 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
Java
Étoiles
1.6k
Forks
574
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

*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]
```

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Commencez par l’échec de désérialisation de HttpApiV2ProxyRequest enregistré et comparez la payload de l’événement AWS CloudWatch planifié avec la structure de request attendue par l’intégration Java Spring Boot Lambda. C’est terminé lorsqu’une invocation planifiée ne lève plus l’exception signalée et que le comportement prévu de l’API se produit.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
aws, java, spring-boot
Domaine
api, backend, cloud
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
À clarifier
Accessibilité débutants
25/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.