aws-samples / aws-samples/aws-lambda-extensions
Unable to debug with SAM local invoke in Node.js example
- Lenguaje dominante
- Go
- Estrellas
- 487
- Forks
- 144
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Hi all,
in `nodejs-example-extension` example for Node.js platform something during registration phase brakes the debugger when runs locally on VS Code using `sam local invoke --port 6767 ...` on a Lambda that includes this layer.
The following is a snap of the debug logs when launched from VS Code:
```
START RequestId: 05da599b-f76d-494e-905b-bead9860f186 Version: $LATEST
nodejs-example-extension launching extension
Debugger listening on ws://0.0.0.0:6767/95282789-af6d-4c40-b544-b1d70e0650c2
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
hello from extension
register
extensionId 0e16eae5-5e84-4b22-a204-c54424793f69
next
Starting inspector on 0.0.0.0:6767 failed: address already in use
invoke
next
...
```
notice the **Starting inspector on 0.0.0.0:6767 failed: address already in use** error line in logs, after that all set breakpoints are ignored and it's impossible to debug every Lambdas.
this is the VS Code debug task setup:
```
{
"name": "lambda_with_example_layer",
"type": "pwa-node",
"request": "attach",
"address": "localhost",
"port": 6767,
"localRoot": "${workspaceFolder}/lambda_with_example_layer",
"sourceMaps": true,
"remoteRoot": "/var/task",
"protocol": "inspector",
"stopOnEntry": false,
"skipFiles": [
"/**"
]
}
```
Is there any debugger/SAM/Docker configuration that i missed? Or is something else deeper in the layer execution flows that broke debugging in a container with SAM local?
Guía de contribución
Línea de trabajo
Comienza con el ejemplo `nodejs-example-extension` y reproduce la configuración de conexión de VS Code usando `sam local invoke --port 6767`. Lee los registros de la fase de registro alrededor de `register`, `next` y el inicio del inspector, y determina por qué el inspector informa de que el puerto 6767 ya está en uso. Se considera terminado cuando las invocaciones locales se conectan correctamente y se respetan los puntos de interrupción para la Lambda.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- node.js
- Área
- devtools
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 25/100