-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_flashdock_logs.py
More file actions
66 lines (58 loc) · 2.09 KB
/
check_flashdock_logs.py
File metadata and controls
66 lines (58 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
"""检查FLASH-DOCK日志和错误"""
import subprocess
import sys
def check_logs():
print("=" * 60)
print("检查 FLASH-DOCK 日志和错误")
print("=" * 60)
print()
# 检查Streamlit日志
print("1. 检查Streamlit日志...")
log_paths = [
"~/.streamlit/logs/",
"/root/.streamlit/logs/",
]
for log_path in log_paths:
cmd = f"ls -la {log_path} 2>/dev/null | head -10 || echo 'Log directory not found'"
result = subprocess.run(
["wsl", "-d", "Ubuntu-24.04", "bash", "-c", cmd],
capture_output=True,
text=True,
encoding='utf-8',
errors='ignore',
timeout=10
)
if result.returncode == 0 and "not found" not in result.stdout:
print(f" [INFO] 日志目录: {log_path}")
print(f" {result.stdout}")
else:
print(f" [INFO] {log_path} 不存在")
# 检查Python错误
print("\n2. 检查Python进程状态...")
cmd = "ps aux | grep 'streamlit.*FlashDock' | grep -v grep | head -1"
result = subprocess.run(
["wsl", "-d", "Ubuntu-24.04", "bash", "-c", cmd],
capture_output=True,
text=True,
encoding='utf-8',
errors='ignore',
timeout=10
)
if result.returncode == 0 and result.stdout.strip():
print(" [OK] Streamlit进程信息:")
print(f" {result.stdout.strip()}")
else:
print(" [WARNING] 未找到Streamlit进程")
# 尝试获取stderr输出
print("\n3. 检查可能的错误...")
print(" 提示: 请查看启动FLASH-DOCK的WSL窗口")
print(" 如果窗口已关闭,可以重新运行启动脚本查看错误")
print("\n" + "=" * 60)
print("建议操作:")
print("=" * 60)
print("1. 查看启动FLASH-DOCK的WSL窗口中的错误信息")
print("2. 如果窗口已关闭,运行: start_flashdock_debug.bat")
print("3. 在浏览器中按F12查看控制台错误")
print("4. 检查浏览器Network标签中的请求状态")
if __name__ == "__main__":
check_logs()