I am having a similar problem. I only noticed this problem, however, after upgrading my ubuntu system from 20.04 LTS to 22.04 LTS. After that upgrade, the process “/usr/bin/nextcloud” is using 100% of a single core.
It is hard to provide details, however, when there aren’t any log entries to provide. Syslog shows this related to nextcloud on the client:
Aug 6 07:14:34 calm com.nextcloud.desktopclient.nextcloud.desktop: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Aug 6 07:14:35 calm com.nextcloud.desktopclient.nextcloud.desktop: Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing.
Aug 6 07:14:35 calm com.nextcloud.desktopclient.nextcloud.desktop: nextcloud.gui.application: Already running, exiting…
I used tcpdump on the server to identify any traffic coming from the client while the “/usr/bin/nextcloud” app is running at 100%, and there was no traffic coming from the client in question, using ip address to filter.
I looked in /var/www/[hostname]/nextcloud/data/nextcloud.log, and found no entries for the time frame in question.
The most recent log entry in https://[hostname]/index.php/settings/admin/logging is from 2 days ago. There is nothing recent.
After killing the automatically started nextcloud process, I restarted from the desktop launcher. The icon in the top bar appears and shows a green check as expected when everything is sync’d. However, it goes right back to taking 100% of a single core. The “Open main dialog” from the drop down menu does nothing. The “Pause sync” option from the same menu does nothing. The “Settings” option from the drop down menu does nothing. The “Exit Nextcloud” option from the menu does nothing. Basically the nextcloud app doesn’t appear to be doing anything while taking up so much CPU … just spinning its wheels.
What other details can I provide to help resolve this?
I had previously wanted to avoid the nuclear option, but I ended up doing it.
I removed related files from ~/.local and ~/.config. I ran apt remove --purge on all nextcloud packages and apt autoremove --purge for good measure. I also removed my ~/Nextcloud directory. I rebooted, and re-installed this one app (which auto-installed a few others):
I went through the initial setup and let it “sync”, or download my entire 12GB (not sure how much my hosting provider will charge me for that). During that time the CPU usage for the nextcloud app did not exhibit the same behavior. It fluctuated between 51% and 133% (multiple processes were spawned which is also different than before). After it was finished with the initial sync, I rebooted again. The nextcloud app started up automatically as expected. It is no longer using 100% of a single core spinning its wheels. The problem appears to have disappeared.
My take away from this is that Nextcloud doesn’t auto upgrade with Ubuntu. It needs to be uninstalled and re-installed if the OS is upgraded. But beware, initially I tried a simple uninstall and re-install without removing local files and I still had the same problem. I needed to remove all nextcloud files from .local, .config, and the repo directory. The --purge option for apt or dpkg did not purge my local config files in my home directory or the repo directory. That had to be done manually, otherwise the problem persisted.
From the sounds of it you’re both using distribution packages, not official NC binaries. If you’re going to do that, might be worth at least using the PPA so you maintain an up-to-date client version (even on Jammy/LTS):
Otherwise you’re stuck on v3.4.2 which is very old. You can see the changes since:
Eventually the high CPU utilization came back. Thank you for the suggestion. I tried the PPA. I also tried a fresh install of Ubuntu and the PPA. I still had the same problem. Nothing in logs, as above.
I have also switched from Ubuntu to the latest Debian (bookworm), fresh install on a formatted drive, minimal other apps. I was unable to find a similar PPA for Debian, but I did find a newer package that was part of the Debian distribution and used that because I prefer being able to upgrade packages rather than have to do all the manual work of installing every time I need to upgrade. In any case, Debian appears to be on 3.7.3, which isn’t the latest, but is newer than the Ubuntu package.
I have made no changes to the files in the Nextcloud directory either on the server or on the client, meaning it shouldn’t have anything that it needs to sync. The “/usr/bin/nextcloud” process is taking up 100% of a single core. It seems excessive, and exhibits the same behavior across different versions and with fresh installs of different linux distributions (admittedly similar distributions, but still different binaries).
At present, it seems that installing the nextcloud client means that you lose a CPU core. Any ideas on what to try next?
I tried starting nextcloud from the command line and found this error:
“QSocketNotifier: Can only be used with threads started with QThread”
After starting manually, a popup window appeared with this information:
“Nextcloud Desktop” is not responding.
You may choose to wait a short while for it to continue or force the application to quit entirely.
The popup lets me force quit or wait.
The window in the background shows that it is trying to sync file 3 of 5. It says 3.3kB of 2.3 MB - 0 second(s) left.
Another restart from the command line shows that it is trying to sync, but just shows “Syncing” next to the spinning icon without those details. In all cases, the popup showing that Nextcloud isn’t responding shows up.
A third start shows that unlike the 2nd time, it was able to make some sort of progress syncing… but then after seconds (very short amount of time), it stops with a similar message 406 kB of 517 kB - 0 second(s) left. Then it is frozen.
Given that nothing has changed in the Nextcloud directory for quite a while I suspect that a few seconds after starting up, nextcloud stops actually doing any work and just spins its wheels taking up 100% of a single core indefinitely until it is killed.
For good measure, I started from the command line a 4th time and it behaved identically to the second time … making NO progress, just showing “Syncing” with the spinning icon next to it. As before whenever I try to click inside the nextcloud window or move the window the error about not responding immediately shows up.
Does the QThread error on the command line make a difference? Is there an additional library to install?