nextcloud / desktop

💻 Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
3.06k stars 804 forks source link

Client automatically closes when starting #2414

Open weiw11 opened 4 years ago

weiw11 commented 4 years ago

Expected behaviour

Opening nextcloud client should open the client

Actual behaviour

Opening nextcloud client automatically closes the client without any error or messages.

Steps to reproduce

  1. Open nextcloud client
  2. Client automatically closes without any message

Client configuration

Client version: 3.0.1

Operating system: Windows

OS language: English

Installation path of client: C:\Program Files\Nextcloud

Logs

Please use Gist (https://gist.github.com/) or a similar code paster for longer logs.

  1. Client logfile:
    2020-09-14 00:49:44:246 [ info nextcloud.gui.application ]: "################## Nextcloud locale:[en_US] ui_lang:[] version:[3.0.1stable-Win64 (build 20200828)] os:[Windows 10 (10.0)]"
    2020-09-14 00:49:44:246 [ info nextcloud.gui.application ]: Using "en_US" translation
    2020-09-14 00:49:44:247 [ info nextcloud.gui.socketapi ]:   server started, listening at  "\\\\.\\pipe\\nextcloud-USER"
    2020-09-14 00:49:44:247 [ info nextcloud.gui.folder.manager ]:  setting remote poll timer interval to 30000 msec
    2020-09-14 00:49:44:258 [ info nextcloud.gui.account.manager ]: Account for QUrl("https://nextcloud.domain.com") using auth type "webflow"
    2020-09-14 00:49:44:258 [ info nextcloud.sync.credentials.webflow ]:    Get QNAM
    2020-09-14 00:49:44:611 [ warning nextcloud.sync.credentials.keychainchunk ]:   Unable to read "Nextcloud_proxy-password" chunk "0" "Password entry not found"
    2020-09-14 00:49:44:667 [ info nextcloud.gui.folder.manager ]:  Setup folders from settings file
    2020-09-14 00:49:44:671 [ info nextcloud.sync.database ]:   Detected filesystem "NTFS" for "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db"
    2020-09-14 00:49:44:672 [ info nextcloud.sync.configfile ]: Adding user defined ignore list to csync: "C:/Users/USER/AppData/Roaming/Nextcloud/sync-exclude.lst"
    2020-09-14 00:49:44:674 [ info nextcloud.gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x1550793d5f0) "1"
    2020-09-14 00:49:44:674 [ info nextcloud.gui.folder.manager ]:  Schedule folder  "1"  to sync!
    2020-09-14 00:49:44:674 [ info nextcloud.gui.folder.manager ]:  Folder is not ready to sync, not scheduled!
    2020-09-14 00:49:44:676 [ info nextcloud.gui.application ]: Sync state changed for folder  "https://nextcloud.domain.com/remote.php/webdav/Profile/Windows/Documents" :  "Not yet Started"
    2020-09-14 00:49:44:677 [ info nextcloud.sync.database ]:   Detected filesystem "NTFS" for "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db"
    2020-09-14 00:49:44:677 [ info nextcloud.sync.configfile ]: Adding user defined ignore list to csync: "C:/Users/USER/AppData/Roaming/Nextcloud/sync-exclude.lst"
    2020-09-14 00:49:44:679 [ info nextcloud.gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x1550793ed60) "2"
    2020-09-14 00:49:44:679 [ info nextcloud.gui.folder.manager ]:  Schedule folder  "2"  to sync!
    2020-09-14 00:49:44:679 [ info nextcloud.gui.folder.manager ]:  Folder is not ready to sync, not scheduled!
    2020-09-14 00:49:44:680 [ info nextcloud.gui.application ]: Sync state changed for folder  "https://nextcloud.domain.com/remote.php/webdav/Profile/Windows/Pictures" :  "Not yet Started"
    2020-09-14 00:49:44:680 [ info nextcloud.sync.database ]:   Detected filesystem "NTFS" for "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_e6ea746287aa.db-shm"
    2020-09-14 00:49:44:681 [ info nextcloud.sync.configfile ]: Adding user defined ignore list to csync: "C:/Users/USER/AppData/Roaming/Nextcloud/sync-exclude.lst"
    2020-09-14 00:49:44:683 [ info nextcloud.gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x15507949300) "4"
    2020-09-14 00:49:44:683 [ info nextcloud.gui.folder.manager ]:  Schedule folder  "4"  to sync!
    2020-09-14 00:49:44:683 [ info nextcloud.gui.folder.manager ]:  Folder is not ready to sync, not scheduled!
    2020-09-14 00:49:44:684 [ info nextcloud.gui.application ]: Sync state changed for folder  "https://nextcloud.domain.com/remote.php/webdav/" :  "Not yet Started"
    2020-09-14 00:49:44:684 [ info nextcloud.sync.database ]:   Detected filesystem "NTFS" for "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db-shm"
    2020-09-14 00:49:44:684 [ info nextcloud.sync.configfile ]: Adding user defined ignore list to csync: "C:/Users/USER/AppData/Roaming/Nextcloud/sync-exclude.lst"
    2020-09-14 00:49:44:686 [ info nextcloud.gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x15507947b90) "5"
    2020-09-14 00:49:44:686 [ info nextcloud.gui.folder.manager ]:  Schedule folder  "5"  to sync!
    2020-09-14 00:49:44:687 [ info nextcloud.gui.folder.manager ]:  Folder is not ready to sync, not scheduled!
    2020-09-14 00:49:44:687 [ info nextcloud.gui.application ]: Sync state changed for folder  "https://nextcloud.domain.com/remote.php/webdav/Profile/Windows/Pictures" :  "Not yet Started"
    2020-09-14 00:49:44:688 [ info nextcloud.sync.database ]:   Detected filesystem "NTFS" for "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db-shm"
    2020-09-14 00:49:44:688 [ info nextcloud.sync.configfile ]: Adding user defined ignore list to csync: "C:/Users/USER/AppData/Roaming/Nextcloud/sync-exclude.lst"
    2020-09-14 00:49:44:690 [ info nextcloud.gui.folder.manager ]:  Adding folder to Folder Map  OCC::Folder(0x155079473c0) "6"
    2020-09-14 00:49:44:690 [ info nextcloud.gui.folder.manager ]:  Schedule folder  "6"  to sync!
    2020-09-14 00:49:44:690 [ info nextcloud.gui.folder.manager ]:  Folder is not ready to sync, not scheduled!
    2020-09-14 00:49:44:691 [ info nextcloud.gui.application ]: Sync state changed for folder  "https://nextcloud.domain.com/remote.php/webdav/Profile/Windows/Documents" :  "Not yet Started"
    2020-09-14 00:49:44:695 [ info nextcloud.sync.database ]:   sqlite3 version "3.24.0"
    2020-09-14 00:49:44:695 [ info nextcloud.sync.database ]:   sqlite3 journal_mode= "wal"
    2020-09-14 00:49:44:700 [ info nextcloud.sync.database ]:   sqlite3 version "3.24.0"
    2020-09-14 00:49:44:700 [ info nextcloud.sync.database ]:   sqlite3 journal_mode= "wal"
    2020-09-14 00:49:44:705 [ info nextcloud.sync.database ]:   sqlite3 version "3.24.0"
    2020-09-14 00:49:44:705 [ info nextcloud.sync.database ]:   sqlite3 journal_mode= "wal"
    2020-09-14 00:49:44:708 [ warning nextcloud.sync.database.sql ]:    Sqlite prepare statement error: "file is not a database" in "PRAGMA quick_check;"
    2020-09-14 00:49:44:708 [ warning nextcloud.sync.database.sql ]:    Error preparing quick_check on database
    2020-09-14 00:49:44:708 [ critical nextcloud.sync.database.sql ]:   Consistency check failed, removing broken db "C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db-shm"
    2020-09-14 00:49:44:709 [ info nextcloud.sync.database ]:   sqlite3 version "3.24.0"
    2020-09-14 00:49:44:709 [ warning nextcloud.sync.database.sql ]:    Sqlite prepare statement error: "file is not a database" in "PRAGMA journal_mode=WAL;"
    2020-09-14 00:49:44:709 [ fatal default ]:  ENFORCE: "allow_failure" in file C:\Users\sysadmin\AppData\Local\Temp\2\windows-3354\client-building\desktop\src\common\ownsql.cpp, line 267 with message: SQLITE Prepare error
er-vin commented 4 years ago

Looks like something wrong happened in the past with your journal file, it seems like it's somehow corrupted. I'd say you could try quit the client and then remove all the "C:\Users\USER\AppData\Roaming\Nextcloud._sync_0d8d87f03b87.db*" files (not the other sync db file, just those).

Then start the client again. Expect a full sync to occur in the corresponding sync folder then, that will take some time. Better also do a backup of that sync folder just in case.

weiw11 commented 4 years ago

I had no issues prior to 3.0.1 and it was working fine after upgrading for a few days as well so I'm not exactly sure what happened. I also didn't change any settings on the client or the server aside from app updates.

I tried removing the Nextcloud._sync_0d8d87f03b87.db* files as shown below but the client still doesn't open. The error message is the same.

image

weiw11 commented 4 years ago

I managed to resolve the issue by deleting nextcloud.cfg.

Is the .cfg file suppose to contain certificate information?

New .cfg file

[General]
optionalServerNotifications=true
showInExplorerNavigationPane=false
updateSegment=3

[Accounts]
0\Folders\1\localPath=F:/Cloud/NextCloud/
version=2
0\Folders\1\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_e6ea746287aa.db
0\url=https://nextcloud.domain.com
0\Folders\1\targetPath=/
0\serverVersion=19.0.3.1
0\webflow_user=USER
0\Folders\1\paused=false
0\authType=webflow
0\Folders\1\ignoreHiddenFiles=false
0\Folders\1\navigationPaneClsid=@Variant()
0\Folders\2\localPath=C:/Users/USER/Documents/
0\Folders\3\localPath=C:/Users/USER/Pictures/
0\Folders\2\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db
0\Folders\3\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db
0\Folders\2\targetPath=/Profile/Windows/Documents
0\Folders\3\targetPath=/Profile/Windows/Pictures
0\user=@Invalid()
0\Folders\2\paused=false
0\Folders\3\paused=false
0\Folders\2\ignoreHiddenFiles=false
0\Folders\3\ignoreHiddenFiles=false

[LogBrowser]
geometry=@ByteArray()

[Settings]
geometry=@ByteArray()

Old .cfg file's 0\General\CaCertificates= line contains a bunch of certificate information which I removed due to size.

[General]
confirmExternalStorage=true
newBigFolderSizeLimit=500
optionalServerNotifications=true
useNewBigFolderSizeLimit=true
crashReporter=true
monoIcons=false
updateSegment=41
showInExplorerNavigationPane=true

[Accounts]
version=2
0\url=https://nextcloud.domain.com
0\serverVersion=19.0.3.1
0\user=@Invalid()
0\webflow_user=USER
0\authType=webflow
0\General\CaCertificates="@ByteArray(-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----\n\n-----BEGIN CERTIFICATE-----\n\n\n-----END CERTIFICATE-----\n\n-----BEGIN CERTIFICATE-----\\n-----END CERTIFICATE-----\n\n-----BEGIN CERTIFICATE-----\\n-----END CERTIFICATE-----\n\n)"
0\Folders\1\localPath=C:/Users/USER/Documents/
0\Folders\2\localPath=C:/Users/USER/Pictures/
0\Folders\4\localPath=F:/Cloud/NextCloud/
0\Multifolders\5\localPath=C:/Users/USER/Pictures/
0\Multifolders\6\localPath=C:/Users/USER/Documents/
0\Folders\1\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db
0\Folders\2\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db
0\Folders\4\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_e6ea746287aa.db-shm
0\Multifolders\5\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db-shm
0\Multifolders\6\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db-shm
0\Folders\1\targetPath=/Profile/Windows/Documents
0\Folders\2\targetPath=/Profile/Windows/Pictures
0\Folders\4\targetPath=/
0\Multifolders\5\targetPath=/Profile/Windows/Pictures
0\Multifolders\6\targetPath=/Profile/Windows/Documents
0\Folders\1\paused=false
0\Folders\2\paused=false
0\Folders\4\paused=false
0\Multifolders\5\paused=false
0\Multifolders\6\paused=false
0\Folders\1\ignoreHiddenFiles=false
0\Folders\2\ignoreHiddenFiles=false
0\Folders\4\ignoreHiddenFiles=false
0\Multifolders\5\ignoreHiddenFiles=false
0\Multifolders\6\ignoreHiddenFiles=false
0\Folders\1\navigationPaneClsid=@Variant()
0\Folders\2\navigationPaneClsid=@Variant()
0\Folders\4\navigationPaneClsid="@Variant()"
0\Multifolders\5\navigationPaneClsid=@Variant()
0\Multifolders\6\navigationPaneClsid=@Variant()

[Settings]
geometry=@ByteArray()

[SharingDialog]
geometry=@ByteArray()

[BWLimit]
downloadLimit=80
uploadLimit=10
useDownloadLimit=-1
useUploadLimit=-1

[Nextcloud]
autoUpdateCheck=false
er-vin commented 4 years ago

Is the .cfg file suppose to contain certificate information?

Yes. This happens when you get an SSL error for some reason and the client asks you if you want to trust the certificate or not anyway. If you say yes, then this approved certificate ends up in the cfg file.

What I find surprising is that it got nothing to do with the database. Are you sure this is related? There are other changes in the new cfg file, like the Multifolders setup which is not there anymore. This is legacy stuff from way way back, could be that somehow this backward compatibility got broken during 3.0 upgrade.

weiw11 commented 4 years ago

The client still automatically closed even when I deleted the .db files you mentioned previously.

I reinstalled the client and tried removing the db files again but the client persisted to automatically close, which led me to deleting the cfg file instead.

Deleting the .cfg file prompted the client to ask for the nextcloud setup instead of instantly closing. But even if this recreates new db files for the setup user, this should still be the same as manually deleting them. So unless there's some other information the client is retrieving from, I'm also not sure why deleting the cfg file resolves this despite the client producing database errors.

weiw11 commented 4 years ago

Removing the .cfg file also fixes https://github.com/nextcloud/desktop/issues/2406

tvjay commented 4 years ago

I too had no issues prior to 3.0.1 but after upgrading I could not launch the latest client on multiple computers. After deleting the .cfg file, they all started working again.

er-vin commented 4 years ago

OK, what would be interesting then is putting back your old cfg file and then removing only some bits in it and seeing if that fails. That'd help narrow down the search space. Just make sure that if you remove one key starting with "X\Multifolders\Y" or "X\Folders\Y" you then also remove all the other keys with the same start, they have to come and go together.

weiw11 commented 4 years ago

Deleting all of the X\Multifolders\Y resolved the crashing with the old .cfg file. Could it be a conflict with the X\Folders\Y lines as I believe they reference the same "sync" folder?

Following are the lines deleted:

0\Multifolders\5\navigationPaneClsid=@Variant(\0\0\0\x1e\x12\xce\xfe{\xd5\xe2\x46w\x94\x39Zd|\x17\xff^)
0\Multifolders\6\navigationPaneClsid=@Variant(\0\0\0\x1epBo\xed\xcf\x80\x43J\xbf\x31\xb9\xe2\xd0#\xa7\xa5)
0\Multifolders\5\ignoreHiddenFiles=false
0\Multifolders\6\ignoreHiddenFiles=false
0\Multifolders\5\paused=false
0\Multifolders\6\paused=false
0\Multifolders\5\targetPath=/Profile/Windows/Pictures
0\Multifolders\6\targetPath=/Profile/Windows/Documents
0\Multifolders\5\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_0d8d87f03b87.db-shm
0\Multifolders\6\journalPath=C:/Users/USER/AppData/Roaming/Nextcloud/._sync_fdcceaa95610.db-shm
0\Multifolders\5\localPath=C:/Users/USER/Pictures/
0\Multifolders\6\localPath=C:/Users/USER/Documents/
er-vin commented 4 years ago

OK, looks like the support for the old style config somehow got broken. Will need someone to investigate the code though.

rebelC0der commented 3 years ago

I have encountered this bug as well. Nextcloud client stopped working on my Linux/Manjaro system a week ago. I have tried all 3 client version from Manjaro repos and the official AppImage and all of them fail exactly the same way:

[jurisl@rebelCoderPC ~]$ nextcloud --version
Nextcloud version 3.0.3git
Git revision 78da725ac38e1508e5800d02fd1700a4e43b1088
Using Qt 5.15.2, built against Qt 5.15.1
Using Qt platform plugin 'xcb'
Using 'OpenSSL 1.1.1i  8 Dec 2020'
Running on Manjaro Linux, x86_64

[jurisl@rebelCoderPC ~]$ nextcloud
2021-01-13 18:05:04:274 [ fatal default ]:      ENFORCE: "allow_failure" in file /build/nextcloud-client/src/nextcloud-client/src/common/ownsql.cpp, line 267 with message: SQLITE Prepare error
Aborted (core dumped)

[jurisl@rebelCoderPC ~]$ /media/Work/\!_Tools/Nextcloud-3.1.1-x86_64.AppImage 
2021-01-13 18:05:15:192 [ fatal default ]:      ENFORCE: "allow_failure" in file /home/user/src/common/ownsql.cpp, line 265 with message: SQLITE Prepare error
Aborted (core dumped)
[jurisl@rebelCoderPC ~]$ 

Client on Debian Linux seems to work just fine.

sje30 commented 3 years ago

me too. manjaro linux user here; same "allow_failure" error leading to a core dump.

er-vin commented 3 years ago

Now that I think of it... Did you use our daily or the owncloud client with that sync folder by any chance? They both introduce changes to the db which break backward compatibility, you'd have such crash if you use an older client with that folder again.

sje30 commented 3 years ago

thank you, that might be it. I recently (a week or so ago) switched from owncloud to nextcloud on my laptop. will keep an eye out for this (crash hasn't happened again).

lsafd commented 3 years ago

I also had this issue after switching from the nextcloud-client-git package to the nextcloud-client package in the AUR. Same fix as described by er-vin

buhtz commented 3 years ago

Does this solve the problem?

3462

dtto commented 3 years ago

I just started having this issue after upgrading to the latest client (3.3.6). I am on Debian Bullseye. I tried downgrading to 3.3.5 but still have the same problem. I removed the corresponding .db files and restarted the client and it worked. Just reporting in case it is useful information.

lucasmr commented 2 years ago

Edit: I had the same problem, but the error was related with the compton window compositor. After changing to mate's default compositor, the client stopped crashing.

Xylon2 commented 2 years ago

On re-installing Debian to an older version, keeping same home directory, I had this error. Deleting nextcloud.cfg fixed it.

tvogt commented 1 year ago

Same problem, can confirm that deleting the cfg file fixes it. I didn't have any Multifolders lines in my cfg file, so the problem isn't that.