Howdju / howdju

Monorepo for the Howdju crowdsourced fact checking and summarization platform
https://www.howdju.com
GNU Affero General Public License v3.0
5 stars 2 forks source link

Use toJson instead of JSON.stringify #661

Closed carlgieringer closed 5 months ago

carlgieringer commented 5 months ago

After #658, the pre-prod env is getting a 502 from the API. In the logs I am unable to see the underlying error due to a circularity in the value we are trying to serialize.

2024-03-17T21:26:00.722Z    939768f3-f49c-4d68-96dd-a9ab9886cda8    ERROR   Invoke Error    
{
    "errorType": "TypeError",
    "errorMessage": "Converting circular structure to JSON\n    --> starting at object with constructor 'IncomingMessage'\n    |     property 'req' -> object with constructor 'ClientRequest'\n    --- property 'res' closes the circle",
    "stack": [
        "TypeError: Converting circular structure to JSON",
        "    --> starting at object with constructor 'IncomingMessage'",
        "    |     property 'req' -> object with constructor 'ClientRequest'",
        "    --- property 'res' closes the circle",
        "    at JSON.stringify (<anonymous>)",
        "    at AwsLogger3.makeJsonLogArguments [as makeLogArguments] (/howdju-service-common/lib/logging/AwsLogger.js:95:30)",
        "    at AwsLogger3.<anonymous> (/howdju-service-common/lib/logging/AwsLogger.js:106:26)",
        "    at routeRequest (/var/src/router.ts:208:26)"
    ]
}
github-actions[bot] commented 5 months ago

Changed-files coverage summary


=============================== Coverage summary ===============================
Statements   : 59.43% ( 290/488 )
Branches     : 42.41% ( 81/191 )
Functions    : 52.94% ( 63/119 )
Lines        : 60.47% ( 283/468 )
================================================================================