Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting using desktop shortcut not working #20

Closed
bkhl opened this issue Sep 11, 2020 · 15 comments
Closed

Starting using desktop shortcut not working #20

bkhl opened this issue Sep 11, 2020 · 15 comments

Comments

@bkhl
Copy link

bkhl commented Sep 11, 2020

After the name change, as covered by #18 Nextcloud can't autostart, but also I'm not able to start it using the desktop shortcut.

Using Gnome-Shell, (Fedora 32 Silverblue), I see it in the application list and I expect this is from the .desktop file at /var/lib/flatpak/app/com.nextcloud.desktopclient.nextcloud/current/active/files/share/applications/com.nextcloud.desktopclient.nextcloud.desktop. However, starting this doesn't visibly do anything, and checking afterwords with ps I can't find any processes that look like Nextcloud.

The only way I've found to start it for now is

/usr/bin/flatpak run com.nextcloud.desktopclient.nextcloud

This however doesn't work every time, usually I have to try 2-3 times before it works.

Other times, it says

QSocketNotifier: Can only be used with threads started with QThread
nextcloud.gui.application: Already running, exiting...

and then hangs there.

@Zlopez
Copy link

Zlopez commented Sep 24, 2020

I can confirm this is also happening on Fedora 33 Silverblue.

@Zlopez
Copy link

Zlopez commented Sep 25, 2020

I usually see:

QSocketNotifier: Can only be used with threads started with QThread
2020-09-25 14:49:21:136 [ debug default ]       [ unknown ]:    static bool LibSecretKeyring::findPassword(const QString&, const QString&, QKeychain::JobPrivate*)

and then it just hangs.

@Zlopez Zlopez mentioned this issue Sep 25, 2020
@Zlopez
Copy link

Zlopez commented Sep 29, 2020

This started happening on another machine today, it looks like the latest update of the KDE runtime is causing this.

@Zlopez
Copy link

Zlopez commented Sep 29, 2020

I reported this issue on the KDE runtime issue tracker https://invent.kde.org/packaging/flatpak-kde-runtime/-/issues/14

@tilosp
Copy link
Collaborator

tilosp commented Sep 30, 2020

@bkhl does /var/lib/flatpak/exports/share/applications/com.nextcloud.desktopclient.nextcloud.desktop exists, and if so what is Exec= set to inside the file.

@bkhl
Copy link
Author

bkhl commented Oct 1, 2020

It exists and looks like this (excluding translation entries):

[Desktop Entry]
Categories=Utility;X-SuSE-SyncUtility;
Type=Application
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud
Name=Nextcloud desktop sync client 
Comment=Nextcloud desktop synchronization client
GenericName=Folder Sync
Icon=com.nextcloud.desktopclient.nextcloud
Keywords=Nextcloud;syncing;file;sharing;
X-GNOME-Autostart-Delay=3
X-Flatpak=com.nextcloud.desktopclient.nextcloud
X-Flatpak-RenamedFrom=org.nextcloud.Nextcloud.desktop;

To check this I had to install com.nextcloud.desktopclient.nextcloud again (had rolled back to the org.nextcloud.Nextcloud package in order to be able to use it).

The first time I ran that command in a shell the client started, and the terminal showed this:

$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud
QSocketNotifier: Can only be used with threads started with QThread
2020-10-01 09:30:33:842 [ debug default ]	[ unknown ]:	static bool LibSecretKeyring::findPassword(const QString&, const QString&, QKeychain::JobPrivate*)
[2:22:1001/093034.079876:ERROR:address_tracker_linux.cc(201)] Could not bind NETLINK socket: Address already in use (98)
2020-10-01 09:30:34:090 [ debug default ]	[ unknown ]:	Use of deprecated not thread-safe setter, use setUrlRequestInterceptor instead.

However, after quitting that and running the command again, I get this:

$ /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=nextcloud com.nextcloud.desktopclient.nextcloud
QSocketNotifier: Can only be used with threads started with QThread
2020-10-01 09:35:11:490 [ debug default ]	[ unknown ]:	static bool LibSecretKeyring::findPassword(const QString&, const QString&, QKeychain::JobPrivate*)

and there it hangs showing no window or tray icon.

I tried deleting my .var/app/com.nextcloud.desktopclient.nextcloud/ and starting it again, and that seems to sometimes work (with the output from the first example), or sometimes hang (like in the second). I have not been able to figure out why it works randomly. I've checked that it's not some process hanging about, to the best of my ability.

@tilosp
Copy link
Collaborator

tilosp commented Oct 1, 2020

I think not showing a window is expected behaviour, the problem/bug seems to be the tray icon not showing up.
Which extension are you using for tray icons, and are you running any other flatpaks with tray icons?

@Zlopez
Copy link

Zlopez commented Oct 1, 2020

@tilosp If only the tray icon is not shown than everything would be fine, but the folders are not synchronized. So it's not running at all, at least for me.

But to answer your question, I'm running telegram and steam flatpak and both show tray icon just fine. I'm using https://github.com/ubuntu/gnome-shell-extension-appindicator for the tray icons.

@Zlopez
Copy link

Zlopez commented Oct 1, 2020

strace.log
Here is the strace log from command strace flatpak run com.nextcloud.desktopclient.nextcloud

I don't see anything really strange, but I hope it helps.

@Zlopez
Copy link

Zlopez commented Oct 8, 2020

Issue still persist, sometimes the application works, but most of the time it doesn't start and just hangs as you can see from the strace.

@Ezwen
Copy link

Ezwen commented Oct 9, 2020

Same problems here with a freshly installed Fedora 33.

@bkhl
Copy link
Author

bkhl commented Nov 21, 2020

I think not showing a window is expected behaviour, the problem/bug seems to be the tray icon not showing up.
Which extension are you using for tray icons, and are you running any other flatpaks with tray icons?

I tried updating again today but get the same behaviour. To answer this question, I'm using the Appindicator and KStatusNotifier Support extensions, and I use that daily with no problem with the Vorta Flatpak, and also with the older org.nextcloud.Nextcloud Flatpak, which I'll be rolling back to again now.

That said, the issue is not just that the tray icon is not showing up. The application actually freezes on startup, and does not connect to the Nextcloud instance. As others have mentioned, it seems to start occassionally. Trying a few times it seems I need to try 10-30 times to get it to start up. When it starts, the tray icon is working fine.

I have been testing with or without these overrides (which I need for the older version to work), with same results:

[Session Bus Policy]
org.kde.*=own

[Environment]
TMPDIR=/var/tmp

@bkhl
Copy link
Author

bkhl commented Dec 9, 2020

Same problems here with a freshly installed Fedora 33.

I also tried the 3.0.3 version from the beta channel after upgrading to Fedora 33 and see the same issue.

@Zlopez
Copy link

Zlopez commented Jan 12, 2021

If anybody is still bothered by this bug, I wrote a small script that is just trying to start the nextcloud till there are more than 2 lines in output. Just save it to start_nextcloud.sh and run it by bash start_nextcloud.sh.

!/bin/bash

temp_out=/tmp/nextcloud.out
cnt=1

echo "Starting nextcloud flatpak attempt number: $cnt ..."
flatpak run com.nextcloud.desktopclient.nextcloud &>$temp_out &

sleep 3
lines_cnt=`wc -l $temp_out | cut -d " " -f 1`

while [ $lines_cnt -lt 3 ] 
do
  echo "Not started yet. Killing it ..."
  kill `pidof nextcloud`
  echo "Killed"
  cnt=$(( $cnt + 1 ))

  echo "Starting nextcloud flatpak attempt number: $cnt ..."
  flatpak run com.nextcloud.desktopclient.nextcloud &> $temp_out &
  sleep 3
  lines_cnt=`wc -l $temp_out | cut -d " " -f 1`
done

echo "Finally started. Number of attempts: $cnt"

@bkhl
Copy link
Author

bkhl commented Feb 6, 2021

I tried today to upgrade to 3.1.2 (#32), and this appears to have been fixed there.

Autostart also works with the following ~/.config/autostart/com.nextcloud.desktopclient.nextcloud.desktop:

[Desktop Entry]
Name=Nextcloud
GenericName=File Synchronizer
Exec=flatpak run com.nextcloud.desktopclient.nextcloud --background
Terminal=false
Icon=Nextcloud
Categories=Network
Type=Application
StartupNotify=false
X-GNOME-Autostart-enabled=true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants