serverless/cloud

BUG: too many logs on test instance -> TypeError: data.replace is not a function

tomhanoldt opened this issue · 2 comments

When printing too many logs on a test instance (cloud cli version v2.10.20 and before), the run fails consequently with:

TypeError: data.replace is not a function
    at parseLog (/Users/mono/code/hv/giveme5/hotel-app/backend/node_modules/@serverless/cloud/dist/cli.js:15784:25)
    at /Users/mono/code/hv/giveme5/hotel-app/backend/node_modules/@serverless/cloud/dist/cli.js:15818:26
    at Array.forEach (<anonymous>)
    at outputInstanceLogs (/Users/mono/code/hv/giveme5/hotel-app/backend/node_modules/@serverless/cloud/dist/cli.js:15811:27)
    at InstanceMessenger.<anonymous> (/Users/mono/code/hv/giveme5/hotel-app/backend/node_modules/@serverless/cloud/dist/cli.js:78447:46)
    at InstanceMessenger.emit (node:events:402:35)
    at InstanceMessenger.emit (node:domain:475:12)
    at InstanceConnection.<anonymous> (/Users/mono/code/hv/giveme5/hotel-app/backend/node_modules/@serverless/cloud/dist/cli.js:78491:18)
    at InstanceConnection.emit (node:events:390:28)
    at InstanceConnection.emit (node:domain:475:12)

After investigating a little I could trace the problem to src/utils/parseLog.ts#init_parseLog - the method recived a non string value of

{
  reason: 'Consumer seems to have fallen behind as it has not acknowledged receipt of logs',
  droppedRecords: 4,
  droppedBytes: 277830
}

not critical, just to let you jnow

Hi @tomhanoldt, this should be resolved now. Could you please check and let us know?

perfect, works - thank you and the team much 🥇