CodeGenieApp / CodeGenieApp/serverless-express
ALB responds with HTTP code 502
- Vorherrschende Sprache
- JavaScript
- Sterne
- 5.3k
- Forks
- 676
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Rechercherichtung
Beginne damit, die Beispielrouten /200, /404 und /test über AWS ALB und die Lambda-Zielgruppe nachzustellen. Vergleiche die Lambda- und ALB-Logs für die Nicht-2xx-Antworten und ermittle dann, ob die Integration oder die Konfiguration den 502-Fehler verursacht. Die Aufgabe ist erledigt, wenn die Ursache identifiziert und eine umsetzbare Fehlerbehebung oder Anleitung zur Fehlersuche dokumentiert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, express, javascript, node.js
- Bereich
- api, backend, cloud
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100