Skip to content

Remove stack from message is crashing if there is too much error messages coming from CAP validation #398

@dimdusart

Description

@dimdusart

Hello,

We have a CAP application which is doing draft validation of Purchase Orders.

We have to validate a bunch of empty fields the user would have to fill We notified that if one of our object have a lot of childs (ie. Items), and no inputs have been filled, the validation is sending and filling the Message Popover with a lot of errors (sometimes above than 200). We noticed than when it's that the logger is crashing on the line 125 of logging/index.js : log.msg = log.msg.replace(e.stack, e.stack.split('\n')[0])

The CAP app is crashing on BTP and restarting immediately, but that provoke a timeout on SAP Build Workzone upon saving the draft, with the following error (also in our Cloud Logging) :

sap-cloud-sdk-logger
TypeError: Cannot read properties of undefined (reading 'split')     at cds.log.format (/home/vcap/app/node_modules/@cap-js/telemetry/lib/logging/index.js:126:54)     at fmt (/home/vcap/app/node_modules/@sap/cds/lib/log/cds-log.js:94:38)     at logger.warn (/home/vcap/app/node_modules/@sap/cds/lib/log/cds-log.js:101:68)     at http_error (/home/vcap/app/node_modules/@sap/cds/lib/srv/middlewares/errors.js:28:5)     at Immediate.<anonymous> (/home/vcap/app/node_modules/@sap/cds/libx/odata/middleware/batch.js:208:7)     at Immediate.<anonymous> (/home/vcap/app/node_modules/express/lib/router/index.js:646:15)

We don't have errors when trying to save with a few errors left upon validation, and also removing the telemetry from package.json in our project is also removing the issue, so the issue really seems to happen only on the plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions