aws-solutions / serverless-bot-framework

A solution which enables a multilingual conversational platform, facilitating the creation of applications using voice and text
https://aws.amazon.com/answers/machine-learning/serverless-bot-framework/
Other
43 stars 26 forks source link

Failed to load Cognito resources #6

Closed mehran22000 closed 4 years ago

mehran22000 commented 4 years ago

I just followed the instructions given in "https://docs.aws.amazon.com/solutions/latest/serverless-bot-framework/deployment.html". When I try this in a chrome browser, the bot does not seem to respond and always it returns back with '...'. Could it be a Cognito access problem?

Screen Shot 2020-04-01 at 1 35 20 AM
mehran22000 commented 4 years ago

[

Screen Shot 2020-04-01 at 3 00 25 PM

](url)

mehran22000 commented 4 years ago

I think the root of this issue back to the train Model script

CloudWatchLog Groups/aws/lambda/ServerlessBotFramework-TrainModel-17W6T2IDUM078

2020-04-01T22:06:06.441Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO
{ "Records": [ { "eventVersion": "2.1", "eventSource": "aws:s3", "awsRegion": "us-east-1", "eventTime": "2020-04-01T22:05:58.590Z", "eventName": "ObjectCreated:Put", "userIdentity": { "principalId": "AWS:AROAX4I4CAFTFXB7JZE7P:ServerlessBotFramework-CustomResource-Z6ADB4T8UMMS" }, "requestParameters": { "sourceIPAddress": "54.209.248.172" }, "responseElements": { "x-amz-request-id": "26BD7076AE70F4D9", "x-amz-id-2": "OQ1c3k2db4qVQvzJNdVpbt3zc5yaRdzSsw3fVaZw+TC3lLA0Kj9ZQ7b5pKhorosmJpgvOrHoEZl4Bf3VC/7u++tOKB0lNaIvmNIHMGUgkNU=" }, "s3": { "s3SchemaVersion": "1.0", "configurationId": "Call Log Parser", "bucket": { "name": "serverlessbotframework-brain-ihdhqjkn5nac", "ownerIdentity": { "principalId": "A1KWQAOMF9QLKT" }, "arn": "arn:aws:s3:::serverlessbotframework-brain-ihdhqjkn5nac" }, "object": { "key": "knowledge.json", "size": 3448, "eTag": "124d02325b6ce35b4e2267ca8d3468ff", "sequencer": "005E85104C244D9C31" } } } ] }

2020-04-01T22:06:07.156Z 9f56f9e3-d814-4949-9515-96ad0485d38b ERROR (node:7) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 2020-04-01T22:06:07.385Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO staticEntities : {}

2020-04-01T22:06:07.385Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO Enabled Engines: amcClassificationsImpl 2020-04-01T22:06:07.385Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO Enabled Parsers: replaceSynonym,removePontuaction,removeAccent,removeStopWords,fuzzyReplacement 2020-04-01T22:06:07.386Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO Training Intent: 1 --> qual o seu nome 2020-04-01T22:06:07.386Z 9f56f9e3-d814-4949-9515-96ad0485d38b INFO Training Intent: 1 --> quem e voce 2020-04-01T22:06:07.387Z 9f56f9e3-d814-4949-9515-96ad0485d38b ERROR Uncaught Exception
{ "errorType": "TypeError", "errorMessage": "Cannot read property 'without' of undefined", "code": "TypeError", "message": "Cannot read property 'without' of undefined", "time": "2020-04-01T22:06:07.387Z", "stack": [ "TypeError: Cannot read property 'without' of undefined", " at RegexpTokenizer.tokenize (/var/task/node_modules/natural/lib/natural/tokenizers/regexp_tokenizer.js:48:40)", " at /var/task/index.js:316:43", " at Array.forEach ()", " at tfidf (/var/task/index.js:313:43)", " at /var/task/index.js:335:39", " at Array.forEach ()", " at Response. (/var/task/index.js:181:26)", " at Request. (/var/runtime/node_modules/aws-sdk/lib/request.js:364:18)", " at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)", " at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)" ] }

aassadza commented 4 years ago

Hi @mehran22000, thanks for trying out this solution and your question. We are looking into your question and will get back to you on Friday.

aassadza commented 4 years ago

Hi @mehran22000, we have completed the analysis of the issue and a fix has been published. Thanks for raising it and your help in investigating it.

The root cause was a temporary breakage in Underscore (JavaScript library) in its version 1.10.0, which is a dependency in train-model in this solution that got picked up automatically and went undetected.

The temporary breakage in Underscore (JavaScript library) was introduced in its version 1.10.0 on March 30, 2020 and was fixed in its version 1.10.2 on that same day. Here is a link to that issue with more details https://github.com/jashkenas/underscore/issues/2836.

Unfortunately, our solution build picked up the temporary breakage in Underscore dependency and this went undetected until you noticed it. We have addressed the issue by rebuilding the solution today to pick up the fix in Underscore dependency. We are also putting measures in place to avoid picking up broken dependencies and detect such breakages in the future.

Thanks again for deploying the solution and please let us know in case you notice any other issues or have other feedback.

mehran22000 commented 4 years ago

Thank you @aassadza . The new deployment solved my issue. It works now :)