File chooser doesn't show using kde-neon extension

Friends, I need help. Developer of KeePassXC here. I am at my wits end with snaps and the continued frustration with getting the damn things working properly. I followed exactly the following guides: kde-neon extension and Qt5-KDE-Applications. I produced a rather elegant snapcraft.yml file.

I build the snap on Ubuntu Focal (20.04) to test, everything works. I build it now on launchpad for continuous delivery, everything works. My users tell me they cannot show the file picker on 21.10, 22.04, Mint, etc. I freak out, run through all the debugging tips. I get nothing except it telling me my program is hung up waiting for a file chooser to show (using snap run --gdb keepassxc).

I tried removing the Unity7 plug – didn’t work

I tried running in --devmode – didn’t work

I tried running in --classic – didn’t work

What should I do next to figure out why this is so broken?

3 Likes

Link to snapcraft.yml: https://github.com/keepassxreboot/keepassxc/blob/develop/snap/snapcraft.yaml

The usual go to is to recommend installing the snappy-debug snap, run it as snappy-debug in the terminal, and have it open in the background to log possible errors as they occur.

Judging that it’s specifically the file picker not showing up, it could be possible issues with the XDG Desktop Portals, in which case, using dbus-monitor and looking for the org.freedesktop.portal.Desktop interface could also give some hints on whether there’s problems there.

I tried the snappy-debug and it didn’t reveal anything useful/insightful. Will try the dbus-monitor now.

Here is the log, looks like it is trying to execute something in /proc/xxxx/root

Summary

method call time=1648073008.019577 sender=:1.159 -> destination=org.freedesktop.portal.Desktop serial=29 path=/org/freedesktop/portal/desktop; interface=org.freedesktop.portal.FileChooser; member=OpenFile string “x11:2200006” string “Open database” array [ dict entry( string “directory” variant boolean false ) dict entry( string “filters” variant array [ struct { string "KeePass 2 Database " array [ struct { uint32 0 string “.kdbx" } ] } struct { string "All files " array [ struct { uint32 0 string "” } ] } ] ) dict entry( string “handle_token” variant string “qt2126256133” ) dict entry( string “modal” variant boolean true ) dict entry( string “multiple” variant boolean false ) ]

method call time=1648073008.020203 sender=:1.45 -> destination=org.freedesktop.DBus serial=157 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=GetConnectionUnixProcessID string “:1.159”

method return time=1648073008.020221 sender=org.freedesktop.DBus -> destination=:1.45 serial=100 reply_serial=157 uint32 5398

error time=1648073008.020525 sender=:1.45 -> destination=:1.159

error_name=org.freedesktop.DBus.Error.AccessDenied reply_serial=29 string “Portal operation not allowed: Unable to open /proc/5398/root”

@jamesh or @kenvandine do you know what the root cause for this could be?

I encountered the same problem on Kubuntu 18.04.

The backend error shows in the system logs was:

Can't open portal file chooser: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.portal.Desktop was not provided by any .service files

I resolved the problem by installing xdg-desktop-portal from the system repos.

We need to think of a comprehensive solution going forward.

I verified that xdg-desktop-portal was installed on the system, so that isn’t the problem we are facing unfortunately.

It is not, it does not work for me on Ubuntu 22.04, but all the KDE neon using snaps I tried do, even okular which has complications on kubuntu.

Do you mind sharing an example project yaml using the core20 sdk?

Now I’m also getting users with this error:

ERROR: not connected to the kde-frameworks-5-qt-5-15-3-core20 content interface.

This appears to occur when the snap auto updates on some machines. A complete uninstall reinstall fixes it.

I still have not figured out how to get this to work. Anyone have any ideas on what to try?

Maybe https://snapcraft.io/umbrello (candidate has the latest content snap from kde, stable the previous one)

With the snapcraft.yaml on https://invent.kde.org/packaging/snapcraft-kde-applications/-/blob/Neon/release/umbrello/snapcraft.yaml

All kde published applications are on https://invent.kde.org/packaging/snapcraft-kde-applications

1 Like

I think @jriddell does a lot with KDE’s snaps. I wonder if he could take a look?

Same problem here. I am on Backbox Linux 7 which is based on Ubuntu 20.04. Version 2.6.6 worked just fine on snap, however after updating to the latest version, I encountered this problem.

KeePassXC - Version 2.7.0 Revision: 20c9ac1 Distribution: Snap Qt 5.15.3 Debugging mode is disabled. Operating system: Ubuntu Core 20 CPU architecture: x86_64 Kernel: linux 5.4.0-105-generic

You also need a backend (xdg-desktop-portal-gtk/xdg-desktop-portal-kde)

Any other ideas? This is on 21.10 live boot CD, nothing but keepassxc installed after boot.

Check D-Bus messages between the application and xdg-desktop-portal with Bustle

Same error as reported above:

The same problem with 22.04 live boot.

Looking into this issue, it seems to come down to the fact that the folder /run/$PID/root isn’t being correctly mounted. In every other snap I’ve tested locally, this shows the view of the containers mount namespace. However for KeepassXC for whatever reason, this link is never created.

I’d expect, the XDG portals are using this to try bridge the gap between host environment and snap environment and erroring out as a result. Is there anyone on the snapd team who could evaluate this under that light?

Having looked at the DBus messages being produced from KeepassXC, there aren’t any problems there.

Edit: /var/[PID]/root is not “missing”, it’s just only readable by root, unlike the other snaps.