Nextcloud Client Does not auto-start in Gnome3

Hey,

I’m using nixos 24.05 with flakes and home-manager and the nextcloud client does not autostart under Gnome3. However this previously worked fine when using kde/plama6

In my home.nix I have:

services.nextcloud-client = {                                             
   enable = true;
   startInBackground = false;   # Also tried true
}; 

When running home-manager switch you get the following error:

The user systemd session is degraded:
  UNIT                     LOAD   ACTIVE SUB    DESCRIPTION     
● nextcloud-client.service loaded failed failed Nextcloud Client

If I manually run /nix/store/6apw9fyil1ym5amdwm8lyawdi0apir3n-nextcloud-client-3.13.0/bin/nextcloud & then client happily runs and sync’s etc however this command will no doubt change in the future. I also don’t see a nextcloud application in the gnome app draw, should I?

Am I doing something wrong / missing something? Whats the best way to get the client to load on boot. Thanks.

1 Like

I don’t have a real fix but in the meantime you could just put the path to the nextcloud binary into the autostart config menu of your DE. At least Gnome and KDE offer such a menu explicitly, so it’s easy to do.

Alternatively writing a systemd unit for it might also work.

Either of these approaches has the downside of breaking on update of course, but at least your nextcloud should automatically start until the issue is fixed.

@jjpe thanks for the response. I will explore those options. I’m confused why it worked fine under kde/plasma. Would certainly be interested in a more permanent solution. Thanks

What does systemctl status --user nextcloud-client.service and journalctl --user -u nextcloud-client.service say after the failure?

@jtojnar Seems to be complaining about wayland, could it be a fallout from using kde?

Jun 04 14:41:12 nixos systemd[1562]: Started Nextcloud Client.
Jun 04 14:41:13 nixos nextcloud[1643]: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Jun 04 14:41:13 nixos nextcloud[1643]: qt.qpa.xcb: could not connect to display
Jun 04 14:41:13 nixos nextcloud[1643]: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
Jun 04 14:41:13 nixos nextcloud[1643]: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Jun 04 14:41:13 nixos nextcloud[1643]: Available platform plugins are: wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Jun 04 14:41:13 nixos systemd-coredump[1700]: [🡕] Process 1643 (.nextcloud-wrap) of user 1000 dumped core.

The systemd file looks good:

cat ~/.config/systemd/user/nextcloud-client.service                                                                    ─╯
[Install]
WantedBy=graphical-session.target

[Service]
Environment=PATH=/home/harv/.nix-profile/bin
ExecStart=/nix/store/6apw9fyil1ym5amdwm8lyawdi0apir3n-nextcloud-client-3.13.0/bin/nextcloud

[Unit]
After=graphical-session-pre.target
Description=Nextcloud Client
PartOf=graphical-session.target

Thanks

One easy way to find out if it’s related to Wayland is to restart your Plasma session with X rather than Wayland.

If the problem disappears, then you have both your answer and a new question :slight_smile:

That sounds like it starts too early. There was another issue where this was a problem: Failing to start xdg-desktop-portal-gnome after logging on Gnome · Issue #206630 · NixOS/nixpkgs · GitHub

But here the Nextcloud itself appears to be buggy, since it crashes:

Try getting a stack trace of the crash (coredumpctl gdb and then bt) and reporting it as an issue in Nixpkgs, mentioning nextcloud-client maintainers.

1 Like

@jtojnar that seemed to sort it! Thank you! The following now works, two reboots and it starts every time and application icon shows in the Gnome App tray:

#NEXTCLOUD
  services.nextcloud-client = {
    enable = true;
    #startInBackground = false;
  };
  systemd.user.services.nextcloud-client = {
    Unit = {
      After = pkgs.lib.mkForce "graphical-session.target"; 
    };
  };
2 Likes