kasmtech / workspaces-images

Other
730 stars 241 forks source link

APP_ARGS in vscode causes squid error & broken installation #35

Closed drewbitt closed 1 year ago

drewbitt commented 1 year ago

Specifying a directory, like the user data dir, with the documented APP_ARGS variable leads to a failure to get a VNC shell & the logs spam filter is not configured, which appears to be a squid error

docker run
  -d
  --name='vscode-kasm'
  --net='bridge'
  -e HOST_CONTAINERNAME="vscode-kasm"
  -e 'VNC_PW'='MYPASSWORD'
  -e 'APP_ARGS'='--user-data-dir=/home/kasm-user/user-data'
  -p '6901:6901/tcp' 'kasmweb/vs-code:1.12.0-rolling'
+ START_COMMAND=code
+ PGREP=code
+ export MAXIMIZE=true
+ MAXIMIZE=true
+ export 'MAXIMIZE_NAME=Visual Studio Code'
+ MAXIMIZE_NAME='Visual Studio Code'
+ MAXIMIZE_SCRIPT=/dockerstartup/maximize_window.sh
+ DEFAULT_ARGS=--no-sandbox
+ ARGS=--user-data-dir=/home/kasm-user/user-data
++ getopt -o gau: -l go,assign,url: -n /dockerstartup/custom_startup.sh --
+ options=' --'
+ eval set -- ' --'
++ set -- --
+ [[ -- != -- ]]
+ shift
+ FORCE=
+ '[' -n '' ']'
+ '[' -n '' ']'
+ kasm_startup
+ '[' -n '' ']'
+ '[' -z '' ']'
+ URL=
+ '[' -z '' ']'
+ echo 'Entering process startup loop'
+ set +x
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
_IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root
gpg-agent[214]: WARNING: "--write-env-file" is an obsolete option - it has no effect
gpg-agent[215]: gpg-agent (GnuPG) 2.2.19 started

(xfce4-session:72): xfce4-session-WARNING **: 01:43:35.427: gpg-agent returned no PID in the variables

(xfce4-session:72): xfce4-session-WARNING **: 01:43:35.428: xfsm_manager_load_session: Something wrong with /home/kasm-user/.cache/sessions/xfce4-session-f146598cb810:1, Does it exist? Permissions issue?

(xfce4-session:72): xfce4-session-WARNING **: 01:43:35.488: Unable to launch "xfce4-panel": Failed to execute child process “xfce4-panel” (No such file or directory)

(xfsettingsd:228): libupower-glib-WARNING **: 01:43:35.492: Couldn't connect to proxy: Could not connect: No such file or directory

(xfsettingsd:228): libupower-glib-CRITICAL **: 01:43:35.492: up_client_get_lid_is_closed: assertion 'UP_IS_CLIENT (client)' failed

(xfsettingsd:228): GLib-GObject-WARNING **: 01:43:35.492: invalid (NULL) pointer instance

(xfsettingsd:228): GLib-GObject-CRITICAL **: 01:43:35.492: g_signal_connect_data: assertion 'G_TYPE_CHECK_INSTANCE (instance)' failed
ERROR:KasmGamepadServer:Failed to connect input (/dev/input/event0) : [Errno 2] No such file or directory: '/dev/input/event0'
ERROR:KasmGamepadServer:Failed to connect input (/dev/input/event1) : [Errno 2] No such file or directory: '/dev/input/event1'
ERROR:KasmGamepadServer:Failed to connect input (/dev/input/event2) : [Errno 2] No such file or directory: '/dev/input/event2'
ERROR:KasmGamepadServer:Failed to connect input (/dev/input/event3) : [Errno 2] No such file or directory: '/dev/input/event3'
Failed to unload module: Module module-pipe-source not loaded
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on https://172.17.0.8:4902/ (Press CTRL+C to quit)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
+ [ -w /home/kasm-user/.xsession-errors ]
+ [ ! -L /home/kasm-user/.xsession-errors ]
+ chmod 600 /home/kasm-user/.xsession-errors
+ stat -c%s /home/kasm-user/.xsession-errors
+ [ 12895 -gt 500000 ]
+ exec
 2022-12-16 01:43:35,352 [DEBUG] Selection: Selection owner change for _DBUS_SESSION_BUS_SELECTION_kasm-user_303f3cf2074e461b99eb4fb67c1ae9c8
Kasm User () started container id f146598cb810 with local IP address 172.17.0.8
Entering process startup loop
filter is not configured
Listening for incomming MPEG-TS Stream on https://127.0.0.1:8081/<secret>
Awaiting WebSocket connections on wss://127.0.0.1:4901/
 2022-12-16 01:43:35,439 [DEBUG] WebUdp: UDP listening on port 6901
 2022-12-16 01:43:35,465 [DEBUG] Selection: Selection owner change for WM_S0
 2022-12-16 01:43:35,475 [DEBUG] Selection: Selection owner change for XFWM4_COMPOSITING_MANAGER
 2022-12-16 01:43:35,491 [DEBUG] Selection: Selection owner change for _XSETTINGS_S0
 2022-12-16 01:43:35,516 [DEBUG] Selection: Selection owner change for CLIPBOARD_MANAGER
 * Serving Flask app 'kasm_upload_server' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
filter is not configured
Stream Connected: ::ffff:127.0.0.1:46562
filter is not configured
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
filter is not configured
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
 2022-12-16 01:43:43,600 [DEBUG] Selection: Selection owner change for XFDESKTOP_SELECTION_0
 2022-12-16 01:43:43,601 [DEBUG] Selection: Selection owner change for _NET_DESKTOP_MANAGER_S0

** (xfdesktop:393): WARNING **: 01:43:43.603: Failed to get system bus: Could not connect: No such file or directory
Cannot get client list properties. 
(_NET_CLIENT_LIST or _WIN_CLIENT_LIST)
filter is not configured
filter is not configured
filter is not configured
filter is not configured

** (agent:613): CRITICAL **: 01:43:51.505: Failed to get connection to system bus: Could not connect: No such file or directory

** (xiccd:629): CRITICAL **: 01:43:51.516: Failed to connect to colord: Could not connect: No such file or directory

(xfce4-session:72): xfce4-session-WARNING **: 01:43:51.520: ICE connection 0x55e99b0fdbd0 rejected
Failure: Module initialization failed

(nm-applet:622): nm-applet-WARNING **: 01:43:51.543: Error connecting to system D-Bus: Could not connect: No such file or directory

(nm-applet:622): nm-applet-WARNING **: 01:43:51.543: Could not connect: No such file or directory

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:3905)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:3859)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:3937)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:3986)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:4026)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:4042)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:4080)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:4598)): assertion '<dropped>' failed

(nm-applet:622): libnm-CRITICAL **: 01:43:51.544: ((libnm/nm-client.c:4598)): assertion '<dropped>' failed
system-config-printer-applet: failed to connect to system D-Bus
filter is not configured
filter is not configured
filter is not configured
filter is not configured
filter is not configured
filter is not configured
filter is not configured
filter is not configured

This includes even setting the variable in its default ~/.config/Code directory

j-travis commented 1 year ago

When you specify APP_ARGS you are overwriting the default arguments - one of which is --no-sandbox which is required for vscode to work properly. So, you'll need to add that to your APP_ARGS too then you should be g2g

https://github.com/kasmtech/workspaces-images/blob/develop/src/ubuntu/install/vs_code/custom_startup.sh#L8-L9

drewbitt commented 1 year ago

Great. That works for it to boot. However, any custom user-data-dir or extensions-dir passed won't work by default due to incorrect user permissions on the (new) folder. Although that is unrelated to this issue.

drwxr-xr-x 1        99 users      0 Dec 16 01:13 user-data
drwxr-xr-x 1        99 users      0 Dec 16 01:13 extensions-dir
drwxr-xr-x 1 kasm-user kasm-user  0 Dec 20 23:04 Uploads

Would recommend documentation on the --no-sandbox requirement. Closing!