webwhiz icon indicating copy to clipboard operation
webwhiz copied to clipboard

Demo Chatbots all return "Oops! Unfortunately, I'm unable to answer right now."

Open willcrobinson opened this issue 1 year ago • 3 comments

Installed using Docker after setting my OpenAI API keys in .env.docker

All starts up fine, can access the dashboard using localhost:3030.

However, when I try to use any chatbot (including the ones in Demo chatbots), I get the response "Oops! Unfortunately, I'm unable to answer right now."

Browser console showing the following:

Unable to create session Error: Request failed with status code 404
    exports createError.js:16
    exports settle.js:17
    g xhr.js:54
ChatBot.tsx:98:12

Network tab shows a 400 error when making a POST request to http://localhost:3030/api/chatbot/answer/?debug=true with the message [ "sessionId should not be empty" ]

It also shows a 404 error when making a POST request to http://localhost:3030/api/chatbot/session/ with the message Invalid Knowledgebase Id

willcrobinson avatar Sep 04 '23 14:09 willcrobinson

Tried to create my own chatbot. Created successfully but when I try to use it, I get an error 500. Console shows the following output. I've highlighted the error line:

webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:23 +0000] "POST /api/chatbot/session/ HTTP/1.1" 200 24 "http://localhost:3030/app/edit-chatbot/64f5e7620b7b1e09450bcc30/?step=chatbot" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
webwhiz-python_worker-1  | [2023-09-04 14:19:23,991: INFO/MainProcess] Task worker.get_top_n_chunks[4c2cead6-06c1-42bf-96b4-56f2c7e5d412] received
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.995+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.6:37200","uuid":{"uuid":{"$uuid":"cb79280d-ac57-4a0b-b23f-911a7c68c57d"}},"connectionId":11,"connectionCount":11}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.996+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn11","msg":"client metadata","attr":{"remote":"172.26.0.6:37200","client":"conn11","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"6.5.0-060500-generic"},"platform":"CPython 3.8.17.final.0"}}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.997+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.6:37206","uuid":{"uuid":{"$uuid":"53a6f8fe-fe02-4878-9d54-e6f43848d123"}},"connectionId":12,"connectionCount":12}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.998+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn12","msg":"client metadata","attr":{"remote":"172.26.0.6:37206","client":"conn12","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"6.5.0-060500-generic"},"platform":"CPython 3.8.17.final.0"}}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.998+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"172.26.0.6:37218","uuid":{"uuid":{"$uuid":"9b7f258e-02dd-4a9d-abd7-ca3627bb0f84"}},"connectionId":13,"connectionCount":13}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.998+00:00"},"s":"I",  "c":"NETWORK",  "id":51800,   "ctx":"conn13","msg":"client metadata","attr":{"remote":"172.26.0.6:37218","client":"conn13","doc":{"driver":{"name":"PyMongo","version":"4.3.3"},"os":{"type":"Linux","name":"Linux","architecture":"x86_64","version":"6.5.0-060500-generic"},"platform":"CPython 3.8.17.final.0"}}}
webwhiz-mongodb-1        | {"t":{"$date":"2023-09-04T14:19:23.998+00:00"},"s":"I",  "c":"NETWORK",  "id":6788700, "ctx":"conn13","msg":"Received first command on ingress connection since session start or auth handshake","attr":{"elapsedMillis":0}}
webwhiz-python_worker-1  | [2023-09-04 14:19:24,011: INFO/ForkPoolWorker-1] Task worker.get_top_n_chunks[4c2cead6-06c1-42bf-96b4-56f2c7e5d412] succeeded in 0.01822942600119859s: '[{"chunkId": {"$oid": "64f5e766a846b7bc00fa60aa"}, "similarity": 0.7400147565115206}]'
webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:24 +0000] "POST /api/chatbot/answer/?debug=true HTTP/1.1" 500 52 "http://localhost:3030/app/edit-chatbot/64f5e7620b7b1e09450bcc30/?step=chatbot" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
**webwhiz-web-1            | [Nest] 1  - 09/04/2023, 2:19:24 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'content')**
webwhiz-web-1            | TypeError: Cannot read properties of undefined (reading 'content')
webwhiz-web-1            |     at getCtxBlock (/dist/knowledgebase/chatbot/openaiChatbotService.js:113:49)
webwhiz-web-1            |     at OpenaiChatbotService.getChatGptPrompt (/dist/knowledgebase/chatbot/openaiChatbotService.js:118:32)
webwhiz-web-1            |     at OpenaiChatbotService.getAiAnswer (/dist/knowledgebase/chatbot/openaiChatbotService.js:168:31)
webwhiz-web-1            |     at ChatbotService.getAnswer (/dist/knowledgebase/chatbot/chatbot.service.js:167:56)
webwhiz-web-1            |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:31 +0000] "GET /static/js/main.e33f7a59.chunk.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:31 +0000] "GET /static/js/2.fe7de7e8.chunk.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:31 +0000] "GET /static/js/main.e33f7a59.chunk.js.map HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
webwhiz-python_worker-1  | [2023-09-04 14:19:34,339: INFO/MainProcess] Task worker.get_top_n_chunks[c0434740-a23f-477b-a6c6-c4563df49eb3] received
webwhiz-python_worker-1  | [2023-09-04 14:19:34,345: INFO/ForkPoolWorker-1] Task worker.get_top_n_chunks[c0434740-a23f-477b-a6c6-c4563df49eb3] succeeded in 0.00395020299765747s: '[{"chunkId": {"$oid": "64f5e766a846b7bc00fa60aa"}, "similarity": 0.753464979419034}]'
webwhiz-frontend-1       | 172.26.0.1 - - [04/Sep/2023:14:19:34 +0000] "POST /api/chatbot/answer/?debug=true HTTP/1.1" 500 52 "http://localhost:3030/app/edit-chatbot/64f5e7620b7b1e09450bcc30/?step=chatbot" "Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0" "-"
webwhiz-web-1            | [Nest] 1  - 09/04/2023, 2:19:34 PM   ERROR [ExceptionsHandler] Cannot read properties of undefined (reading 'content')
webwhiz-web-1            | TypeError: Cannot read properties of undefined (reading 'content')
webwhiz-web-1            |     at getCtxBlock (/dist/knowledgebase/chatbot/openaiChatbotService.js:113:49)
webwhiz-web-1            |     at OpenaiChatbotService.getChatGptPrompt (/dist/knowledgebase/chatbot/openaiChatbotService.js:118:32)
webwhiz-web-1            |     at OpenaiChatbotService.getAiAnswer (/dist/knowledgebase/chatbot/openaiChatbotService.js:168:31)
webwhiz-web-1            |     at ChatbotService.getAnswer (/dist/knowledgebase/chatbot/chatbot.service.js:167:56)
webwhiz-web-1            |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

willcrobinson avatar Sep 04 '23 14:09 willcrobinson

Hi @willcrobinson,

Thank you for reporting this issue.

It is now working because the demo chatbots are on the WebWhiz DB and not available with your setup. I'll remove the demos for self-hosted versions.

Are you facing any issues with creating a new chatbot or using the chatbot you've created?

sachinchoolur avatar Sep 05 '23 15:09 sachinchoolur

Creating a new chatbot seems to work fine. Whenever I try to use the chatbot, I get the errors listed here: https://github.com/webwhiz-ai/webwhiz/issues/70#issuecomment-1705354845

Going to try to set up a fresh copy of Webwhiz on another laptop and see if I have the same issues there.

willcrobinson avatar Sep 05 '23 19:09 willcrobinson