Open brandonscript opened 1 month ago
Exploring a little more with this, I've tried exec'ing into the container, and when I first ran DISPLAY=:0 HANDBRAKE_DEBUG=1 /startapp.sh
, it failed with:
libEGL warning: MESA-LOADER: failed to open swrast: Error loading shared library /usr/lib/xorg/modules/dri/swrast_dri.so: No such file or directory (search paths /usr/lib/xorg/modules/dri, suffix _dri)
Digging around, it appears there's a missing driver, so adding this to a Dockerfile got me past that:
RUN apk add xhost xterm mesa-dri-gallium
Now when I run the startup script, it gets a little further, and actually writes out to the handbrake debug log:
(fr.handbrake.ghb:9185): Gdk-DEBUG: 09:49:08.471: error: XDG_RUNTIME_DIR is invalid or not set in the environment.
(fr.handbrake.ghb:9185): GLib-GIO-DEBUG: 09:49:08.505: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ‘gio-vfs’
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.522: returning null (CustomTmpEnable)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.526: Could not access portal: Failed to execute child process “dbus-launch” (No such file or directory)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.541: Function: create_builder_or_die
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.604: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.604: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): GLib-GIO-DEBUG: 09:49:08.604: Failed to initialize portal (GPowerProfileMonitorPortal) for gio-power-profile-monitor: Not using portals
(fr.handbrake.ghb:9185): GLib-GIO-DEBUG: 09:49:08.604: _g_io_module_get_default: Found default implementation dbus (GPowerProfileMonitorDBus) for ‘gio-power-profile-monitor’
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.605: Function: ghb_ui_update (activity_location)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.605: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.605: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.605: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.605: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.623: Function: ghb_init_combo_box
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.623: Function: ghb_init_combo_box
(... repeats several times)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.624: Function: ghb_init_combo_box
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.625: returning null (PictureDeinterlaceFilter)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.626: returning null (PictureDenoiseFilter)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.626: returning null (PictureSharpenFilter)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.626: returning null (PictureSharpenFilter)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.642: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.642: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.642: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: ud 0x747ce694be60
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: builder 0x747ce692d270
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: Function: bind_audio_tree_model
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: Done
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: Function: bind_subtitle_tree_model
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: Function: ghb_presets_bind_tree_model
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.643: Done
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.645: returning null (DiskFreeLimit)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (FolderOpen)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.679: returning null (PresetDescription)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.703: Function: ghb_cache_volnames
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.899: Could not access portal: Failed to execute child process “dbus-launch” (No such file or directory)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:08.899: Could not create UPower proxy: Could not connect: No such file or directory
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_ui_settings_update (preview_count)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: returning null (PtoPType)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_ui_settings_update (VideoQualityGranularity)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: vqual_granularity_changed_cb
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: returning null (VideoQualitySlider)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_widget_to_setting
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.426: Function: ghb_get_setting_key
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (FileFormat)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: Function: set_destination_settings
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (dest_file)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (volume)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (volume)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.495: returning null (VideoEncoder)
(fr.handbrake.ghb:9185): ghb-DEBUG: 09:49:09.496: returning null (VideoEncoder)
(fr.handbrake.ghb:1433): Gdk-DEBUG: 09:51:05.065: error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Adding this to the Dockerfile fixes the XDG_RUNTIME_DIR
error:
RUN mkdir -pv /xdgr && chmod 777 /xdgr && chown 1000:1000 /xdgr
ENV XDG_RUNTIME_DIR=/xdgr
ENV DISPLAY=:0.0
But then I get this in the hb debug log:
(fr.handbrake.ghb:28049): GLib-GIO-DEBUG: 11:08:47.696: Failed to initialize portal (GPowerProfileMonitorPortal) for gio-power-profile-monitor: Not using portals
(fr.handbrake.ghb:28049): GLib-GIO-DEBUG: 11:08:47.696: _g_io_module_get_default: Found default implementation dbus (GPowerProfileMonitorDBus) for ‘gio-power-profile-monitor’
(fr.handbrake.ghb:28049): ghb-DEBUG: 11:08:47.697: Function: ghb_ui_update (activity_location)
(fr.handbrake.ghb:28049): ghb-DEBUG: 11:08:47.697: Function: ghb_get_setting_key
(fr.handbrake.ghb:28049): ghb-DEBUG: 11:08:47.697: Function: ghb_widget_to_setting
(fr.handbrake.ghb:28049): ghb-DEBUG: 11:08:47.697: Function: ghb_get_setting_key
(fr.handbrake.ghb:28049): ghb-DEBUG: 11:08:47.697: Function: ghb_get_setting_key
(fr.handbrake.ghb:28058): ghb-DEBUG: 11:08:47.712: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
My leading theory is that this is related to the host running Wayland and the container attempting to exist in X11, and for some reason there isn't true isolation between the host and container. I'll continue to dig.
Could also be related to using the nvidia
runtime in my docker-compose.yml.
This container doesn't need anything from the host for display purpose. So you should definitely not set the DISPLAY
environment variables, which might create problems since the container handles this variable itself.
The nvidia
runtime might be the problem. Did you try without it ?
Do you see the same crash if you run docker run --rm jlesage/handbrake
?
Current Behavior
I'm not entirely sure what specifically is incorrect, or if anything, however I'm running a headless Ubuntu 22.04 box with docker, and though I connect to it with the Microsoft RDP client (since VNC no longer works on Ubuntu), I generally don't have a display connected.
When starting the app, I get an endless loop of errors:
After some sleuthing:
xhost
and runningxhost +
:xhost: unable to open display ""
/startapp.sh
:(fr.handbrake.ghb:20718): Gtk-WARNING **: 11:48:57.696: Failed to open display
I realized that there's no
DISPLAY
set, since there's no GUI session on the host. I tried addingDISPLAY=${DISPLAY}
to my docker-compose file, and this got it a little further, but now xvnc is still failing to load:Expected Behavior
There should be a way to configure the system to handle headless hosts (or perhaps I am doing something uniquely weird, and this is an RDP issue not a headless issue).
Steps To Reproduce
linuxbrew
(not Docker Desktop)And based on this Dockerfile:
Environment
Container creation
(See in ^ repro)
Container log
Container inspect