500 Internal Server Error When Refreshing Chatbot embed Webpage
500 Internal Server Error When Refreshing Chatbot embed Webpage
I’m encountering a 500 internal server error when I refresh the webpage that should fetch messages from my chatbot workflow. The error prevents the messages from being loaded correctly.
Workflow Details:
-
Node Configuration:
-
Redis Chat Memory
-
Vector Store (Qdrant)
-
Ollama Model and Ollama Embeddings
-
JavaScript Code (PrepareChunks)
-
Aggregate
-
AnswerEngine
-
SetOutput
-
Chat Trigger
Steps to Reproduce:
- Setup the workflow as described.
- Load the chatbot webpage and interact with the bot.
- Refresh the webpage to fetch messages again.
Expected Behavior:
Messages should be fetched and displayed correctly upon refreshing the webpage.
Actual Behavior:
A 500 internal server error occurs, preventing messages from being fetched.
Troubleshooting Steps Taken:
-
Verified Redis Chat Memory node configuration and Redis instance connectivity.
-
Checked JavaScript code in PrepareChunks for errors and added additional checks:
let out = “”;
for (const i in $input.all()) {
const item = $input.all()[i];
if (item.json.document && item.json.document.pageContent && item.json.score >= 0.12) {
out +=${i} ---\n${item.json.document.pageContent}\n\n
;
}
}return {
‘context’: out
}; -
Reviewed connections and data flow between nodes.
-
Inspected Aggregate node configuration.
-
Monitored server logs for detailed error messages.
-
Simplified the workflow by disabling some nodes to isolate the issue.
- The issue appears to be related to the Chat Memory node or the data flow between nodes.
- API keys and credentials have been verified to be correct.
Request for Assistance:
Any insights or suggestions on how to resolve this issue would be greatly appreciated. Specifically, guidance on identifying the root cause of the 500 internal server error and ensuring the messages are fetched correctly upon refreshing the webpage would be helpful.
Thank you!