diff --git a/Html/.log b/Html/.log index dc7ca69..cbfebb2 100644 --- a/Html/.log +++ b/Html/.log @@ -1,1315 +1,397 @@ -2025-09-06 14:16:13.956 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -[33mPress CTRL+C to quit[0m -127.0.0.1 - - [06/Sep/2025 14:16:23] "GET /socket.io/?user_uuid=user_b21f2049-8655-4e6e-89ac-ccbb88b45b51&folder=/home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法&EIO=4&transport=polling&t=PaVOgFv HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:36] "[32mGET / HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:16:36] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "[32mGET / HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /static/css/login.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "GET /static/js/login.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:42] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "GET /register HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "[36mGET /static/css/login.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:16:50] "GET /static/js/register.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:11] "POST /register_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:13] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:13] "[36mGET /static/css/login.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:14] "[36mGET /static/js/login.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "POST /login_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /static/css/dashboard.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:20] "GET /static/js/dashboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:21] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "[36mGET /static/js/dashboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "[35m[1mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 206 - -101.87.252.115 - - [06/Sep/2025 14:20:35] "[35m[1mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 206 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET / HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET /static/css/index.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "GET /static/js/index.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:51] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "GET /course/68bacdfadf5aeae0912f7f18 HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "GET /static/css/course.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:53] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:56] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:20:57] "[36mGET /static/js/dashboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "[32mGET /switch-role/student HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "[32mGET /teacherboard HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:06] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:07] "[36mGET /static/css/login.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:07] "[36mGET /static/js/login.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:14] "POST /login_teacher_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "GET /register_teacher HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "[36mGET /static/css/login.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:17] "GET /static/js/register_teacher.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:36] "POST /register_teacher_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:38] "GET /login HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:38] "[36mGET /static/css/login.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:39] "[36mGET /static/js/login.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:43] "POST /login_post HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:43] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:44] "[36mGET /static/js/dashboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "[32mGET /switch-role/student HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/css/teacherboard.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/css/teacher_course_setting.css HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/js/course_current.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:21:48] "GET /static/js/teacherboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:49] "GET /static/js/teacher_course_setting.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:21:49] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -[2025-09-06 14:21:54,310] ERROR in app: Exception on /materials/algorithm [GET] +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET / HTTP/1.1" 302 351 0.001580 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:21:54] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -[2025-09-06 14:22:07,077] ERROR in app: Exception on /materials/data-structures [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_dd993856-c5a2-46bf-9b31-238a14de6a9f' +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /socket.io/?user_uuid=user_dd993856-c5a2-46bf-9b31-238a14de6a9f&folder=%2Fhome%2FTCake%2F68bacdfadf5aeae0912f7f18%2F%E7%AE%97%E6%B3%95%E6%95%88%E7%8E%87%2F%E6%95%88%E7%8E%87%E7%9A%84%E9%87%8D%E8%A6%81%E6%80%A7%E4%B8%8E%E5%AE%9E%E8%B7%B5%E9%AA%8C%E8%AF%81&EIO=4&transport=websocket&sid=PYEYzcDw6_8AFakHAAAA HTTP/1.1" 200 0 17.090087 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /login HTTP/1.1" 200 1835 0.003839 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /static/js/login.js HTTP/1.1" 304 183 0.007688 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 05:47:23] "GET /static/css/login.css HTTP/1.1" 304 184 0.001261 +(185715) accepted ('127.0.0.1', 43808) +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSHV HTTP/1.1" 200 275 0.000398 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSWg&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 192 0.000805 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSWj&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 196 0.000499 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSaR&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 192 0.000360 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'data-structures' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:07] "[35m[1mGET /materials/data-structures HTTP/1.1[0m" 500 - -[2025-09-06 14:22:08,886] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 43816) +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCSaT&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 157 0.000484 +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:24:01] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbHCScl&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 157 0.000671 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:08] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:12] "[33mGET /teacherdashboard HTTP/1.1[0m" 404 - -[2025-09-06 14:22:17,150] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +49.52.5.54,127.0.0.1 - - [16/Sep/2025 06:44:49] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=B1ccqcz1y9dPlAE1AAAC HTTP/1.1" 200 0 1247.995297 +(185715) accepted ('127.0.0.1', 35642) +117.136.120.147,127.0.0.1 - - [16/Sep/2025 06:49:11] "GET /favicon.ico HTTP/1.1" 404 331 0.004418 +(185715) accepted ('127.0.0.1', 41232) +149.57.180.156,127.0.0.1 - - [16/Sep/2025 07:00:34] "GET / HTTP/1.1" 302 351 0.001683 +149.57.180.156,127.0.0.1 - - [16/Sep/2025 07:00:34] "GET /login HTTP/1.1" 200 1835 0.001421 +(185715) accepted ('127.0.0.1', 34508) +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:23] "GET /favicon.ico HTTP/1.1" 404 331 0.004694 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:23] "GET /favicon.ico HTTP/1.1" 404 331 0.001007 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:24] "GET /favicon.ico HTTP/1.1" 404 331 0.001088 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:55] "GET /favicon.ico HTTP/1.1" 404 331 0.001698 +59.78.194.184,127.0.0.1 - - [16/Sep/2025 09:01:55] "GET /favicon.ico HTTP/1.1" 404 331 0.002036 +(185715) accepted ('127.0.0.1', 53386) +34.150.219.96,127.0.0.1 - - [16/Sep/2025 09:42:11] "GET / HTTP/1.1" 302 351 0.000875 +34.150.219.96,127.0.0.1 - - [16/Sep/2025 09:42:11] "GET /login HTTP/1.1" 200 1835 0.000756 +(185715) accepted ('127.0.0.1', 53620) +34.172.229.236,127.0.0.1 - - [16/Sep/2025 10:14:08] "GET / HTTP/1.1" 302 351 0.000800 +34.172.229.236,127.0.0.1 - - [16/Sep/2025 10:14:09] "GET /login HTTP/1.1" 200 1835 0.000896 +(185715) accepted ('127.0.0.1', 34444) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:08] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7-sC HTTP/1.1" 200 275 0.000352 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_14&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 192 0.000732 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_18&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 196 0.000242 +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_36&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 192 0.000796 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:17] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:22] "[33mGET /teachergrades HTTP/1.1[0m" 404 - -[2025-09-06 14:22:29,722] ERROR in app: Exception on /materials/data-structures [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 34458) +(185715) accepted ('127.0.0.1', 34474) +58.198.188.146,127.0.0.1 - - [16/Sep/2025 10:44:09] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbI7_37&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 157 0.247947 +(185715) accepted ('127.0.0.1', 42806) +59.78.194.184,127.0.0.1 - - [16/Sep/2025 11:47:28] "GET /favicon.ico HTTP/1.1" 404 331 0.001352 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'data-structures' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:22:29] "[35m[1mGET /materials/data-structures HTTP/1.1[0m" 500 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "[32mGET /switch-role/teacher HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "[36mGET /static/js/dashboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:35] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:43] "[32mGET /switch-role/student HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "[36mGET /static/css/teacher_course_setting.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "[36mGET /static/css/teacherboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "[36mGET /static/js/course_current.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:44] "[36mGET /static/js/teacherboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:45] "[36mGET /static/js/teacher_course_setting.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:22:45] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -[2025-09-06 14:23:04,686] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +58.198.188.146,127.0.0.1 - - [16/Sep/2025 11:56:46] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=LR2BfasKvxPRxnsNAAAE HTTP/1.1" 200 0 4356.802767 +(185715) accepted ('127.0.0.1', 55390) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:20] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcTKy HTTP/1.1" 200 275 0.000364 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZ74 HTTP/1.1" 200 275 0.000343 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZAk&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 192 0.000776 +(185715) accepted ('127.0.0.1', 44178) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZAk.0&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 196 0.000196 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZBl&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 192 0.000442 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:04] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -[2025-09-06 14:23:06,148] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 44180) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 12:57:41] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbIcZBl.0&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 157 0.144302 +(185715) accepted ('127.0.0.1', 55902) +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:03] "GET / HTTP/1.1" 302 351 0.001001 +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:03] "GET /login HTTP/1.1" 200 1835 0.000801 +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:04] "GET /static/css/login.css HTTP/1.1" 200 3791 0.002872 +(185715) accepted ('127.0.0.1', 55906) +23.27.145.218,127.0.0.1 - - [16/Sep/2025 13:12:04] "GET /static/js/login.js HTTP/1.1" 200 3557 0.001569 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:05] "GET / HTTP/1.1" 302 351 0.000814 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:24] "GET /login HTTP/1.1" 200 1835 0.000830 +162.142.125.195,127.0.0.1 - - [16/Sep/2025 13:12:28] "GET /favicon.ico HTTP/1.1" 404 331 0.000829 +(185715) accepted ('127.0.0.1', 43834) +34.82.34.164,127.0.0.1 - - [16/Sep/2025 13:22:35] "GET / HTTP/1.1" 302 351 0.001168 +34.82.34.164,127.0.0.1 - - [16/Sep/2025 13:22:35] "GET /login HTTP/1.1" 200 1835 0.001068 +(185715) accepted ('127.0.0.1', 49640) +54.200.206.157,127.0.0.1 - - [16/Sep/2025 14:38:32] "GET / HTTP/1.1" 302 351 0.001285 +(185715) accepted ('127.0.0.1', 53358) +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:18] "GET / HTTP/1.1" 302 351 0.001115 +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:21] "GET /login HTTP/1.1" 200 1835 0.001974 +68.183.91.167,127.0.0.1 - - [16/Sep/2025 15:47:22] "GET /favicon.ico HTTP/1.1" 404 331 0.000847 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:06] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -[2025-09-06 14:23:07,421] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/engineio/server.py", line 450, in run_handler + return self.handlers[event](*args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 671, in _handle_eio_disconnect + self._handle_disconnect(eio_sid, n, reason) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 568, in _handle_disconnect + self._trigger_event('disconnect', namespace, sid, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 150, in on_disconnect + user_uuid2chatmanager[uuid].disconnect(uuid) +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:51] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=websocket&sid=cekXcN6msgjITGbfAAAH HTTP/1.1" 200 0 11049.633881 +(185715) accepted ('127.0.0.1', 45882) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:53] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjMh HTTP/1.1" 200 275 0.000827 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:54] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjcT&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 192 0.000960 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:54] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjcX&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 196 0.000708 +(185715) accepted ('127.0.0.1', 45890) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "POST /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjt8&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 192 0.000617 Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:23:07] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "[32mGET /switch-role/teacher HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /dashboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:23:10] "GET /static/js/dashboard.js HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:23:11] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[32mGET /switch-role/student HTTP/1.1[0m" 302 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "GET /teacherboard HTTP/1.1" 200 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/css/teacherboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/css/dashboard.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/css/teacher_course_setting.css HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/js/course_current.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/js/teacherboard.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:01] "[36mGET /static/js/teacher_course_setting.js HTTP/1.1[0m" 304 - -101.87.252.115 - - [06/Sep/2025 14:24:02] "[36mGET /static/image/algorithm/book_cover.png HTTP/1.1[0m" 304 - -[2025-09-06 14:24:02,837] ERROR in app: Exception on /materials/algorithm [GET] + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/hub.py", line 471, in fire_timers + timer() + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/hubs/timer.py", line 59, in __call__ + cb(*args, **kw) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/eventlet/greenthread.py", line 272, in main + result = function(*args, **kwargs) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 591, in _handle_event_internal + r = server._trigger_event(data[0], namespace, sid, *data[1:]) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/socketio/server.py", line 627, in _trigger_event + return handler.trigger_event(event, *args) + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/namespace.py", line 26, in trigger_event + return self.socketio._handle_event(handler, event, self.namespace, + File "/home/flask/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_socketio/__init__.py", line 835, in _handle_event + ret = handler(*args) + File "/home/flask/hsamooc/code-agent/Html/apps/sockets/namespaces.py", line 53, in on_login + user_id = uuid2username[user_uuid] +KeyError: 'user_a24fccb3-d4b7-4716-bda5-5801b8cedd08' +(185715) accepted ('127.0.0.1', 45900) +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGjt9&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000618 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:55] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGk04&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000268 +101.87.252.115,127.0.0.1 - - [16/Sep/2025 16:01:56] "GET /socket.io/?user_uuid=user_a24fccb3-d4b7-4716-bda5-5801b8cedd08&folder=%2Fhome%2Fcake%2F68bacdfadf5aeae0912f7f18%2F%E5%9F%BA%E7%A1%80%E7%AE%97%E6%B3%95%2F%E4%BA%8C%E5%88%86&EIO=4&transport=polling&t=PbJGk9U&sid=SmogL1S86UeH8buqAAAJ HTTP/1.1" 200 157 0.000240 +disconnect handler error Traceback (most recent call last): - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 1455, in wsgi_app - response = self.full_dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 869, in full_dispatch_request - rv = self.handle_user_exception(e) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask_cors/extension.py", line 176, in wrapped_function - return cors_after_request(app.make_response(f(*args, **kwargs))) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 867, in full_dispatch_request - rv = self.dispatch_request() - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/flask/app.py", line 852, in dispatch_request - return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/auth/decorators.py", line 96, in wrapper - return func(*args, **kwargs) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/views/material.py", line 45, in get_material - material = load_material(material_id) - File "/home/ubuntu/hsamooc/code-agent/Html/apps/services/course_service.py", line 69, in load_material - material = mongo.db.materials.find_one({"_id": ObjectId(material_id)}) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 105, in __init__ - self.__validate(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 193, in __validate - _raise_invalid_id(oid) - File "/home/ubuntu/hsamooc/code-agent/.venv/lib/python3.10/site-packages/bson/objectid.py", line 38, in _raise_invalid_id - raise InvalidId( -bson.errors.InvalidId: 'algorithm' is not a valid ObjectId, it must be a 12-byte input or a 24-character hex string -101.87.252.115 - - [06/Sep/2025 14:24:02] "[35m[1mGET /materials/algorithm HTTP/1.1[0m" 500 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "[32mGET /teacherboard HTTP/1.1[0m" 302 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /login HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /static/css/login.css HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:34] "GET /static/js/login.js HTTP/1.1" 200 - -219.228.146.148 - - [08/Sep/2025 07:48:35] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -2025-09-08 14:47:28.122 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -[33mPress CTRL+C to quit[0m -2025-09-08 14:50:17.500 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: off -[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -[33mPress CTRL+C to quit[0m -156.229.165.237 - - [08/Sep/2025 14:50:27] "[32mGET / HTTP/1.1[0m" 302 - -156.229.165.237 - - [08/Sep/2025 14:50:28] "GET /login HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:28] "GET /static/css/login.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:29] "GET /static/js/login.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:30] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -156.229.165.237 - - [08/Sep/2025 14:50:36] "POST /login_post HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:38] "POST /login_post HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:39] "GET /dashboard HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/css/dashboard.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:40] "GET /static/js/dashboard.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:41] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:42] "[32mGET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1[0m" 302 - -[2025-09-08 14:50:43,444] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -156.229.165.237 - - [08/Sep/2025 14:50:43] "GET /desktop/user_c363ada4-69ca-44f8-82e9-9ce8805d33a0/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /static/css/desktop.css HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /static/js/chatbox.js HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:44] "GET /get_session HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:45] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -156.229.165.237 - - [08/Sep/2025 14:50:45] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -2025-09-11 03:37:39.548 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Serving Flask app 'apps' - * Debug mode: on -[31m[1mWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.[0m - * Running on all addresses (0.0.0.0) - * Running on http://127.0.0.1:5551 - * Running on http://172.31.34.185:5551 -[33mPress CTRL+C to quit[0m - * Restarting with stat -2025-09-11 03:37:43.308 | INFO | agentscope.models:read_model_configs:186 - Load configs for model wrapper: openai_cfg -Werkzeug appears to be used in a production deployment. Consider switching to a production web server instead. - * Debugger is active! - * Debugger PIN: 105-227-715 -156.229.165.237 - - [11/Sep/2025 04:18:19] "[32mGET / HTTP/1.1[0m" 302 - -156.229.165.237 - - [11/Sep/2025 04:18:19] "GET /login HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "GET /static/js/login.js HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "GET /static/css/login.css HTTP/1.1" 200 - -156.229.165.237 - - [11/Sep/2025 04:18:20] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /login HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /static/js/login.js HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "GET /static/css/login.css HTTP/1.1" 200 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:49] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -59.78.194.184 - - [11/Sep/2025 04:18:50] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "[32mGET / HTTP/1.1[0m" 302 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /login HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /static/js/login.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "GET /static/css/login.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:41] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:42] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:47] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:49] "POST /login_post HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /dashboard HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/image/algorithm/book_cover.png HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/css/dashboard.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:50] "GET /static/js/dashboard.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:51] "POST /dashboard/get_course_progress HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "[32mGET /desktop_nouser/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1[0m" 302 - -[2025-09-11 04:21:53,385] DEBUG in vscode: config file path: /home/ubuntu/hsamooc/code-agent/study/TCake/68bacdfadf5aeae0912f7f18/基础算法/.config -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /desktop/user_f300a0e5-d63a-4101-a2c6-1015d960e06f/68bacdfadf5aeae0912f7f18/基础算法/二分 HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /static/css/desktop.css HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:53] "GET /static/js/chatbox.js HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "GET /get_session HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:54] "[33mGET /favicon.ico HTTP/1.1[0m" 404 - -127.0.0.1 - - [11/Sep/2025 04:21:55] code 400, message Bad request version ('Ü\x8e÷j?d!¹Á\x9có5=µ7í»´b\x86q\x05\x14Ê\\0F¬\x8ep\x08Ï^\x03¥\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00') -127.0.0.1 - - [11/Sep/2025 04:21:55] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03qàât¿¡T½\x13ä©?ÆÃ=qIÍ\x8dºÀ\x1f½%´L\x81\x13Ùä\x13p e\x9cL´Ò;7ëË\x04¡\x82¿÷×w/këM¿\x86\x1dögÿ(:Ïn\x91m\x00 jj\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85**\x00\x00ÿ\x01\x00\x01\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1þ\x0d\x00ú\x00\x00\x01\x00\x01?\x00 ý\x99\x0e±\x9d¿ÛH\x9d±õlVSó§Ú\x08R\x12øºíÏB¬\x1dk,ØÝo\x00Ð\x83´>Úß\x83oä|\x98\x08Ø\x9014ËCò \x97\x1d*l\x90ø»EÿPË\x82Ì®NÉ=û\x18éu#Vþ¯³B\x95µ.\x9fÉ\x8cWö²Nu³\x10Dnw\x1fR\x8eÒ\x9eO§Ê\x11Ïr±ÂÕ^ÏÖù¿\x17&÷\x97öËQ]W\x12àãʹ\x99Ð0¦áº*Ô×\x92(Ú¯H!\x03%hJê³ònÝÜ£\x8d\x06ϵãjz\x04äMæ§\x97\x1fE¹Ã1\x09lvÑXJuëñrò»ò?Kì\x0cU>{¶\x96]~®}b\x10eÂnæ\x04\x1dÜ\x8e÷j?d!¹Á\x9có5=µ7í»´b\x86q\x05\x14Ê\\0F¬\x8ep\x08Ï^\x03¥\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00[0m" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:55] "GET /68bacdfadf5aeae0912f7f18-基础算法-二分-markdown HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:55] "GET /static/基础算法-二分.html HTTP/1.1" 200 - -127.0.0.1 - - [11/Sep/2025 04:21:55] code 400, message Bad request version ('\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00') -127.0.0.1 - - [11/Sep/2025 04:21:55] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03]NìÙů÷~\x88í]^é\x15Ì\x93`\x06§è %¡BDÍP\x8eh°\x9d\x84 ÓW$6{ÓÊ\x82ª\x8a\x9c¤òÃLâó¿\x88\x97ßÓ,g7ïí]ªÉÆ\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e**\x00\x00\x00\x05\x00\x05\x01\x00\x00\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00[0m" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:56] code 400, message Bad request version ('·0ø[£pU©äÊ÷QÂbg\x18\x19\x87Föv§') -127.0.0.1 - - [11/Sep/2025 04:21:56] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03¸Òå\x976}\x96Êu\x08z{ÎÏ7.#\x82ºÏ8ie\x88P\x0cî\x1fx¢+g \x08å\x87¨ü9×O(´â©üÈ3¥\x96gIî\x07/pªÛ\x15®\x91~mbÙ\x00 zz\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eúú\x00\x00\x003\x04ï\x04íÊÊ\x00\x01\x00\x11ì\x04Àv\x08\x8cÄ&\x0c)\x0bL\x12X\x1aP\x1aAi\x11\x80¦sdØA\x92Ã\x1c\x03뱤hà\x1eÉ\x0c·0ø[£pU©äÊ÷QÂbg\x18\x19\x87Föv§[0m" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:56] code 400, message Bad request version ('\x02h2\x08http/1.1\x00\x17\x00\x00\x00\x12\x00\x00\x00') -127.0.0.1 - - [11/Sep/2025 04:21:56] "[35m[1m\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03¥\x14ÅOÓ÷¯Åúâññ¡'öC»Ù}0Ìפ6'Î\x9b_î~\x01ä F¤,\x97g"\x03ÛuF0\x0c¥¬UܤµFÀÁ\x13d¹ß\x86/ÿ\x8fz\x9bS\x00 \x9a\x9a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00\x00\x1b\x00\x03\x02\x00\x02ÿ\x01\x00\x01\x00DÍ\x00\x05\x00\x03\x02h2\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00\x17\x00\x00\x00\x12\x00\x00\x00[0m" HTTPStatus.BAD_REQUEST - -127.0.0.1 - - [11/Sep/2025 04:21:57] code 400, message Bad request version ('**\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00') -127.0.0.1 - - [11/Sep/2025 04:21:57] "[35m[1m\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03ä
°Áí ¡¢þcÁd@'ô\x08%8\x00ê\x8c´\x1cAÒ\x9f\x01e]ÃÉ\x83Ǧ\x99x\x80\x00 **\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥ºº\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:21:57] code 400, message Bad request version ('&À!ð¢´îÆÌm\x00+·')
-127.0.0.1 - - [11/Sep/2025 04:21:57] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x93NÍÔ\x09\x82\x80Ë\x10Q\x1a\x9a\x18\x18!7\x82Mhê7¬\x96^´Nfl0k\x8e¼ ÑG"a_¹s\x1a0Ó]bµ\x89\x85&À!ð¢´îÆÌm\x00+·[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:21:58] code 400, message Bad request version ('\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00')
-127.0.0.1 - - [11/Sep/2025 04:21:58] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x1cÿÞËÌ2ûß´¶m\x1e5\x0b\x8d\x07f¯ta\x9cvÿCÖa#¡fPÔw ¾´¬ÂÆ*\x84²±\x99ÂãmN\x151¾Q\x01x¾\x81`\x90\x87È«"¼\x10äj\x00 JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x8a\x8a\x00\x00\x00\x12\x00\x00\x00\x17\x00\x00\x00#\x00\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x00\x0b\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:21:58] code 400, message Bad request version ('\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x17\x00\x00\x00\x12\x00\x00\x00')
-127.0.0.1 - - [11/Sep/2025 04:21:58] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03Ûª\x8eùOÚ¸KÞ\x80Õ\x83Ì\x8al\x87²\x8d¶ÚC\x83µ^´Ã\x07ç\x9c_\x05ô p\x08}¤y\x02a¾\x80é<\x9d¾\x81g\x91=¨\x0d¶¾9}C1\x8bÑsꮽ9\x00 \x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eêê\x00\x00\x00-\x00\x02\x01\x01\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00#\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00\x0b\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x17\x00\x00\x00\x12\x00\x00\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:01] code 400, message Bad request version ('\x02h2\x08http/1.1\x00')
-127.0.0.1 - - [11/Sep/2025 04:22:01] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03;´\x96Ù:6çv#*b3åF7\x93¤#hÐ\x98ÈÌv\x926J\x83GU\x02Ö ·\x0d+\x83~¢èãªA¹\x98+\x1dæÊ\x07=¯\x06\x02c¿\x90\x91æÔàȼê,\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e\x8a\x8a\x00\x00\x00\x17\x00\x00ÿ\x01\x00\x01\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:01] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x9d`àÜ\x8e¡©<Û\x10y$zl¶"%')
-127.0.0.1 - - [11/Sep/2025 04:22:01] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x9d`àÜ\x8e¡©<Û\x10y$zl¶"%\x0c\x1a\x08Ò\x89Ð\x1a\x9f\x93ð\x05¦\x0f\x96[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:02] code 400, message Bad request version ('{m\x93\x0e')
-127.0.0.1 - - [11/Sep/2025 04:22:02] "[35m[1m\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03\x18¤\x1erB\x0c\x0d3\x86½¨ÊA\x80\x14\x0b\x1a¸ç;¥f)'Ã\x00ÊÉ\x07\x89\x02ë {m\x93\x0e[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:02] code 400, message Bad request version ('ó')
-127.0.0.1 - - [11/Sep/2025 04:22:02] "[35m[1m\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x1c¹¾³Õ\x01æý\x9d¦*óz:ľRÔ0ÔJ\x01\x9a²}\x14\x91^¹V c |\x99È \x80à\x87^\x1cbná\x87küÅÅÖrþ]é`#ɪsI\x04ªJ¡\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06Eºº\x00\x00\x00\x0b\x00\x02\x01\x00ÿ\x01\x00\x01\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhostþ\x0d\x00º\x00\x00\x01\x00\x01K\x00 \x9f\x10ê\x8c\x16Ì\x02w\x89\x08Fïþ¼X&7\x84\x83yR\x1fó[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:03] "[36mGET /static/css/desktop.css HTTP/1.1[0m" 304 -
-127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad request version ('\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00')
-127.0.0.1 - - [11/Sep/2025 04:22:07] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03©Ú»#\x17¡\x9a#¡±¸\x18óßÊ5\x8f\x85\x1c99¯\x966V®0\x19Ër/\x0c \x9fÔÔ4Þs;yöj\x8a:\x96æF=\x1eû«±eîC}¢©\x95WìH\\\x9e\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85**\x00\x00DÍ\x00\x05\x00\x03\x02h2\x00\x0b\x00\x02\x01\x00\x00\x1b\x00\x03\x02\x00\x02\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad HTTP/0.9 request type ('\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03Ôþ,\x08ÛFñ0ù÷Ý©\x08à\x0e\x7fpD0\x05¤24áD2Ë%/2³È')
-127.0.0.1 - - [11/Sep/2025 04:22:07] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03Ôþ,\x08ÛFñ0ù÷Ý©\x08à\x0e\x7fpD0\x05¤24áD2Ë%/2³È °ãH=\x10mx¢ttZN\x028§ú$``?Û-1UÉ\x81&¿y:\x86\x86\x00 [0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:07] code 400, message Bad request version ('\x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eÊÊ\x00\x00ÿ\x01\x00\x01\x00\x003\x04ï\x04í')
-127.0.0.1 - - [11/Sep/2025 04:22:07] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03=0?D-NB°ß\x81ú¥÷³½\x02\x92Ð\x1ej2É?ê\x9c2\x01ï?hoö ò(D\x91(¢\x8cÕÐè:ø!\x95|¥\x96~¦\x82fËj\x87ç\x05ýú¹\x19\x9aÆ\x00 \x1a\x1a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06eÊÊ\x00\x00ÿ\x01\x00\x01\x00\x003\x04ï\x04í[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:08] code 400, message Bad request version ('\x1a\x1a\x00\x00\x00')
-127.0.0.1 - - [11/Sep/2025 04:22:08] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03\x1e8ó~ot¶\x90ë±gÖ¹ÉcÞÏöÖ\x13D\x8cû\x94¡½[UkÖyÒ \x80\x1cDU×}3>ëóg{Ó2¸\x7fkáû\x9b\x96\x06]¬´)U¨\x09\x93@\x97\x00 ZZ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x1a\x1a\x00\x00\x00[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:13] code 400, message Bad request version ('ãWf$al·')
-127.0.0.1 - - [11/Sep/2025 04:22:13] "[35m[1m\x16\x03\x01\x06ò\x01\x00\x06î\x03\x03îóåKT\x9f\x91\x89s«:°FÍ\x04ñ)\x16ý\x9f¦¨Obù&ÿç¡2¾ ar2\x19o\x9e:Í6H¼\x89Òó¤\x9f\x0eSÀ+7/4\x85ÃGK\x9fU\x93\x96¸\x00 êê\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06\x85\x1a\x1a\x00\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01\x003\x04ï\x04í**\x00\x01\x00\x11ì\x04ÀhIo\x000\x0cäë\x86±õ¡\x1f)\x95è9¼^Ñ\x7f²¶\x92èm\x86\x0ba<\x14\x84ñZÉ_$ÎìôÁä\x11Åç\x92t\x0dãWf$al·[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:13] code 400, message Bad request version ('localhost\x00#\x00\x00\x003\x04ï\x04ízz\x00\x01\x00\x11ì\x04ÀtQ\x8f\x02\x9cQ\x8b\x00]sºrÖ\x91\x9e\x80\x03OÊ')
-127.0.0.1 - - [11/Sep/2025 04:22:13] "[35m[1m\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x1c¾2|´áÚÊ+Eé¤Û$Çè£0Í-¸u\x937\x85\x11ÛqÙ\x85¯Ð µã\x14|kg¹\x9d;\x01õ28DzïaI{Ì1SÀ,\x07L\x80\x92ö±Â©\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06E\x9a\x9a\x00\x00\x00\x1b\x00\x03\x02\x00\x02\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00#\x00\x00\x003\x04ï\x04ízz\x00\x01\x00\x11ì\x04ÀtQ\x8f\x02\x9cQ\x8b\x00]sºrÖ\x91\x9e\x80\x03OÊ[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:14] code 400, message Bad request syntax ('\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ëHw\x9fC')
-127.0.0.1 - - [11/Sep/2025 04:22:14] "[35m[1m\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ëHw\x9fC[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:14] code 400, message Bad request version ('å@Ì#Â\x9a4_ë')
-127.0.0.1 - - [11/Sep/2025 04:22:14] "[35m[1m\x16\x03\x01\x06²\x01\x00\x06®\x03\x03ÝN4E\x8azL\x82\x0e\x09\x84k:*Ø\x97³òÉpXýë'\x82ÎÐ\x07ñ¥T \x864¢;\x9ft\x92ù®-øø]Ö:\x81.À\x1dÔÉx\x05\x94XÈ\x98á¼¹ïê\x00 úú\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06E**\x00\x00\x00+\x00\x07\x06**\x03\x04\x03\x03DÍ\x00\x05\x00\x03\x02h2þ\x0d\x00º\x00\x00\x01\x00\x01\x12\x00 C\x88D\x88È:=9¿\x11\x04G\x85\x09À.ñ¢HèÆNÛ\x84\x12ôP>ötu\x05\x00\x90o\\47g}\x1då@Ì#Â\x9a4_ë[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:20] code 400, message Bad request syntax ('\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03í\x14Iþ\x05ÅÒv/\x8dAµ¡H+')
-127.0.0.1 - - [11/Sep/2025 04:22:20] "[35m[1m\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03í\x14Iþ\x05ÅÒv/\x8dAµ¡H+[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:20] code 400, message Bad request version ('\x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e')
-127.0.0.1 - - [11/Sep/2025 04:22:20] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x037øÂì$èsêe\x1a«\x12\x11\x8c\x93Ú\x18\x0f\x13ÀÖ8\x05¤U\x94[µÁ»Þ. ß°_0Çå\x9c\x01\x1cdÝm\x80¹(\x81\x02Ê\x02zDàí\x10Ñ4\x8b\x0b\x06\x92C¡\x00 \x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06e[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:21] code 400, message Bad request version ('ø\x86¹vO\x00°ÑWìú8\x92S7D\x8d¦\x9e^S\x16\x9c±©)Á\x95¼N\x84²D;\x18/ÏȪ±')
-127.0.0.1 - - [11/Sep/2025 04:22:21] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03®{«ãPUÃ.,®á"Z Ì\x15\x1cx\x8eÑ}\x87sº\x82\x00\x93T\x9bzuÕ \x9fñmK}\x81LtªúÞ¦è6\x17Ú\x08´5ãgÏ·«\x19ú\x09ê\x92\x1fâz\x00 ªª\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06ezz\x00\x00\x00\x0b\x00\x02\x01\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00+\x00\x07\x06ZZ\x03\x04\x03\x03\x00-\x00\x02\x01\x01\x00#\x00\x00\x00\x1b\x00\x03\x02\x00\x02\x00\x12\x00\x00ÿ\x01\x00\x01\x00\x00\x0d\x00\x12\x00\x10\x04\x03\x08\x04\x04\x01\x05\x03\x08\x05\x05\x01\x08\x06\x06\x01þ\x0d\x00Ú\x00\x00\x01\x00\x01õ\x00 7\x1fAó\x07KÔÛ`äÁ}^®\x8f£A\x01×'ÒO\x1eH\x1dï\x1fø\x86¹vO\x00°ÑWìú8\x92S7D\x8d¦\x9e^S\x16\x9c±©)Á\x95¼N\x84²D;\x18/ÏȪ±[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:21] code 400, message Bad request version ('\x91Ç\x0e\x82Û]\x07c%H\x08»ÙûµÞÊ\x9a\x93ÛÂÊÝ£ÝJW|åâín')
-127.0.0.1 - - [11/Sep/2025 04:22:21] "[35m[1m\x16\x03\x01\x07\x12\x01\x00\x07\x0e\x03\x03\x9eÎtÑ\x99ôÞùX\x0d\x10\x8aËæ\x848A\x10±,:Kù\x0cò\x9c4w\x8f® \x07ë?\x0cé\x9cIî\x9d- ¨h,W¾êÔ»\x99áÝ5\x08s¢V1¹\x00 JJ\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06¥jj\x00\x00\x00\x17\x00\x00\x00\x10\x00\x0e\x00\x0c\x02h2\x08http/1.1\x00\x0b\x00\x02\x01\x00\x00\x00\x00\x0e\x00\x0c\x00\x00\x09localhost\x00+\x00\x07\x06ºº\x03\x04\x03\x03\x00#\x00\x00ÿ\x01\x00\x01\x00\x00-\x00\x02\x01\x01\x00\x1b\x00\x03\x02\x00\x02\x00\x05\x00\x05\x01\x00\x00\x00\x00þ\x0d\x01\x1a\x00\x00\x01\x00\x01Ê\x00 %\x14d\x9c[§\\núºÞ§\x87ßùevW¶\x90ïT\x7fö\x01%«\x84a\x89ª\x0f\x00ð×\x19\x82**Ç\x8f;W\x05knj]L³\x9eßÅ\x0cs¿õ\x0fM.G\x95\x0dè»\x00\x836<¹¬FE[*\x9a\x8d\x85®\x18ó\x82!\x8ayâ=L0ó-ÌÐKRè»r I\x8fÛ\x0e½ß&d\x95\x8eÿ<ü!$C\x8bð\x06/\x0bÕ\x18\x89$\x1b\x13è5·\x02ñð\x1dà\x1bIX\x87ü*ä\x0e\x110\x9f\x8d¦`UYÏuKåËÑñ+úÑf âÐ\x8c\x0c¥Ú\x14¤ÚË`Ös\x8b¼\x1fÞ¦\x89)á\x8fw\x11\x82\x8a\x80ÿ\x10p\x9eËpXÉÆG¾k_©#\x81\x1d\x094ù$\x04ó\x14#-t\x7f±\x85¬ö\x06}h\x06»Ï\x9aI\x84n1tì\x1c\x91Ç\x0e\x82Û]\x07c%H\x08»ÙûµÞÊ\x9a\x93ÛÂÊÝ£ÝJW|åâín[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:27] code 400, message Bad request version ('\x14')
-127.0.0.1 - - [11/Sep/2025 04:22:27] "[35m[1m\x16\x03\x01\x06Ò\x01\x00\x06Î\x03\x03\x8aJ5\x1b©Ü\x8f\x1c\x08ïrÁÕ%´g®¶\x1c\x99¢Ö\x89ò\\h8þ\x7fÏã\x16 .~±ÂO÷\x8cH_\x10b.\x84°\x88\x03O\x9cIê\x8cÿ\x0fGã\x1c\x14[0m" HTTPStatus.BAD_REQUEST -
-127.0.0.1 - - [11/Sep/2025 04:22:27] code 400, message Bad request version ('\x8a\x8a\x13\x01\x13\x02\x13\x03À+À/À,À0̨̩À\x13À\x14\x00\x9c\x00\x9d\x00/\x005\x01\x00\x06Eªª\x00\x00\x00\x17\x00\x00\x00')
-127.0.0.1 - - [11/Sep/2025 04:22:27] "[35m[1m\x16\x03\x01\x06²\x01\x00\x06®\x03\x03\x82\x93=\x9f?w\x96Ã/^\x1e\x1bú¡\x8c\x8dZ\x97Úc\x8a\x09r^®\x80FÃ\x9a\x92N; ù Auto-generated at 2025-09-16 05:03 项目组目前有两套备选的交通信号灯同步算法,它们将在不同性能的服务器上运行: 方案A:部署在超级服务器上(10^9 次运算/秒),采用的是一种较为简单的算法,处理n个路口需要 $2n^2$ 次计算。 方案B:部署在普通服务器上(10^7 次运算/秒),但采用的是一种更优化的算法,处理n个路口需要 $50nlog_2n$ 次计算。 你的项目经理(右侧的Agent)希望你通过分析,来判断哪个方案更具前景。请与TA对话,逐一回答以下问题。 与右侧的Agent对话,回答以下问题: 概念回顾:首先,请向你的“经理”解释,根据课程所学,一个合格的“算法”应具备哪些基本特征? 小规模测试:对于一个包含100个路口的小型城区(n=100),计算并说明方案A和方案B分别需要多长时间完成计算?在这种情况下,你会推荐哪个方案? 大规模应用:现在,我们需要为一座拥有100万个路口的大都市(n=1,000,000)进行规划。再次计算并说明两个方案的耗时。你的推荐会改变吗?为什么? 总结陈词:综合以上分析,向你的“经理”总结:为什么一个更优的算法设计,其重要性远超硬件性能的提升? 这验证了课程中提到的哪个核心观点? 理论分析让你认识到了算法效率的重要性。现在,你需要通过编程来亲身感受不同交通状况对同一算法性能的巨大影响。我们将以“插入排序”为例,来处理三种典型的交通流量数据,这分别对应算法分析中的最好,最坏和平均情况。 实现插入排序算法,并验证其在处理“畅通无阻”(数据有序)、“交通大堵塞”(数据逆序)和“随机车流”(数据随机)三种模式时的效率差异。 在代码编辑区,完成 def insertion_sort(arr):
+ """
+ 实现插入排序算法
+ 参数arr: 待排序的交通数据数组(整数代表车辆通行次序)
+ 返回: 排序后的数组
+ """
+ # TODO: 请在此处实现你的插入排序逻辑 def generate_traffic_data(n):
+ """
+ 生成模拟交通数据
+ 参数n: 数据规模(路口数量或监控点数量)
+ 返回: 三种不同交通状况的数据
+ """
+ random_data = [random.randint(0, 10**6) for _ in range(n)]
+ # 模拟“畅通无阻”:交通流按次序进入,数据基本有序 (Best Case)
+ best_case_data = sorted(random_data)
+ # 模拟“交通大堵塞”:疏散时情况完全反转,数据逆序 (Worst Case)
+ worst_case_data = sorted(random_data, reverse=True)
+ # 模拟“随机车流”:正常但无规律的交通状况 (Average Case)
+ average_case_data = random_data
+ return best_case_data, worst_case_data, average_case_data def measure_performance(func, data):
+ """
+ 测量算法性能
+ 参数func: 排序函数
+ 参数data: 交通数据
+ 返回: 执行时间(毫秒)
+ """
+ start_time = time.perf_counter_ns()
+ func(data.copy()) # 使用副本避免影响其他测试
+ end_time = time.perf_counter_ns()
+ return (end_time - start_time) / 10**6 # 转换为毫秒 network_sizes = [1000, 5000, 10000]
+print("交通数据处理算法性能测试:")
+for size in network_sizes:
+ best, worst, avg = generate_traffic_data(size) ``` 完成编程并得到输出后,请与右侧Agent讨论以下问题,以检验你的理解: 结果分析:当网络规模从1000增加到10000时,“交通大堵塞”(最坏情况)的处理时间增长了大约多少倍?这更符合O(n)(线性)还是O(n2)(二次)的增长模式? 原因探究:为什么“畅通无阻”(最好情况)的处理速度如此之快?它的时间复杂度是什么?请结合你的代码逻辑来解释。 实践应用:根据你的实验结果,你认为插入排序是否适合用于需要快速响应大规模交通拥堵的实时预警系统?为什么? 融会贯通:结合第一关的理论分析和第二关的编程实验,你对“算法是解决问题的核心”这句话有了怎样更深的理解?效率的重要性与实践验证
+
+
+理论热身:算法选择的智慧
+任务:分析与决策
+
+
+思考题
+
+
+编程实践:验证算法的真实性能
+任务:编码与分析
+题目:模拟交通流量排序
+代码框架
+insertion_sort(arr) 函数的实现后,运行完整代码,并与Agent讨论结果。
+请创建任意文件,将下面代码写入到编辑器中
+```python
+import random
+import time测试不同规模的路口网络
+
+time_best = measure_performance(insertion_sort, best)
+time_worst = measure_performance(insertion_sort, worst)
+time_avg = measure_performance(insertion_sort, avg)
+
+print(f"网络规模 n={size}:")
+print(f" - 畅通无阻 (Best Case): {time_best:.2f} ms")
+print(f" - 交通大堵塞 (Worst Case): {time_worst:.2f} ms")
+print(f" - 随机车流 (Average Case): {time_avg:.2f} ms")
+分析与讨论
+
+
+
+
+
\ No newline at end of file
diff --git a/Html/apps/utils/sudoUtil.py b/Html/apps/utils/sudoUtil.py
index 92002d4..0b8a73e 100644
--- a/Html/apps/utils/sudoUtil.py
+++ b/Html/apps/utils/sudoUtil.py
@@ -16,7 +16,7 @@ def sudo_open(file_path, mode='r', encoding='utf-8'):
if result.returncode != 0:
raise PermissionError(f"无法读取文件: {file_path}")
content = result.stdout
- yield content
+ return content
elif mode == 'w':
raise PermissionError(f"不允许以sudo权限写入文件: {file_path}")
else:
diff --git a/Html/apps/views/vscode.py b/Html/apps/views/vscode.py
index 680a9ef..99df8ea 100644
--- a/Html/apps/views/vscode.py
+++ b/Html/apps/views/vscode.py
@@ -33,6 +33,29 @@ def desktop(user_uuid, course_id, chapter_name, lesson_name):
except subprocess.CalledProcessError as e:
print(f"Error creating directory {path_dir} details {str(e)}")
+ try:#使用sudo创建shared_group
+ subprocess.run(["sudo", "groupadd", f"shared_group_{user_id}"], check=True)
+ except subprocess.CalledProcessError as e:
+ print(f"Error creating shared_group: {e}")
+
+ try:#使用sudo将user_id加入shared_group
+ subprocess.run(["sudo", "usermod", "-a", "-G", f"shared_group_{user_id}", user_id], check=True)
+ # 自己也加入
+ subprocess.run(["sudo", "usermod", "-a", "-G", f"shared_group_{user_id}", 'flask'], check=True)
+ except subprocess.CalledProcessError as e:
+ print(f"Error adding user {user_id} to shared_group: {e}")
+ try:#将文件
+ subprocess.run(["sudo", "chown", "-R", f"flask:shared_group_{user_id}", user_home], check=True)
+ subprocess.run(["sudo", "chmod", "-R", "770", path_dir], check=True)
+ except subprocess.CalledProcessError as e:
+ print(f"Error changing directory {path_dir} to shared_group_{user_id}: {e}")
+ try:#继承目录
+ subprocess.run(["sudo", "chmod", "g+s", path_dir], check=True)
+ except subprocess.CalledProcessError as e:
+ print(f"Error changing directory {path_dir} to shared_group_{user_id}: {e}")
+
+
+
chatmanager = ChatManager()
current_app.extensions["user_uuid2chatmanager"][user_uuid] = chatmanager
code_server_port = 10000 + int(uuid.uuid4().int % 10000)
@@ -52,6 +75,8 @@ def desktop(user_uuid, course_id, chapter_name, lesson_name):
r'handle_path\s+/vsc' + re.escape(user_id) + r'/\* {.*?reverse_proxy.*?}',
re.DOTALL
)
+ for i in range(len(lines)):
+ if (lines[i].strip()==''): lines[i]=''
content = "".join(lines)
if pattern.search(content):
new_content = pattern.sub('', content)
diff --git a/code-server-like/app/sockets/terminal_service.py b/code-server-like/app/sockets/terminal_service.py
index 626223d..96d9b2b 100644
--- a/code-server-like/app/sockets/terminal_service.py
+++ b/code-server-like/app/sockets/terminal_service.py
@@ -5,154 +5,166 @@ import uuid
import subprocess
import threading
from flask import Blueprint, request, current_app, session
-from flask_socketio import Namespace, join_room, leave_room, emit, SocketIO
+from flask_socketio import Namespace, join_room, leave_room, emit, SocketIO, rooms, disconnect
from threading import Thread
import sys
from ..extensions import socketio
-
+import pty
+import termios
+import struct
+import fcntl
+import psutil
+TERM_INIT_CONFIG = {
+ # instead of local server runnning this web terminal service
+ # "domain" is the target that you want to access through local server (with this web terminal)
+ # and before doing so - make sure you have username and port (on the "domain") to implement remote access
+ 'domain': '127.0.0.1', # or ip address like 192.168.10.11
+ 'client_path': {
+ 'telnet': '/usr/bin/telnet', # confirmed location of your client binary (with cmd like 'which telnet')
+ 'ssh': '/usr/bin/ssh'
+ }
+}
terminal_bp = Blueprint('terminal', __name__, url_prefix='/vsc-like')
-# 存储终端进程
-command_dict = {}
-terminal_busy = {}
-terminals = {}
-terminal_locks = {}
-
-def check_process_running(command_name):
- try:
- # 使用 pgrep 查找与给定命令相关的进程
- result = subprocess.run(
- ["pgrep", "-f", command_name],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE
- )
- return result.returncode == 0 # 如果返回值为 0,说明命令仍在运行
- except Exception as e:
- print(f"Error checking process: {e}")
- return False
-
-def monitor_process(socket_id, command_name, namespace):
- while True:
- is_running = check_process_running(command_name)
- if is_running:
- print(f"Process '{command_name}' is still running.")
- else:
- print(f"Process '{command_name}' is not running.")
- break # 停止检查,如果进程不再运行
-
- time.sleep(0.1) # 每 0.1 秒检查一次
- command_dict[socket_id] = ''
- terminal_busy[socket_id] = False
- namespace.emit('terminal_output',{'data': '>'})
-def start_terminal_process(socket_id, namespace):
+def set_winsize(fd, row, col, xpix=0, ypix=0):
+ winsize = struct.pack("HHHH", row, col, xpix, ypix)
+ fcntl.ioctl(fd, termios.TIOCSWINSZ, winsize)
+
+
+def read_and_forward_pty_output(fd=None, pid=None, room_id=None,namespace=None):
"""
- 监听多个子进程的输出,并通过 WebSocket 发给前端
- 使用 select 进行非阻塞的 I/O 操作,并实现动态流量控制
+ read data on pty master from the pty slave, and emit to the web terminal visitor
"""
- process = terminals[socket_id]
-
- # 获取子进程的 stdout 和 stderr
- stdout = process.stdout
- stdin = process.stdin
- # 将 stdout 和 stderr 添加到 select 监听的文件描述符列表中
-
- # 初始等待时间
- timeout = 0.1
- max_timeout = 2 # 设置最大超时时间为 2 秒
-
+ max_read_bytes = 1024 * 20
+ timeout=0.1
while True:
- while True:
- output = stdout.readline()
- if not output:
- break
- timeout = 0.1
- namespace.emit('terminal_output', {'data': output+'\r'}, room=socket_id)
- timeout = min(timeout * 2, max_timeout)
- time.sleep(timeout)
- if process.poll() is not None:
- break
-
+ socketio.sleep(timeout)
+ timeout=min(timeout*2, 0.4)
+ # using flask default web server, or uwsgi production web server
+ # when the child process is terminated, it will not disappear from linux process list
+ # and keep staying as a zombie process until the parent exits.
+ try:
+ child_process = psutil.Process(pid)
+ except psutil.NoSuchProcess as err:
+ return
+ if child_process.status() not in ('running', 'sleeping'):
+ return
+ if fd:
+ timeout_sec = 0
+ (data_ready, _, _) = select.select([fd], [], [], timeout_sec)
+ if data_ready:
+ # output = os.read(fd, max_read_bytes).decode('ascii')
+ timeout=0.1
+ try:
+ output = os.read(fd, max_read_bytes).decode()
+ except Exception as err:
+ output = """
+ ***AQUI WEB TERM ERR***
+ {}
+ ***********************
+ """.format(err)
+ # the key for different visitor to get different terminal (instead of mixing up)
+ # is to let the background task push pty response to each one's own (default) ROOM!
+ namespace.emit("pty_output", {"output": output}, room=room_id)
class VSCLikeNameSpace(Namespace):
- def on_connect(self, data):
- """
- 处理 WebSocket 连接
- - 验证会话
- - 使用指定的用户启动 bash 终端
- - 启动监听子进程输出的线程
- """
- socket_id = session.get('uuid')
- user_id = session.get('user_id') # 从 session 获取用户 ID
- path = session.get('path')
+ def on_connect(self):
+ """new client connected"""
+ if session.get('terminal_config', {}).get('child_pid', None):
+ print(session['terminal_config']['child_pid'])
+ # already started child process, don't start another
+ return
- if not path or not user_id:
- emit('error', {'message': 'Authentication failed, no path or user found for this session'})
- return False # 拒绝连接
- # 使用 sudo 启动终端进程,以指定的 user_id 用户身份执行
- try:
- process = subprocess.Popen(
- ['sudo', '-u', user_id, 'bash', '-il'], # 使用指定的 user_id 启动 bash
- stdin=subprocess.PIPE,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE,
- text=True, # 确保输出是文本格式
- )
- terminals[socket_id] = process
- terminal_busy[socket_id] = False
- emit('connected', {'message': 'OK'})
- join_room(socket_id, namespace='/vsc-like')
+ # create child process attached to a pty we can read from and write to
+ (child_pid, fd) = pty.fork()
+ lesson_path = session.get('path')
+ if child_pid == 0:
+ # this is the child process fork.
+ # anything printed here will show up in the pty, including the output
+ # of this subprocess
+ # subprocess.run('bash')
+ term_type = session.get('terminal_config').get('term_type')
+ path = TERM_INIT_CONFIG.get('client_path', {}).get(term_type, None)
+ if not path:
+ print("Can't locate {} binary, exit".format(term_type))
+ disconnect()
+ if term_type == 'telnet':
+ # switch to the right location of your telnet binary (example comes from OSX which got telnet from brew)
+ # or you can also make work like auto-detection, or manually but configurable
+ os.execl(path, 'telnet', '-l', session['terminal_config']['username'],
+ session['terminal_config']['domain'], '{}'.format(session['terminal_config']['port']))
+ elif term_type == 'ssh':
+ os.execl(path,'ssh', '-p','22',
+ #'{}'.format(session['terminal_config']['port']),
+ '{}@{}'.format(session['terminal_config']['username'], session['terminal_config']['domain']))
+
- socketio.start_background_task(target=start_terminal_process, socket_id=socket_id, namespace=self)
-
- except Exception as e:
- emit('error', {'message': f'Error starting terminal process: {str(e)}'})
- return False
-
- def on_send_input(self, data):
- socket_id = session.get('uuid')
- input_data = data.get('input')
- if socket_id not in command_dict:command_dict[socket_id]=''
- # 检查当前 socket_id 是否有对应的终端
- if socket_id in terminals:
- # 获取该终端的锁进行线程同步
- lock = terminal_locks.get(socket_id)
- if not lock:
- lock = threading.Lock()
- terminal_locks[socket_id] = lock
-
- with lock: # 在锁的保护下操作终端
- try:
- terminals[socket_id].stdin.write(input_data)
- command_dict[socket_id]+=input_data
- if input_data=='\r':
- terminals[socket_id].stdin.flush()
- emit('terminal_output', {'data': f'\r\n'}, room=socket_id)
- if terminal_busy[socket_id]==False:
- terminal_busy[socket_id] = True
- socketio.start_background_task(monitor_process, socket_id, command_dict[socket_id], namespace=self)
- elif input_data=='\x03':
- terminals[socket_id].stdin.flush()
- emit('terminal_output', {'data': f'^C\x03\r\n'}, room=socket_id)
- else:
- emit('terminal_output', {'data': input_data}, room=socket_id)
- except Exception as e:
- emit('error', {'message': f'Error sending input: {str(e)}'}, room=socket_id)
+ else:
+ current_app.logger.debug("wrong term type {}".format(term_type))
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
else:
- emit('error', {'message': 'No terminal found for this session'}, room=socket_id)
+ session['terminal_config']['fd'] = fd
+ session['terminal_config']['child_pid'] = child_pid
+ session['terminal_config']['room_id'] = rooms()[0]
+ session.modified = True
+ set_winsize(fd, 50, 50)
+ current_app.logger.debug("child pid = {}".format(child_pid))
+ current_app.logger.debug("rooms of this session = {}".format(rooms()))
+ socketio.start_background_task(read_and_forward_pty_output, fd, child_pid, rooms()[0],self)
+ current_app.logger.debug("background task running")
+ # print(session)
- def on_disconnect():
- socket_id = session.get('uuid')
-
- # 检查是否有终端进程需要终止
- if socket_id in terminals:
- try:
- # 终止终端进程
- terminals[socket_id].terminate()
- del terminals[socket_id]
- # 删除锁
- if socket_id in terminal_locks:
- del terminal_locks[socket_id]
- emit('terminal_output', {'data': 'Terminal disconnected and terminated'}, room=socket_id)
- except Exception as e:
- emit('error', {'message': f'Error disconnecting terminal: {str(e)}'}, room=socket_id)
+ def on_pty_input(self, data):
+ """write to the child pty, which now is the ssh process from this machine to the 'domain' configured
+ """
+ print(f"get data {data}")
+ try:
+ child_process = psutil.Process(session.get('terminal_config').get('child_pid'))
+ except psutil.NoSuchProcess as err:
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
+ return
+ if child_process.status() not in ('running', 'sleeping'):
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
+ return
+ # print(session)
+ # print(data, 'from input')
+ fd = session.get('terminal_config').get('fd')
+ if fd:
+ # print("writing to ptd: %s" % data["input"])
+ # os.write(fd, data["input"].encode('ascii'))
+ os.write(fd, data["input"].encode())
+
+
+ def on_resize(self, data):
+ try:
+ child_process = psutil.Process(session.get('terminal_config').get('child_pid'))
+ except psutil.NoSuchProcess as err:
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
+ return
+ if child_process.status() not in ('running', 'sleeping'):
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
+ return
+ fd = session.get('terminal_config').get('fd')
+ if fd:
+ set_winsize(fd, data["rows"], data["cols"])
+
+ def on_disconnect(self):
+ try:
+ child_process = psutil.Process(session.get('terminal_config', {}).get('child_pid'))
+ except psutil.NoSuchProcess as err:
+ disconnect()
+ session['terminal_config'] = TERM_INIT_CONFIG
+ return
+ if child_process.status() in ('running', 'sleeping'):
+ # if visitor just close the browser tab then left alone the pty here
+ # it should be terminated by the parent process after
+ child_process.terminate()
+ current_app.logger.debug('user left the pty alone, terminated')
+ current_app.logger.debug('Client disconnected')
\ No newline at end of file
diff --git a/code-server-like/app/views/file.py b/code-server-like/app/views/file.py
index 03b5729..b1ad3a4 100644
--- a/code-server-like/app/views/file.py
+++ b/code-server-like/app/views/file.py
@@ -12,8 +12,7 @@ def create_folder():
filepath = request.json.get('path', '')
path = session.get('path')
parent = request.json.get('parent', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{path}'
+ base_path = f'{path}'
filepath = f'{base_path}/{parent}/{filepath}'
try:
os.makedirs(filepath)
@@ -27,8 +26,7 @@ def create_file():
filepath = request.json.get('path', '')
path = session.get('path')
parent = request.json.get('parent', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{path}'
+ base_path = f'{path}'
filepath = f'{base_path}/{parent}/{filepath}'
try:
open(filepath, 'w').close()
@@ -41,8 +39,7 @@ def rename_file():
user_root = session.get('path')
path = request.json.get('path', '')
new_name = request.json.get('newName', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{user_root}'
+ base_path = f'{user_root}'
filepath = f'{base_path}/{path}'
try:
path_list = filepath.split('/')
@@ -58,8 +55,7 @@ def rename_folder():
user_root = session.get('path')
path = request.json.get('path', '')
new_name = request.json.get('newName', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{user_root}'
+ base_path = f'{user_root}'
folderpath = f'{base_path}/{path}'
try:
path_list = folderpath.split('/')
@@ -74,9 +70,8 @@ def rename_folder():
def copy_files():
old_path = request.json.get('oldPath', '')
new_path = request.json.get('newPath', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
user_root = session.get('path')
- base_path = f'{root_workspace_path}/{user_root}'
+ base_path = f'{user_root}'
old_path = f'{base_path}/{old_path}'
new_path = f'{base_path}/{new_path}'
# oldpath的父目录就是newpath的话,对oldpath进行重命名
@@ -106,9 +101,8 @@ def copy_files():
@file_bp.route('/delete-file', methods=['POST'])
def delete_file():
path = request.json.get('path', '')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
user_root = session.get('path')
- base_path = f'{root_workspace_path}/{user_root}'
+ base_path = f'{user_root}'
filepath = f'{base_path}/{path}'
if os.path.isdir(filepath):
shutil.rmtree(filepath)
@@ -119,8 +113,7 @@ def delete_file():
@file_bp.route('/file-content', methods=['POST'])
def file_content():
path = session.get('path')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{path}'
+ base_path = f'{path}'
filepath = request.json.get('path', '')
filepath = f'{base_path}/{filepath}'
if not os.path.exists(filepath):
@@ -135,8 +128,7 @@ def file_content():
@file_bp.route('/save-file', methods=['POST'])
def save_file():
path = session.get('path')
- root_workspace_path = current_app.config['ROOT_WORKSPACE_PATH']
- base_path = f'{root_workspace_path}/{path}'
+ base_path = f'{path}'
filepath = request.json.get('path', '')
filepath = f'{base_path}/{filepath}'
content = request.json.get('content', '')
diff --git a/code-server-like/app/views/routes.py b/code-server-like/app/views/routes.py
index 691eb18..8ae074f 100644
--- a/code-server-like/app/views/routes.py
+++ b/code-server-like/app/views/routes.py
@@ -4,9 +4,18 @@ from flask import Blueprint, request, jsonify, current_app, render_template, ses
from ..services.file_service import get_file_tree, load_config
main_bp = Blueprint('main', __name__, url_prefix='/vsc-like')
-
-@main_bp.route('/