簡體   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