anything-llm
anything-llm copied to clipboard
[BUG]: Websocket not being upgraded with manual HTTP certificate set
How are you running AnythingLLM?
Docker (remote machine)
What happened?
When I typed @agent to launch it, it showed following and the agent session ended immediately:
Agent @agent invoked.
Swapping over to agent chat. Type /exit to exit agent execution loop early.
Agent session complete.
I am using docker image I pulled today.
Are there known steps to reproduce?
No response
I have just found it might be because of SSL. With same docker image, after I enabled SSL and accessed with https://domain_name, then agent ended immediately. If I disabled SSL and accessed with http://ip_address, then agent worked.
Relevant line where if on https, we assume the backend has SSL as well so we upgrade WS to WSS https://github.com/Mintplex-Labs/anything-llm/blob/9feaad79cc69c826001b36d0e129da403a695d23/frontend/src/utils/chat/agent.js#L18
If using nginx as a proxy https://github.com/Mintplex-Labs/anything-llm/blob/9feaad79cc69c826001b36d0e129da403a695d23/cloud-deployments/aws/cloudformation/aws_https_instructions.md?plain=1#L68-L73
Thanks. I originally used the SSL feature in AnythingLLM and did not use nginx as proxy. After changing to use nginx as proxy, problem solved.
I'm also experiecing the same because I have AnythingLLM using https: to server with these lines in my .env
file
ENABLE_HTTPS='true'
HTTPS_CERT_PATH='path to/server.crt'
HTTPS_KEY_PATH='path to /docker$
I'd rather not remove the https
encryption. Is there a workaround? thanks
When you have the network inspector open, can you tell me what happens to the socket and what URL it tries to reach?
If the frontend is running https it should upgrade the socket to wss
automatically
sure, I'd be happy to share that. When expanding the netwrok information in Chrome, what would you like to me expand here?
also, here's the error from Chrome, it does open wss
Okay, so it looks like it does upgrade the Websocket connection. What do the docker logs say on the backend when the agent is invoked - if anything? Im thinking maybe the websocket does not inherit the SSL cert like the whole express server does.
That is correct. The docker logs do not say anything while all this is happening.
Resolved via https://github.com/Mintplex-Labs/anything-llm/pull/1429