AppImage loads library from system even if present in AppDir

I’m trying to build an AppImage from a QT audio player using linuxdeploy linuxdeploy-plugin-qt and linuxdeploy-plugin-gstreamer and I have some issues where playing music throws up an error when loading a gvfs library which is present in the AppDir.

/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so: undefined symbol: gvfs_get_socket_dir
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so

Music plays fine on my os but the error still persists.

The AppImage has been build using the following commands and tools:

./linuxdeploy-x86_64.AppImage --plugin qt --appdir AppDir --desktop-file AppDir/usr/share/applications/com.github.fcrollet.vpsplayer.desktop

./linuxdeploy-x86_64.AppImage --plugin gstreamer --library /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so --appdir AppDir --desktop-file AppDir/usr/share/applications/com.github.fcrollet.vpsplayer.desktop

./appimagetool-x86_64.AppImage AppDir -n

The AppImage has been build on ubuntu:18.04 and it’s running on ubuntu:22.04. Since all of this is done on a github workflow I had to use a docker container that doesn’t have everything in place so first I had to downgrade libsystemd0=237-3ubuntu10.53 libudev1=237-3ubuntu10.53 then install gvfs. Maybe I’m missing something here?

apt install -y qtchooser qt515base qt515declarative qt515multimedia qt515svg qt515x11extras qt515wayland build-essential python3-pip ninja-build wget pkg-config libsamplerate0-dev libsndfile1-dev libfftw3-dev ladspa-sdk lv2-dev vamp-plugin-sdk libboost-test-dev meson ninja-build libssl-dev libgl1-mesa-dev fuse libfuse2 ibgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio gvfs git

The output with QT_DEBUG_PLUGINS=1 is the following

➜  workspace LD_LIBRARY_PATH=/home/marcel/workspace/squashfs-root/usr/lib QT_DEBUG_PLUGINS=1 ./VPS_Player-x86_64.AppImage | grep gstreamer 
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforms/libqxcb.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/platforms" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforms/libqxcb.so"
loaded library "Xcursor"
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platformthemes" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platformthemes/libqxdgdesktopportal.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/platformthemes/libqxdgdesktopportal.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformThemeFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "xdgdesktopportal",
            "flatpak",
            "snap"
        ]
    },
    "archreq": 0,
    "className": "QXdgDesktopPortalThemePlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xdgdesktopportal", "flatpak", "snap")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/platformthemes" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libcomposeplatforminputcontextplugin.so, metadata=
{
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "compose",
            "xim"
        ]
    },
    "archreq": 0,
    "className": "QComposePlatformInputContextPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("compose", "xim")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so, metadata=
{
    "IID": "org.qt-project.Qt.QPlatformInputContextFactoryInterface.5.1",
    "MetaData": {
        "Keys": [
            "ibus"
        ]
    },
    "archreq": 0,
    "className": "QIbusPlatformInputContextPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("ibus")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/platforminputcontexts" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so"
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/styles" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/iconengines" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/iconengines" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqgif.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqgif.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "gif"
        ],
        "MimeTypes": [
            "image/gif"
        ]
    },
    "archreq": 0,
    "className": "QGifPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("gif")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqico.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqico.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "ico",
            "cur"
        ],
        "MimeTypes": [
            "image/vnd.microsoft.icon",
            "image/vnd.microsoft.icon"
        ]
    },
    "archreq": 0,
    "className": "QICOPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("ico", "cur")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqjpeg.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqjpeg.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "jpg",
            "jpeg"
        ],
        "MimeTypes": [
            "image/jpeg",
            "image/jpeg"
        ]
    },
    "archreq": 0,
    "className": "QJpegPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("jpg", "jpeg")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqsvg.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqsvg.so, metadata=
{
    "IID": "org.qt-project.Qt.QImageIOHandlerFactoryInterface",
    "MetaData": {
        "Keys": [
            "svg",
            "svgz"
        ],
        "MimeTypes": [
            "image/svg+xml",
            "image/svg+xml-compressed"
        ]
    },
    "archreq": 0,
    "className": "QSvgPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("svg", "svgz")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/imageformats" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqgif.so"
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqico.so"
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqjpeg.so"
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqsvg.so"
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/audio" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtaudio_alsa.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtaudio_alsa.so, metadata=
{
    "IID": "org.qt-project.qt.audiosystemfactory/5.0",
    "MetaData": {
        "Keys": [
            "alsa"
        ]
    },
    "archreq": 0,
    "className": "QAlsaPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("alsa")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtmedia_pulse.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtmedia_pulse.so, metadata=
{
    "IID": "org.qt-project.qt.audiosystemfactory/5.0",
    "MetaData": {
        "Keys": [
            "default"
        ]
    },
    "archreq": 0,
    "className": "QPulseAudioPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("default")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/audio" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtmedia_pulse.so"
Sample rate: 44100
Channel count: 2
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-egl-integration.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-egl-integration.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
    "MetaData": {
        "Keys": [
            "xcb_egl"
        ]
    },
    "archreq": 0,
    "className": "QXcbEglIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb_egl")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.Xcb.QXcbGlIntegrationFactoryInterface.5.5",
    "MetaData": {
        "Keys": [
            "xcb_glx"
        ]
    },
    "archreq": 0,
    "className": "QXcbGlxIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb_glx")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/xcbglintegrations" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so"
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/accessible" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/accessiblebridge" ...
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/accessiblebridge" ...


QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice" ...
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstaudiodecoder.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstaudiodecoder.so, metadata=
{
    "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
    "MetaData": {
        "Keys": [
            "gstreameraudiodecode"
        ],
        "Services": [
            "org.qt-project.qt.audiodecode"
        ]
    },
    "archreq": 0,
    "className": "QGstreamerAudioDecoderServicePlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("gstreameraudiodecode")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstcamerabin.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstcamerabin.so, metadata=
{
    "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
    "MetaData": {
        "Keys": [
            "gstreamercamerabin"
        ],
        "Services": [
            "org.qt-project.qt.camera"
        ]
    },
    "archreq": 0,
    "className": "CameraBinServicePlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("gstreamercamerabin")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstmediacapture.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstmediacapture.so, metadata=
{
    "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
    "MetaData": {
        "Keys": [
            "gstreamermediacapture"
        ],
        "Services": [
            "org.qt-project.qt.audiosource"
        ]
    },
    "archreq": 0,
    "className": "QGstreamerCaptureServicePlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("gstreamermediacapture")
QFactoryLoader::QFactoryLoader() looking at "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstmediaplayer.so"
Found metadata in lib /tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstmediaplayer.so, metadata=
{
    "IID": "org.qt-project.qt.mediaserviceproviderfactory/5.0",
    "MetaData": {
        "Keys": [
            "gstreamermediaplayer"
        ],
        "Services": [
            "org.qt-project.qt.mediaplayer"
        ]
    },
    "archreq": 0,
    "className": "QGstreamerPlayerServicePlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("gstreamermediaplayer")
QFactoryLoader::QFactoryLoader() checking directory path "/tmp/.mount_VPS_Pl745hvn/usr/bin/mediaservice" ...
loaded library "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstaudiodecoder.so"
QMediaPluginLoader: loaded plugins for key "org.qt-project.qt.audiodecode" : ("gstreameraudiodecode")
/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so: undefined symbol: gvfs_get_socket_dir
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/mediaservice/libgstaudiodecoder.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/xcbglintegrations/libqxcb-glx-integration.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/audio/libqtmedia_pulse.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqgif.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqico.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqjpeg.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/imageformats/libqsvg.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforminputcontexts/libibusplatforminputcontextplugin.so" 
QLibraryPrivate::unload succeeded on "/tmp/.mount_VPS_Pl745hvn/usr/plugins/platforms/libqxcb.so" 
QLibraryPrivate::unload succeeded on "Xcursor" (faked)

Hello @nitanmarcel. linuxdeploy is not part of the AppImage project, and I don’t think its author reads here. So it’d be best to describe your issue over at Issues · linuxdeploy/linuxdeploy · GitHub. Thanks!

@nitanmarcel I don’t know if this will solve your problem, but you might want to check out some docs on the patchelf command.

I use it in the 0ad appimage build script.

Looks like your libs are getting copied without setting the rpath, so a bit different case than I’m experiencing though.