usage: event_rpcgen.py [options] rpc-file [[h-file] c-file]
event_rpcgen.py: error: the following arguments are required: rpc_file
This is the previous output before I added qtwebengine:
However, when I try to run it, I get this error:
user@tumbleweed:~/flatpak-builder> flatpak run com.infomaniak.kdrive
kDrive server starting
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
_IceTransSocketUNIXConnect: Cannot connect to non-local host localhost.localdomain
_IceTransSocketUNIXConnect: Cannot connect to non-local host localhost.localdomain
Qt: Session management error: Could not open network socket
kDrive server initialization error: Unable to open parameters database.
This is my manifest (note - edited since first posted here):
Thank you. I now replaced --socket=x11 with --socket=fallback-x11 (or am I meant to have both?) and I also removed qtwebengine as the base-app to get rid of that rcp_file error.
It still doesn’t run though:
kDrive server starting
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb.
Server stoped with signal 6
user@tumbleweed:~/flatpak-builder> flatpak run com.infomaniak.kdrive
kDrive server starting
kDrive server initialization error: Unable to open parameters database.
after making these changes in the manifest:
- --socket=x11
- --socket=fallback-x11
- --env=XDG_SESSION_TYPE=x11 # otherwise get errors relating to qt.qpa.plugin and qt.qpa.xcb
- --env=QT_QPA_PLATFORM=xcb # otherwise get errors relating to qt.qpa.plugin and qt.qpa.xcb
- --unset-env=WAYLAND_DISPLAY # otherwise get errors relating to qt.qpa.plugin and qt.qpa.xcb
- --unset-env=SESSION_MANAGER # otherwise get "Qt Session management error: Could not open network socket"
Another comment. I have the “normal” AppImage version of kDrive running. I had a look in the logs and it referenced a few file paths:
New DB exists : /home/user/.config/kDrive/.parms.db => 1
Old config exists : /home/user/.config/kDrive/kDrive.cfg => 0
Adding extra plugin search path:/usr/lib/x86_64-linux-gnu/kDrive/plugins
Server started, listening at /run/user/1000/kDrive/socket
(btw the third one doesn’t actually exist)
Do I need to add anything to the manifest finish-args? I thought filesystem=home should be enough…
I made progress with my Flatpak by copying the sync-exclude.lst to the root of the appimage folder. I now manage to start kDrive but I get this error:
user@fedora:~/flatpak$ flatpak run com.infomaniak.kdrive
kDrive server starting
(process:3): GLib-GObject-CRITICAL **: 13:23:13.440: type_add_flags_W: assertion '(flags & ~TYPE_FLAG_MASK) == 0' failed
/app/kdrive/usr/lib/libgnutls.so.30: version `GNUTLS_3_7_4' not found (required by /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so)
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
(process:3): GLib-GObject-CRITICAL **: 13:23:13.440: type_add_flags_W: assertion '(flags & ~TYPE_FLAG_MASK) == 0' failed
and the kDrive window just shows a message “This site can’t be reached” “ERR_CERT_AUTHORITY_INVALID” (I think it’s uses QtWebEngine or another webview implementation to get to the login page).
I tried that by adding - rm squashfs-root/usr/lib/libgnutls.so.30 to the manifest built-commands, but it’s still the same error as before.
The KDE runtime seems to include a libgnutls.so.30 (the same file I’m deleting from the Appimage) as well as a libgio-2.0.so.0 but I don’t think there’s a libgiognutls.so that’s references in the error code.
The error still looks like this:
user@fedora:~/flatpak$ flatpak run com.infomaniak.kdrive
kDrive server starting
(process:3): GLib-GObject-CRITICAL **: 14:39:37.051: type_add_flags_W: assertion '(flags & ~TYPE_FLAG_MASK) == 0' failed
/app/kdrive/usr/bin/../lib/libgnutls.so.30: version `GNUTLS_3_7_4' not found (required by /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so)
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgiognutls.so
(process:3): GLib-GObject-CRITICAL **: 14:39:37.052: type_add_flags_W: assertion '(flags & ~TYPE_FLAG_MASK) == 0' failed
This is my current manifest:
app-id: com.infomaniak.kdrive
runtime: org.kde.Platform
runtime-version: 5.15-23.08
sdk: org.kde.Sdk
command: start-kdrive-flatpak.sh
finish-args:
- --device=dri
- --socket=x11 # if using wayland, even with fallback-x11, you get "could not connect to display" errors
- --env=XDG_SESSION_TYPE=x11 # otherwise get "could not connect to display" errors
- --env=QT_QPA_PLATFORM=xcb # otherwise get "could not connect to display" errors
- --unset-env=WAYLAND_DISPLAY # otherwise get "could not connect to display" errors
- --unset-env=SESSION_MANAGER # otherwise get "Qt Session management error Could not open network socket"
- --share=network
- --share=ipc
- --filesystem=home
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.secrets
- --talk-name=org.kde.StatusNotifierWatcher
- --talk-name=org.kde.kwalletd5
modules:
- name: kdrive
buildsystem: simple
build-commands:
# Extract the Appimage
- chmod a+x kDrive.AppImage
- ./kDrive.AppImage --appimage-extract >/dev/null
- chmod -R --reference=kDrive.AppImage squashfs-root
- rm ./kDrive.AppImage
# Patch .desktop file with the new icon and binary location
- sed -i -e 's/Icon.*/Icon=com.infomaniak.kdrive/' squashfs-root/kDrive_client.desktop
- sed -i -e 's/Exec.*/Exec=start-kdrive-flatpak.sh %F/' squashfs-root/kDrive_client.desktop
# Move things into place
- cp squashfs-root/usr/bin/sync-exclude.lst squashfs-root/sync-exclude.lst # otherwise kDrive won't start
- rm squashfs-root/usr/lib/libgnutls.so.30
- mkdir /app/kdrive
- cp -r squashfs-root/* /app/kdrive
- install -Dm644 squashfs-root/kDrive_client.desktop /app/share/applications/com.infomaniak.kdrive.desktop
- |
for s in 16 32 48 64 128 256 512; do
install -Dm644 squashfs-root/usr/share/icons/hicolor/${s}x${s}/apps/kdrive-win.png /app/share/icons/hicolor/${s}x${s}/apps/com.infomaniak.kdrive.png
done
- install -Dm644 com.infomaniak.kdrive.appdata.xml /app/share/appdata/com.infomaniak.kdrive.appdata.xml
- install -Dm544 start-kdrive-flatpak.sh /app/bin/start-kdrive-flatpak.sh
sources:
- type: file
url: https://download.storage.infomaniak.com/drive/desktopclient/kDrive-3.5.7.20240124-amd64.AppImage
sha256: ab99aa9252d9e7c613d2a4247d368a6369926062b54ad7ddbb1ab36f1d591d4b
only-arches:
- x86_64
dest-filename: kDrive.AppImage
- type: file
url: https://download.storage.infomaniak.com/drive/desktopclient/kDrive-3.5.7.20240124-arm64.AppImage
sha256: 894f7544bfe302d747dd77d0769f69889e0bee6f1e6dbdce1c3410bd864519f3
only-arches:
- aarch64
dest-filename: kDrive.AppImage
- type: file
path: com.infomaniak.kdrive.appdata.xml
- type: script
dest-filename: start-kdrive-flatpak.sh
commands:
- /app/kdrive/AppRun "$@"
# potentially add some kind of update checking here
Very interesting. It does work in a Ubuntu 22.04 VM, for some reason.
However, when I actually try to log in, I get an error called “Token request failed: Failed to write authentification token into keychain” in the kDrive app. What could be the reason for this? Is - --talk-name=org.freedesktop.secrets not enough?
edit:
I tried adding some stuff copied from the Nextcloud YAML (because both Nextcloud and kDrive are forks of Owncloud):
Ok, I figured it out. I needed at add --filesystem=xdg-run/keyring
Now it runs and syncs Very good!
Although in my Ubuntu VM I can’t click on the tray icon, no idea if this is a Flatpak issue or GNOME issue.
edit: and I tried it in openSUSE Kalpa (KDE desktop) but the app doesn’t appear at all. No window, no tray icon. The console just says kDrive servers starting and then nothing.