botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
78 stars 87 forks source link

No answers found for language or default language en #1636

Open alhazmy13 opened 2 years ago

alhazmy13 commented 2 years ago

Describe the bug if you have a bot with a default language in Arabic and trying to add Q&A in Arabic, the bot keeps raising an error "No answers found for language or default language en".

To Reproduce Try to create a new Bot and then change the default language to Arabic; for example, try to add a new Q&A with an Arabic context and then train the bot. When you try to ask the bot any question, even with an exact question that you put on Q&A, the bot is stuck, and an error is raised on Log.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context

Error:


2022-04-18 13:45:35warnIncoming queue failed to process job: No answers found for language  or default language en [Error, No answers found for language  or default language en]
STACK TRACE
Error: No answers found for language  or default language en
    at QnaService._getQnaEntryPayloads (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at QnaService._buildSuggestions (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at QnaService._processEvent (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at async handler (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
2022-04-18 13:45:35warnIncoming queue failed to process job: No answers found for language  or default language en [Error, No answers found for language  or default language en]
STACK TRACE
Error: No answers found for language  or default language en
    at QnaService._getQnaEntryPayloads (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at QnaService._buildSuggestions (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at QnaService._processEvent (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
    at async handler (/snapshot/botpress/packages/bp/dist/core/qna/qna-service.js)
2022-04-18 13:45:35errorRetrying job within Incoming queue failed 2 times. Abandoning the job.

Bot Config:

{
  "locked": false,
  "disabled": false,
  "private": false,
  "details": {
    "website": "",
    "phoneNumber": "",
    "emailAddress": "",
    "termsConditions": "",
    "privacyPolicy": "",
    "avatarUrl": "",
    "coverPictureUrl": ""
  },
  "$schema": "bp://types/bot.config.schema.json",
  "description": "A bot for testing.",
  "active": true,
  "version": "12.26.13",
  "author": "Botpress, Inc.",
  "license": "AGPL-3.0",
  "imports": {
    "modules": [],
    "incomingMiddleware": [],
    "outgoingMiddleware": [],
    "contentTypes": [
      "builtin_action-button",
      "builtin_audio",
      "builtin_card",
      "builtin_carousel",
      "dropdown",
      "builtin_file",
      "builtin_image",
      "builtin_location",
      "builtin_single-choice",
      "builtin_text",
      "builtin_video"
    ]
  },
  "dialog": {
    "timeoutInterval": "5m"
  },
  "logs": {
    "expiration": "1 week"
  },
  "defaultLanguage": "ar",
  "languages": [
    "ar"
  ],
  "id": "mybot",
  "name": "MyBot",
  "pipeline_status": {
    "current_stage": {
      "id": "prod",
      "promoted_on": "2022-04-18T09:46:50.867Z",
      "promoted_by": "xxxx"
    }
  }
}