qnabot-on-aws icon indicating copy to clipboard operation
qnabot-on-aws copied to clipboard

Unable to Sync FAQ to Kendra

Open melpais opened this issue 2 years ago • 2 comments

Describe the bug Unable to sync FAQs to Kendra as the lambda throws up an error.

To Reproduce Deploy latest QnA Bot Create one question Sync to Kendra UI exports fine but failes to create questions in Kendra

Expected behavior A clear and concise description of what you expected to happen. It should sync FAQs to Kendra

Please complete the following information about the solution:

  • [ ] Version: v.5.0.1

  • [ ] Region: [e.g. us-east-1] ap-southeast-1

  • [ ] Was the solution modified from the version published on this repository? No

  • [ ] If the answer to the previous question was yes, are the changes available on GitHub?

  • [ ] Have you checked your service quotas for the sevices this solution uses?

  • [ ] Were there any errors in the CloudWatch Logs? Attached below

Screenshots If applicable, add screenshots to help explain your problem (please DO NOT include sensitive information).

{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module 'qnabot/logging'\nRequire stack:\n- /var/task/createFAQ.js\n- /var/task/kendraSync.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module 'qnabot/logging'",
        "Require stack:",
        "- /var/task/createFAQ.js",
        "- /var/task/kendraSync.js",
        "- /var/runtime/UserFunction.js",
        "- /var/runtime/index.js",
        "    at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
        "    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
        "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
        "    at Module._compile (internal/modules/cjs/loader.js:999:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
        "    at Module.load (internal/modules/cjs/loader.js:863:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
        "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
        "    at internal/main/run_main_module.js:17:47"
    ]
}

Additional context Add any other context about the problem here.

Workaround - Export lambda from previous version v4.x.x and import it to latest stack. it works fine.

melpais avatar Nov 23 '21 02:11 melpais

Hey @melpais Thanks for reporting this bug. We noticed this bug because of a Lambda Layer (QnABotCommonLambdaLayer) that was missing in the new version, hence seeing Cannot find module qnabot/logging. We have made the fix for this and will include it in the next version update.

mohsenari avatar Nov 23 '21 15:11 mohsenari

@mohsenari is there a way to make the changes in our existing version until the next version update is done?

yashpungaliya avatar Dec 10 '21 06:12 yashpungaliya