BigInt serialization TypeError in MonitorServiceImpl
Los mantenedores suelen responder en 8 días
Ya se ha fusionado un pull request relacionado.
- #703 de @karenc-bq — fusionado
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 70/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- observability
Línea de trabajo
Comienza en common/lib/utils/monitoring/monitor_service.ts, especialmente en MonitorServiceImpl.checkMonitors(), e inspecciona la ruta de cleanup a través de runCleanupLoop(). Revisa las llamadas a JSON.stringify() utilizadas para el registro de Monitor, incluida la línea referenciada y casos similares. Se considera terminado cuando la actividad de monitorización ya no provoca TypeErrors de serialización de BigInt.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
After upgrading to 3.0.0, I've started to see uncaught exceptions from within the library for TypeError: Do not know how to serialize a BigInt. It appears that MonitorServiceImpl::checkMonitors() attempts to serialize Monitor objects for logging with JSON.stringify(), but these include BigInt members that fail. One such place is:
There appear to be several other similar cases throughout monitor_service.ts.
Expected Behavior
No exceptions attempting to serialize BigInt.
What plugins are used? What other connection properties were set?
efm2
Current Behavior
Example stack trace:
TypeError: Do not know how to serialize a BigInt
at JSON.stringify ()
at MonitorServiceImpl.checkMonitors (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:148:81)
at MonitorServiceImpl.runCleanupLoop (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:106:18)
} reason: TypeError: Do not know how to serialize a BigInt
at JSON.stringify ()
at MonitorServiceImpl.checkMonitors (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:148:81)
at MonitorServiceImpl.runCleanupLoop (file:///redacted/node_modules/aws-advanced-nodejs-wrapper/dist/common/lib/utils/monitoring/monitor_service.js:106:18)
Reproduction Steps
I don't have a quick reproducer since the issue seems to depend on the the monitoring state and activity. In my application, this sometimes happen after some period of inactivity or just before/after activity. I believe attempting to JSON.stringify() a BigInt is always an error unless the library were to provide a replacer function to JSON.stringify().
Possible Solution
Provide a replacer function to JSON.stringify() to handle the BigInt fields or perform some alternative serialization of the Monitor objects for logging.
Additional Information/Context
This is my first bug report here. Thanks for the great library.
The AWS Advanced NodeJs Wrapper version used
3.0.0
Node version used
24
Operating System and version
Rocky Linux 8.10
- Lenguaje dominante
- TypeScript
- Estrellas
- 38
- Forks
- 17
- Merge medio
- 7 d 9 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de aws/aws-advanced-nodejs-wrapper
-
Exporting Typescript typesAbiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 65/100
aws/aws-advanced-nodejs-wrapper#527 · 7 comentarios · 1 reacción ·
Los mantenedores suelen responder en 8 días
Todos los issues de aws/aws-advanced-nodejs-wrapper
Issues similares
-
area:cli bug P4
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug from-studio
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
esengine/DeepSeek-Reasonix#14868 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
linxiv-dev/linXiv#384 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
scope:core type:security
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
follow-redirects updateAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
mailgun/mailgun.js#544 ·