OpenBMB / XAgent

An Autonomous LLM Agent for Complex Task Solving
https://blog.x-agent.net/blog/xagent/
Apache License 2.0
7.82k stars 795 forks source link

A port forwarding problem occurs when the front and back end interact. WebSocket connection failed. #334

Closed XChen-Zero closed 6 months ago

XChen-Zero commented 6 months ago

Issue Description / 问题描述

When deployed on a remote server, a port forwarding problem was encountered.Using ssh -L solves this problem, but how do I fix it by modifying the configuration of the project?

Steps to Reproduce / 复现步骤

I directly pulled the image on docker hub and deployed it on the remote server. 5173 had no problem accessing it.

<!doctype html><html lang="en"><head><meta charset="UTF-8"/><link rel="icon" type="image/svg+xml" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="keyword" content="X-Agent,XAgent,Xagent。ModelForce,CPM大模型,Big Models for Everyone,OpenBMB,cpmlive,CPM-Live,cpmbee,CPM-Bee,人工智能,清华大学NLP实验室,大模型,nlp,自然语言,推理,训练"><meta name="description" content="XAgent - powered by THUNLP, large models for everyone"><title>XAgent</title><script src="/third/notebook-js/vendor/es5-shim.min.js"></script><script src="/third/notebook-js/vendor/marked.min.js"></script><script src="/third/notebook-js/vendor/purify.min.js"></script><script src="/third/notebook-js/vendor/ansi_up.min.js"></script><script src="/third/notebook-js/vendor/prism.min.js"></script><script src="/third/notebook-js/vendor/katex.min.js"></script><script src="/third/notebook-js/vendor/katex-auto-render.min.js"></script><script src="/third/notebook-js/vendor/notebook.min.js"></script><link rel="stylesheet" href="/third/notebook-js/styles/vendor/katex.min.css"/><link rel="stylesheet" href="/third/notebook-js/styles/vendor/prism.css"/><link rel="stylesheet" href="/third/notebook-js/styles/notebook.css"/><script type="module" crossorigin src="/assets/index-77f83ba5.js"></script><link rel="stylesheet" href="/assets/index-78a28ac9.css"><body><div id="app"></div><script src="/third/mathjax/tex-mml-chtml.js"></script></body></head></html>

However, the port forwarding problem occurs when the front and back end interact. WebSocket connection to 'ws://localhost:8090/ws/base/31e4a100176c4d4491323d58a07026b9?user_id=guest&token=xagent&description=%E8%AF%A6%E7%BB%86%E4%BB%8B%E7%BB%8D%E4%B8%80%E4%B8%8B%E5%8E%9F%E5%AD%90' failed: (anonymous) @ index-77f83ba5.js:30 W @ index-77f83ba5.js:30 (anonymous) @ index-77f83ba5.js:30 (anonymous) @ index-77f83ba5.js:30

Expected Behavior / 预期行为

Describe the behavior you expected to see. / 请描述您期望的正确行为。

Environment / 环境信息

Error Screenshots or Logs / 错误截图或日志

If possible, please provide relevant screenshots or logs of the error. / 如果可能,请提供相关的错误截图或日志文件。

Additional Notes / 其他备注

If you have any additional information or notes, please add them here. / 如果有其他补充信息,请在此处添加。

Umpire2018 commented 6 months ago
  1. Does all the containers are running?
  2. Please share the screenshot to help us locate the problem. Sharing control portal output mayt not help us.
  3. I also using XAgent in a remote server, everything works fine in my environment.
ChengFai commented 6 months ago

Hi!Well this problem seems to be about network connection. We tried every effort to replicate it but failed. Could you please check your network security policy or port / host config or something?

Umpire2018 commented 6 months ago

@XChen-Zero Please refer to here.

itq5 commented 6 months ago

这个问题我也出现了 image

ChengFai commented 6 months ago

试试看 #277 的解决办法