Xubuntu 18.04 Desktop client not starting (without kicking it repeatedly)

Hi,

I have had my Box working for quite a long time and its great, but…

I have always had trouble with the Desktop client not starting:

I have to start it, then open browser (I use Firefox) and open nextcloud via ubuntu-standard.local and mydomain.com, then close the browser pages, click on the Nextcloud client and it finally opens
I dont know if all the above is required but it more or less works like that
(Edit- I just had to try to open it many times after doing my Firefox thing, so it might just be a red herring)

After it opens all is absolutely fine,

Also, ticking ‘Launch on System startup’ does put an entry in my Xubuntu startup thingy but Nextcloud client doesnt start with the system

Now I am on 18.04 Xubuntu, but I had similar probs on 16.04

I installed the client via ppa:nextcloud-devs/client
Its version 2.3.3

I know this might be a Desktop client problem (so I moved this post) but I also think it could be something about the way my Box is set up
I am a ‘low tech level’ user by the way

I have the desktop client set up connected with ‘ubuntu-standard.local’ as I figured this would keep it ‘internal’ wrt my network and be quicker to sync than using ‘mydomain.com’ (I could well be wrong here :slight_smile: )

When I open ubuntu-standard.local in my browser it tells me that connection not secure and I have to make a security exception

I have the following in my config.php:

'trusted_domains' => 
  array (
    0 => 'ubuntu-standard.local',
    2 => 'mydomain.com',
  ),

So, my questions are:

  1. Is this difficulty in starting up my Linux client likely to be because of this security certificate?
  2. If not, any ideas what is?
  3. If so, how could I fix this?
  4. Should I change the connection in the client to ‘mydomain.com’ ? will this reduce sync performance?
  5. Any other thoughts &/or advice?

Any help most gratefully received

Leigh

1/2/3 I wouldn’t think so, the application would need to start before it even has a chance to attempt the connection. I’ve had similar problems with this using Xubuntu 16.04, and what solved it for me was just setting a startup delay of 10 seconds on the Nextcloud client.
4 It doesn’t matter if you will only ever connect that client within your network. You could even go by IP just to rule out DNS problems, but again that shouldn’t affect the startup behavior. Just be sure to add Nextcloud’s IP to the list of trusted domains. By the way, it probably doesn’t matter but I would be careful to add trusted domains in sequence (you skipped number 1).
5 Let’s Encrypt provides free security certificates and it couldn’t be easier to install. I suggest using that externally at least, and if you set up DNS internally you could use it there as well, if you’re still concerned about certificates.

Thanks!
Since you said that it wouldn’t be any slower I changed from ubuntu-standard.local to mydomain.com and it now appears to work :smile:

Re 10 second delay - I will now try this with start at start up but cant find how to include a 10 second delay in the Xubuntu ‘Session & Startup’ - there is no option for this when I try to edit the Nextcloud entry - could you tell me how you did this (must be very similar in 16.04 and 18.04)

Edit: It seems it is running on startup but without a notification icon?

ps -ef | grep nextcloud
leigh     1261  1238  2 09:27 ?        00:00:04 nextcloud

But when I start it manually and the icon appears it starts to sync, so maybe running on startup but not doing anything?

Thanks again!

I think that’s the issue that you work around by adding the startup delay. Something to do with the timing of the notification panel loading up before starting Nextcloud. If it starts too soon, the notification panel doesn’t display the icon.

Adding the delay is easy: for the command in the Nextcloud startup entry, instead of “nextcloud” (or whatever you have in there), change that to “sleep 10 && nextcloud”

You can experiment with longer delays too, depending on your system. There’s nothing magic about the number 10 :wink:

Thanks,

I put in a delay of 100 s and it still doesnt start - it also doesnt start when I start from command well after start up

Also, I think my ‘method’ above doesnt work

I must say I am confused!

Bummer! Have you looked at this:https://github.com/nextcloud/client_theming/issues/175

When I get a chance I’m planning on setting up a VM with Xubuntu 18.04 and installing the client from the PPA to see what happens. If I can reproduce the problem, maybe I can also figure out how to get it working.

Followed that link

No version of that in bionic but I found Xenial version here
https://packages.ubuntu.com/xenial/libqt5keychain0

but when I installed that it completely broke the nextcloud-client instalation and I hade to purge libqt5keychain0 and reinstall nextcloud.

Back to the drawing board :slight_smile:

Hm… I installed Xubuntu 18.04 (64 bit) fresh in a VM, did apt update and apt upgrade, and then installed nextcloud-client from the ppa you mentioned above:

sudo apt-add-repository ppa:nextcloud-devs/client
sudo apt update && sudo apt install nextcloud-client

Upon opening the client, attaching to a test account, and checking the “Launch on system startup” option, it works every time when I reboot.

Running sudo apt-cache showpkg nextcloud-client shows that it nextcloud-client depends on libqt5keychain1, which should have been installed as part of the nextcloud-client installation. Can you check to see if that is installed on your machine?

libqt5keychain1 is already the newest version (0.7.0-3).

The thing is, it isnt starting at startup or when I try to do it manually via menu or terminal

That is, no icon appears, but I do get:

ps -ef | grep nextcloud
leigh     1280  1254  1 17:14 ?        00:00:00 /usr/bin/nextcloud

Eventually it will start but varies in how long and no idea what I do or changes to make it finally start

And then when I finally get it running it works fine

I’m not sure what else to check for. In my case that version of the Nextcloud client works on my machine in Xubuntu 16.04, and in my test VM with Xubuntu 18.04. There could be an external factor causing such a long delay in the client starting. Maybe check the health of your hard drive to start.

You could also submit a bug on Github and see if the developers could help you troubleshoot further.

Thanks Eric,

I removed all the folder sync connections so it was just my account and the client stated on system startup :slight_smile:
That must mean its something to do with my sync folders?
two are on an external disk that mounts automatically, one on a different partition on the laptop
I will investigate further, to see which ones are problematic

Interesting. So basically it’s starting in the background, trying to make all the connections, and then eventually it displays the icon in the notification area.

I can understand having a delay when connecting to external folders.

Well I learned something new today :slight_smile:

Well, I think that this may be a problem with more than one cause, although I am not sure.

I have now added the folder sync connection for the partition on the laptop hard disk and the client started at system startup :slight_smile:
BUT, when I rebooted it didn’t do it again, nor for the subsequent reboots I tried. :frowning:

However, it does seem that a manual start of the client now works, at least for the three times I have tried …

I have no delay at startup on the client yet tho, so will try this next.

Edit: tried with sleep 30 && usr/bin/nextcloud but client did not start at startup. Client did start manually tho.

What about the option ‘Show Desktop Notifications’ in the client? This is selected, but if I deselect it then the notification icon does not disappear. Also, If I deselect this option and restart laptop and then start the client it opens with a notification icon.

So I appear to have two problems:

  1. Lack of client autostart at laptop startup:
    Sleep delay didnt work.
    But client starts manually with only laptop partition sync folder
    (‘mnt/DATA’, LABEL=DATA’ ‘mount at system startup’)

  2. Difficulty starting client manually:
    This is only when I have my external disk sync folders added
    (‘mnt/Red 1TB’, LABEL=Red 1TB’ ‘mount at system startup’)
    Could this have anything to do with the space in the label Red 1TB’? (I don’t want to change this as this is where I keep most of my data, and so many things depend on the path)

At this point it’s probably worth putting all this information into an issue on Github and having the developers look at it. https://github.com/nextcloud/client/issues

Right - I at least sorted what I need to do to start it manually:

  1. start from menu, no icon but nextcloud process runnning
  2. wait approx 3 minutes, when the process is ended / no longer running (no idea what stops it)
  3. start from menu and icon appears and client runs as expected

I opened an issue on Github

Client now crashes and will not open
If opened from terminal gives Aborted (core dumped)

I took tflidd’s advice about a log file in this thread

And the last lines of the log file were as below - anybody give me an idea of what is happening / what I could do?

05-31 21:04:52:512 7527 OCC::FolderMan::addFolderInternal: Adding folder to Folder Map  OCC::Folder(0x55e300cb5960) "3"
05-31 21:04:52:512 7527 OCC::FolderWatcherPrivate::slotAddFolderRecursive: (+) Watcher: "/mnt/Red 1TB/Work/"
05-31 21:04:53:991 7527 OCC::FolderWatcherPrivate::slotAddFolderRecursive:     `-> and 5759 subdirectories
05-31 21:04:53:991 7527 OCC::FolderMan::scheduleFolder: Schedule folder  "3"  to sync!
05-31 21:04:53:991 7527 OCC::FolderMan::scheduleFolder: Folder is not ready to sync, not scheduled!
05-31 21:04:53:991 7527 OCC::ClientProxy::setupQtProxyFromConfig: Set proxy configuration to use system configuration
05-31 21:04:54:003 7527 OCC::ActivitySettings::setNotificationRefreshInterval: Starting Notification refresh timer with  300  sec interval
05-31 21:04:54:148 7527 OCC::Updater::getSystemInfo: Sys Info size:  85
05-31 21:04:54:293 7527 OCC::SqlQuery::prepare: Sqlite prepare statement error: "unable to open database file" in "PRAGMA quick_check;"
05-31 21:04:54:293 7527 OCC::SqlDatabase::checkDb: Error running quick_check on database
05-31 21:04:54:293 7527 OCC::SqlDatabase::openOrCreateReadWrite: Consistency check failed, removing broken db "/mnt/DATA/._sync_b233c4bbec31.db"
05-31 21:04:54:294 7527 OCC::SyncJournalDb::checkConnect: sqlite3 version "3.22.0"
05-31 21:04:54:294 7527 OCC::SqlQuery::prepare: Sqlite prepare statement error: "unable to open database file" in "PRAGMA journal_mode=WAL;"
05-31 21:04:54:294 7527 OCC::SqlQuery::prepare: ENFORCE: "allow_failure" in file /build/nextcloud-client-kwZp4Q/nextcloud-client-2.3.3/client/src/libsync/ownsql.cpp, line 233 with message: SQLITE Prepare error

It appears to be having trouble with the local database file getting corrupted. It sounds to me like there’s an issue with your hard drive, or if the folder you’re syncing is over a network share you may be having trouble with that network connection.

Thanks,

All the folders I am syncing are either on the laptop disk or on a USB external disk, none are on a network share, if that is what you mean.

And presumably you mean an issue with the box hard-drive?

Can I check the health of that?

How do I remove all trace of the client?

I have uninstalled via apt purge, but when I reinstall the client it still remembers all my synced folders etc.

Presumably it isn’t deleting the local database file either when I purge?

I think maybe a complete reinstallation on the box might be in order?

The only thing is that I have 550 GB data and it takes days to upload to the box

(However, I could also put in a RPi3 that I have spare instead of the current RPi2)

Thanks again

Actually I’m suggesting you check both the laptop disk and the external drive health. The local database file which keeps track of which files/folders are synced, changed, etc. is stored in the root path of each folder you sync. If that file is getting corrupted, I would tend to start by checking the health of the drive on which it’s stored, just in case.
I usually start with gnome-disk-utility (called Disks in the start menu) to check the SMART status.
sudo apt install gnome-disk-utility

You can also run fsck or other tools to do more in depth scanning.

Thanks,
The laptop disk was all OK,
the SMART option is not available for the external disk (because it is NTFS?) - any ideas on how to check this?
Can I just manually delete the ._sync…db files?