agentscope-ai / agentscope-ai/agentscope-runtime
通过远程桌面vnc地址,浏览器访问浏览器沙箱桌面需要1-2分钟
- Lenguaje dominante
- Python
- Estrellas
- 863
- Forks
- 168
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
通过浏览器访问生成的远程桌面vnc地址,访问的时间需要1-2分钟,这个时间是正常的吗,一般需要多久,这么长的时间是什么原因引起的呢。我看到 sandbox-manager(我的沙箱服务器)的日志如下
INFO: connection open
2026-01-07 10:59:45,243 - agentscope_runtime.sandbox.manager.server.app - ERROR - Error in sandbox agent-browser-2oopuzp9i94vfw96bojzxi4g7: Unexpected ASGI message 'websocket.send', after sending 'websocket.close' or response already completed.
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 332, in websocket_endpoint
await asyncio.gather(forward_to_service(), forward_to_client())
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 323, in forward_to_client
await websocket.send_text(message)
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 166, in send_text
await self.send({"type": "websocket.send", "text": data})
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 86, in send
await self._send(message)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 357, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close' or response already completed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 244, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value]
File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1135, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 107, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 151, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 77, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 716, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 736, in app
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 364, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 145, in app
await wrap_app_handling_exceptions(app, session)(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 142, in app
await func(session)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 509, in app
await dependant.call(**solved_result.values)
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 336, in websocket_endpoint
await websocket.close()
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 181, in close
await self.send({"type": "websocket.close", "code": code, "reason": reason or ""})
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 86, in send
await self._send(message)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 357, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.close', after sending 'websocket.close' or response already completed.
INFO: connection closed
2026-01-07 11:06:03,219 - agentscope_runtime.sandbox.manager.server.app - ERROR - Error in sandbox agent-browser-2oopuzp9i94vfw96bojzxi4g7: Unexpected ASGI message 'websocket.send', after sending 'websocket.close' or response already completed.
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 332, in websocket_endpoint
await asyncio.gather(forward_to_service(), forward_to_client())
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 323, in forward_to_client
await websocket.send_text(message)
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 166, in send_text
await self.send({"type": "websocket.send", "text": data})
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 86, in send
await self._send(message)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 357, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.send', after sending 'websocket.close' or response already completed.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 244, in run_asgi
result = await self.app(self.scope, self.asgi_receive, self.asgi_send) # type: ignore[func-returns-value]
File "/usr/local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
return await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/fastapi/applications.py", line 1135, in __call__
await super().__call__(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/applications.py", line 107, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 151, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 77, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 716, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 736, in app
await route.handle(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/routing.py", line 364, in handle
await self.app(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 145, in app
await wrap_app_handling_exceptions(app, session)(scope, receive, send)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
raise exc
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
await app(scope, receive, sender)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 142, in app
await func(session)
File "/usr/local/lib/python3.10/site-packages/fastapi/routing.py", line 509, in app
await dependant.call(**solved_result.values)
File "/usr/local/lib/python3.10/site-packages/agentscope_runtime/sandbox/manager/server/app.py", line 336, in websocket_endpoint
await websocket.close()
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 181, in close
await self.send({"type": "websocket.close", "code": code, "reason": reason or ""})
File "/usr/local/lib/python3.10/site-packages/starlette/websockets.py", line 86, in send
await self._send(message)
File "/usr/local/lib/python3.10/site-packages/starlette/_exception_handler.py", line 39, in sender
await send(message)
File "/usr/local/lib/python3.10/site-packages/uvicorn/protocols/websockets/websockets_impl.py", line 357, in asgi_send
raise RuntimeError(msg % message_type)
RuntimeError: Unexpected ASGI message 'websocket.close', after sending 'websocket.close' or response already completed.
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vnc_relay.html?password=04604d45eb636efe71ce04f2cc6168c0 HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/rfb.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/int.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/logging.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/display.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:6573 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/strings.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/eventtarget.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/browser.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/element.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/events.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/inflator.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:6573 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/deflator.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/websock.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/keyboard.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/gesturehandler.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/util/cursor.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/des.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/keysym.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:6573 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/xtscancodes.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/encodings.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/copyrect.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/raw.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/rre.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/tightpng.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/base64.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:6573 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/inflate.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/hextile.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/decoders/tight.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/zstream.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/util.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/deflate.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/utils/common.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/adler32.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/crc32.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/inffast.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/inftrees.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:6573 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/keysymdef.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:32269 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/vkeys.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:23181 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/fixedkeys.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:26813 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/core/input/domkeytable.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:57174 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/trees.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:1234 - "GET /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7/vnc/vendor/pako/lib/zlib/messages.js HTTP/1.1" 200 OK
INFO: 10.244.206.192:54649 - "WebSocket /desktop/agent-browser-2oopuzp9i94vfw96bojzxi4g7" [accepted]
2026-01-07 11:07:10,421 - agentscope_runtime.sandbox.manager.server.app - INFO - Connecting to target with URL: ws://192.168.103.154:31447/websockify
而且我发现sandbox-manager访问沙箱容器websockify的时候使用的是外部端口。动态生成的沙箱容器类型都是nodeport,如图所示
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.