繁体   English   中英

xwininfo -tree 总是在 lambda 容器上显示 0 个孩子

[英]xwininfo -tree always shows 0 children on lambda container

正如标题所述,我发现每当我在 lambda 中运行 Ubuntu 的容器上发出xwininfo -tree时,从来没有子屏幕,尽管当我在本地运行相同的容器时它工作正常(列出所述应用程序使用的所有窗口). 问题一定出在应用程序启动和它向 X 服务器注册的某个地方。 这里有没有人对可能发生的事情有任何见解,或者我如何才能让它发挥作用?

要为这个问题附加一些代码,要点基本上是:

# Start Xvfb
Xvfb $DISPLAY -screen 0 1920x1080x24 -nolisten tcp -nolisten unix & 

# Open Visual Studio Code (just as an example application)
code .

# List all windows
xwininfo -root -tree

如前所述,本地xwininfo会生成如下内容:

Root window id: 0x50d (the root window) (has no name)
Parent window id: 0x0 (none)
   6 children:
   0x600006 "Code": ("code" "Code")  800x600+560+240  +560+240
   0x600002 "Get Started - src - Visual Studio Code": ("code" "Code")  1024x768+448+156  +448+156
   0x600003 (has no name): ()  1x1+0+0  +0+0
   0x800003 "code": ("code" "Code")  200x200+0+0  +0+0
      1 child:
      0x800004 (has no name): ()  1x1+-1+-1  +-1+-1
   0x800001 "code": ("code" "Code")  10x10+10+10  +10+10
   0x600000 "Chromium clipboard": ()  10x10+-100+-100  +-100+-100

但在 lambda 中,输出仅显示根窗口,没有子窗口:

Root window id: 0x50d (the root window) (has no name)
Parent window id: 0x0 (none)
   0 children.

这里会发生什么? 为什么我的应用程序窗口没有出现在xwininfo -tree的输出中?

这是一种一半的答案,因为我无法肯定地解决原始问题的根本原因,但它是一个解释为什么 Visual Studio Code 无法启动(并且没有出现在xwininfo中)的答案。 如果在启动时将--verbose标志传递给 Visual Studio 代码,在 Lambda 环境中,您将获得如下输出:

prctl(PR_SET_NO_NEW_PRIVS) failed

prctl(PR_SET_NO_NEW_PRIVS) failed

Unable to create argv.json configuration file in /home/sbx_user1051/.vscode/argv.json, falling back to defaults (Error: ENOENT: no such file or directory, mkdir \'/home/sbx_user1051/.vscode\')
[94:1213/213845.593392:ERROR:bus.cc(398)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[94:1213/213845.593463:ERROR:bus.cc(398)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[94:1213/213845.626853:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[94:1213/213845.626936:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[94:1213/213845.671433:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
[94:1213/213845.671514:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.671522:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 1 time(s)
[94:1213/213845.672685:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.672708:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 2 time(s)
[94:1213/213845.688115:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.688143:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 3 time(s)
[94:1213/213845.689768:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.689790:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 4 time(s)
[94:1213/213845.690646:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.690662:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 5 time(s)
[94:1213/213846.470027:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.470054:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 6 time(s)
[94:1213/213846.471084:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.471101:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 7 time(s)
[94:1213/213846.471742:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.471761:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 8 time(s)
[94:1213/213846.472344:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.472357:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 9 time(s)
[94:1213/213846.472371:FATAL:gpu_data_manager_impl_private.cc(450)] GPU process isn\'t usable. Goodbye.

问题是,即使 Visual Studio Code 是基于 Electron / Chromium 构建的,它似乎还不支持--headless选项(与 Chrome 之类的东西相对,可以通过一些仔细的修补在 Lambda 函数中启动). 因此,由于 Lambda 环境的限制,目前看来无法在 Lambda 环境中启动 Visual Studio 代码。 (我知道有网络版,但我不想要这个)。 本来很好,因为每次调用一个实例对于我想要完成的事情来说是完美的。 我将继续使用其他一些后端基础设施来做我想做的事......

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM