Cloudkibo / KiboPush

0 stars 1 forks source link

Error: {"body":[{"property":"request.body.chatbotId","messages":["is required"]}]}} #10564

Closed saniasiddiqui closed 3 years ago

saniasiddiqui commented 3 years ago

Title Error {"name":"JsonSchemaValidation","message":"express-jsonschema: Invalid data found","validations":{"body":[{"property":"request.body.chatbotId","messages":["is required"]}]}}

Sentry StackTrace and Sentry Link Sentry Issue: KIBOPUSH-2QM

Error: {"name":"JsonSchemaValidation","message":"express-jsonschema: Invalid data found","validations":{"body":[{"property":"request.body.chatbotId","messages":["is required"]}]}}
  File "/root/KiboChat/server/global/sentry.js", line 4, in Object.exports.sendAlert
    const title = message instanceof Error ? message : new Error(JSON.stringify(message))
  File "/root/KiboChat/server/components/logger.js", line 23, in Object.exports.serverLog
    sentry.sendAlert(message, path, data, otherInfo, level)
  File "/root/KiboChat/server/routes.js", line 203, in null.<anonymous>
    logger.serverLog(message, `${TAG}: ${req.path ? req.path : req.originalUrl}`, req.body, {responseData}, 'error')
  File "/root/KiboChat/server/auth/auth.service.js", line 554, in Middleware_Common_Object.<anonymous>
    next()
  File "/root/KiboChat/server/auth/auth.service.js", line 122, in Middleware_Common_Object.sentryContextDefinition
    next()
...
(35 additional frame(s) were not displayed)

Events: 2 events on 27th Nov

Users: 0

Last Seen: 27th Nov

First Seen: 27th Nov

Environment: Prod

Server_Name: KiboChat

IP:

Front End or Backend End issue? Backend

Additional Data image

sentry-io[bot] commented 3 years ago

Sentry issue: KIBOPUSH-2QM

AnishaChhatwani commented 3 years ago

Steps to reproduce:

  1. Change platform to whatsapp
  2. Click on chatbots from sidebar
  3. Open a chabot
  4. Add child in welcome block
  5. Click on this newly created child from sidebar
  6. delete this child
  7. See error on sentry

Identify what broke the code? This was happening because we were not passing the chatbotId to server and chatbotId was required.

Identify the commit and developer who is responsible for that change. (Issue number, pull request) Commit: https://github.com/Cloudkibo/KiboPush/commit/db803ea850d71de6d12360fcf999ca3d9f21bf4c Pull Request: https://github.com/Cloudkibo/KiboPush/pull/9952 Issue number: https://github.com/Cloudkibo/KiboPush/issues/9716

What is the way that we can ensure that this code doesn’t break again? by passing values properly

User for whom it occurred? individual@cloudkibo.com (Arveen's account)

@bjafri5 please test on staging

bjafri5 commented 3 years ago

Tested on staging

AnishaChhatwani commented 3 years ago

@bjafri5 please test on prod

bjafri5 commented 3 years ago

Tested on production