CodeGenieApp / CodeGenieApp/serverless-express

ALB responds with HTTP code 502

Aperta
#688 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
5.3k
Fork
676
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hey, I am attempting to deploy a small Express app to AWS as a Lambda connected to ALB via target group.

```javascript
const serverless = require('@codegenie/serverless-express')
const express = require('express')

const app = express()

app.get('/200', function(req, res) {
res.json({ message: 'all good' })
})

app.get('/404', function(req, res) {
res.status(404).json({ message: 'not found' })
})

app.post('/test', function(req, res) {
res.sendStatus(400)
})

module.exports.handler = serverless({ app })
```
I am able to successfully make a request to `/200` and see the JSON response but I am not successful with requests that modify the `status`. In those I just see this response from ALB:
```html

502 Bad Gateway


502 Bad Gateway


```

Can I please ask for guidance how would I go about debugging this? I don't see anything useful in my Cloudwatch logs of the Lambda function. Should I enable ALB logs?

Thank you.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start by reproducing the sample /200, /404, and /test routes through the AWS ALB and Lambda target group. Compare the Lambda and ALB logs for the non-2xx responses, then determine whether the integration or configuration is producing the 502. Done means identifying the cause and documenting an actionable fix or debugging guidance.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
aws, express, javascript, node.js
Ambito
api, backend, cloud
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.