Unable to make dependency errors/warning go away for QT app

I am having trouble getting my qt project that I snapped to work. I believe it is caused by missing packages, but when I add the relevant ones, the errors I get persist. While building the snap, I get the warning:

Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be removed in a future release. If these libraries are needed in the final snap, ensure that the following are either satisfied by a stage-packages entry or through a part:

usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
usr/lib/x86_64-linux-gnu/libcaca.so.0
usr/lib/x86_64-linux-gnu/libva.so.1

And once I start my app I get the error messages:

Gtk-Message: Failed to load module “overlay-scrollbar”
Gtk-Message: Failed to load module “gail”
Gtk-Message: Failed to load module “atk-bridge”
Gtk-Message: Failed to load module “unity-gtk-module”
Qt: Session management error: None of the authentication protocols specified are supported

The application works, in that I can interact with the interface, but when I try to do what I made the gui for (execute a shell script that the GUI generates), it doesn’t work.
Here is part of my snapcraft.yaml:

hooks:
configure :
plugs: [home]
parts:
myapp:
plugin: dump
source: ./QT_Files_for_Snap/ # contains the executable
build-packages:
- qtbase5-dev
- libcanberra-gtk-module
- unity-gtk-module-common
- libpulse0
- overlay-scrollbar
stage-packages:
- libqt5gui5
- unity-gtk-module-common
- libpulse0
- libcanberra-gtk-module
- qtbase5-dev
- overlay-scrollbar
after: [qt5conf,desktop-qt5]
userfiles:
plugin: dump
source: ./User_Files/
apps:
myapp:
command: desktop-launch $SNAP/MyApp $SNAP_DATA
plugs: [home, unity7]

As you can see, I include packages such as overlay-scrollbar, but I still get errors for them. I’m not sure how to make these go away.

Thanks for the help.

those warnings when you start your app are all non-fatal. They are not your program’s issue. I believe if you add the plugs X11, and desktop (and possibly wayland and desktop-legacy) then you’ll fire right up.

edit: oh, I misread, I see you’re getting a UI now, but you cannot execute a shell script from your application.

run snap install snappy-debug and then execute sudo snappy-debug.security scanlog in a terminal. Now in another terminal run your application and recreate the scenario where you try to execute the script. In the first terminal there might be some apparmor messages with explanations as to how to overcome them (not all these messages are surmountable, so don’t include such explanations).

If you see anything in snappy-debug that you don’t understand then paste the log here for us to have a looksee. If there are no denial messages then we need to further understand your application and how it launches the script, where that script is located, and it’s permissions.

Also as a simple data point can you post the output of snap version and lsb_release -a

1 Like

Thank you for the reply. My version info is as follows:

snap    2.35
snapd   2.35
series  16
ubuntu  16.04
kernel  4.13.16-041316-generic

When I ran it, nothing showed up in the log. I think if the problem isn’t a missing library, it may be how I execute the application. When I run the application, it all works fine, and even writes out the shell script it is going to execute, but it may error out when trying to spawn the QProcess to execute the script. I’ll start investigating that.
The reason I thought it was a library issue in the first place is because if I execute it by doing [$SNAP/MyApp] [$SNAP_DATA] from the command line, then it works fine.

Edit:
I launched it in shell to see what was happening. The script was exiting with exit code 127. It depends on an executable, when I ldd that executable, I get this:

root@EvalKit2:/var/snap/qtencodegui/current/helper_dir/Scripts/FFmpeg# ldd ffmpeg_vp9
linux-vdso.so.1 => (0x00007ffff63df000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ff5fca28000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff5fc71f000)
libxcb.so.1 => not found
libxcb-shm.so.0 => not found
libxcb-shape.so.0 => not found
libxcb-xfixes.so.0 => not found
libasound.so.2 => not found
libSDL2-2.0.so.0 => not found
libsndio.so.6.1 => not found
libXv.so.1 => not found
libX11.so.6 => not found
libXext.so.6 => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff5fc51b000)
libva.so.1 => not found
libass.so.5 => not found
libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007ff5fc271000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007ff5fc057000)
libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007ff5fbdee000)
libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007ff5fb9aa000)
libvpx.so.3 => not found
libfdk-aac.so.0 => not found
libopus.so.0 => not found
libx264.so.148 => not found
libx265.so.79 => not found
libva-drm.so.1 => not found
libva-x11.so.1 => not found
libvdpau.so.1 => not found
libxmaapi.so.0 => not found
libxclgemdrv.so => not found
libyaml-0.so.2 => /usr/lib/x86_64-linux-gnu/libyaml-0.so.2 (0x00007ff5fb78b000)
libxml2.so.2 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff5fb56e000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff5fb1a4000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff5fcdaa000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff5faf8e000)
libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007ff5fad69000)

Does anyone know how I can include these? I’ve tried adding things like libxcb1, libx11-6, and libx11-dev to both stage and build package lists, but they are still not found.

copy paste the target path into a terminal with dpkg -S i.e.:

$ dpkg -S  /lib/x86_64-linux-gnu/libgcc_s.so.1
libgcc1:amd64: /lib/x86_64-linux-gnu/libgcc_s.so.1
$ dpkg -S  /lib/x86_64-linux-gnu/libpng12.so.0
libpng12-0:amd64: /lib/x86_64-linux-gnu/libpng12.so.0

the package name you want to include in stage-packages: is the bit before the first colon in the output.

1 Like