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

Nextcloud client crashes after ubuntu 20.04 update #1976

Closed
simogeo opened this issue May 13, 2020 · 10 comments
Closed

Nextcloud client crashes after ubuntu 20.04 update #1976

simogeo opened this issue May 13, 2020 · 10 comments

Comments

@simogeo
Copy link

simogeo commented May 13, 2020

After updating from ubuntu 19.10 to 20.04 version, my nextcloud-client always crashed after a while.

Expected behaviour

Should not crash

Actual behaviour

Tell us what happens instead

Steps to reproduce

  1. updating from ubuntu 19.10 to 20.04
  2. open nextcloud client if not lauched at start-up
  3. wait. After a while, client does not support having some issues with some files .

Client configuration

Client version: 2.6.2 from ppa

Operating system: ubuntu 20.04

OS language:

Qt version used by client package (Linux only, see also Settings dialog): Qt 5.12.8 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 9.3.0) on "xcb"

Client package (From Nextcloud or distro) (Linux only): from PPA

Installation path of client:

Server configuration

Nextcloud version:

Storage backend (external storage):

Logs

  1. Client logfile - last lines only ...
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jquery-mask-plugin/test
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  06-Ressources/_DATA/EACEI
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jquery.tablesorter
[csync_reconcile 	Reconciliation for remote replica took  0.106 seconds visiting  70339  files.
[OCC::SyncEngine::slotDiscoveryJobFinished 	#### Reconcile end ####################################################  800251 ms
[OCC::SyncJournalDb::setFileRecord 	Updating file record for path: "04_AO & Propositions/2018/a qualifier/CC-Challans-Gois-Communaute_85_20181010W2_01.zip" inode: 27000839 modtime: 1539250514 type: 0 etag: "ea983ebba4e53ea7d2b9bf70df4e90e5" fileId: "00245384oc9b16e44659" remotePerm: "S" fileSize: 188981852 checksum: "SHA1:dc24ebba2b83b7e5cd3df59aaaf7d5c205c37969" e2eMangledName: ""
[OCC::SqlQuery::prepare 	Sqlite prepare statement error: "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentChecksum, contentChecksumTypeId, e2eMangledName) VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7,  ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17);"
[OCC::SqlQuery::prepare 	ENFORCE: "allow_failure" in file /build/nextcloud-client-ymYnWp/nextcloud-client-2.6.4/src/common/ownsql.cpp, line 269 with message: SQLITE Prepare error

Second logfile (last lines) after removing the file causing issue previously :

[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  00-SCOP/1_Offre & Outils/Offre Donnees energetiques/concours-ministere-ecologie/code-source/app/data/energie/200071546
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Appropriation-TE-Region-Centre/03-Travaux/Phase-2/photos-lochois/atelier-1/OneDrive_2019-09-12/Photos Loches Atelier 1
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/html2canvas/tests/cases/text
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/linea21-avantMAJ/lib/js/CodeMirror/mode/haxe
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/1-extension-ProjectRev/linea21/lib/vendor/phpword-0.16.0/vendor/phpoffice/phpword/src/PhpWord/Writer/RTF/Part
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2018/PCAET-Citergie-vitre-communaute/1_Diagnostic/Vulnerabilite/rga
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jQuery-EasyTabs/test
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/linea21-avantMAJ/lib/js/jquery-mask-plugin/src
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jQuery-EasyTabs/vendor
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jquery-mask-plugin
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jquery-mask-plugin/dist
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  02-En-cours/2019/Nanterre-Linea21/deploy/linea21/lib/js/jquery-mask-plugin/test
[_csync_merge_algorithm_visitor 	INSTRUCTION_UPDATE_METADATA    server dir:  06-Ressources/_DATA/EACEI
[csync_reconcile 	Reconciliation for remote replica took  0.151 seconds visiting  70342  files.
[OCC::SyncEngine::slotDiscoveryJobFinished 	#### Reconcile end ####################################################  1096393 ms
[OCC::SyncJournalDb::setFileRecord 	Updating file record for path: "02-En-cours/2018/PCAET-Citergie-vitre-communaute/01_El\xC3\xA9ments r\xC3\xA9""dig\xC3\xA9s/Pr\xC3\xA9sentations/20181203_COPIL_Diagnostic/Vitre-com-COPIL-Diagnostic_vf.pptx" inode: 31326406 modtime: 1543613177 type: 0 etag: "4d2c8aacc0c2368bbcbbaa4462cbefa1" fileId: "00206908oc9b16e44659" remotePerm: "WDNVRS" fileSize: 17805082 checksum: "SHA1:dd30e558a1525cddc2e475ebf755583bca569bd9" e2eMangledName: ""
[OCC::SqlQuery::prepare 	Sqlite prepare statement error: "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentChecksum, contentChecksumTypeId, e2eMangledName) VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7,  ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17);"
[OCC::SqlQuery::prepare 	ENFORCE: "allow_failure" in file /build/nextcloud-client-ymYnWp/nextcloud-client-2.6.4/src/common/ownsql.cpp, line 269 with message: SQLITE Prepare error

Hope it helps !

My workaround, at that point, was to switch to owncloud-client (which works well).

@matis-schotte
Copy link

Sorry off topic, but the owncloud-client is compatible to nextcloud? Good to know since I also have crashes.

@simogeo
Copy link
Author

simogeo commented May 14, 2020

@matis-schotte : fortunately, it is !

@machinekoder
Copy link

machinekoder commented Jun 12, 2020

Thanks, switched to owncloud-client as well.

@matis-schotte
Copy link

matis-schotte commented Jun 13, 2020 via email

@michnovka
Copy link

Same issue with Nextcloud version 2.6.5-20200713.144448.adada8b2e-1.0~bionic1 on Kubuntu 20.04

2020-07-17 20:42:10:508 [ info nextcloud.sync.database ]:       Updating file record for path: "Company/csob_vypis.pdf" inode: 2888736 modtime: 1572341215 type: 0 etag: "4ac01569f44ea00829b31152817e589d" fileId: "00047908ochoj4cc0e60" remotePerm: "WDNVRS" fileSize: 41003 checksum: "" e2eMangledName: ""
2020-07-17 20:42:10:508 [ warning nextcloud.sync.database.sql ]:        Sqlite prepare statement error: "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata (phash, pathlen, path, inode, uid, gid, mode, modtime, type, md5, fileid, remotePerm, filesize, ignoredChildrenRemote, contentChecksum, contentChecksumTypeId, e2eMangledName) VALUES (?1 , ?2, ?3 , ?4 , ?5 , ?6 , ?7,  ?8 , ?9 , ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17);"
2020-07-17 20:42:10:508 [ fatal default ]:      ENFORCE: "allow_failure" in file /build/nextcloud-desktop-j_NMw5/nextcloud-desktop-2.6.5-20200713.144448.adada8b2e/src/common/ownsql.cpp, line 269 with message: SQLITE Prepare error

@er-vin
Copy link
Member

er-vin commented Jul 20, 2020

Well, the problem is more with mixing owncloud client and nextcloud client. They create in index depending on a parent_hash() function that they provide from within the runtime code of their client. When an insert is then done from another client in the same journal db this can only crash since sqlite won't find the function.

This is why you don't get a crash with the owncloud client, you got a journal db compatible with owncloud client only.

You can get back on your feet by stopping all clients and then removing the journal db. When you'll start the client again it will make a full sync though, depending on the situation this can take a while.

@paulez
Copy link

paulez commented May 25, 2021

I had the same sqlite error after downgrading Nextcloud client from version 3.2 (Fedora 34) to version 3.1 (Debian Bullseye): "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata
I was able to resolve it by removing the "metadata_parent" index from the journal db using sqlitebrowser.

@mburnicki
Copy link

mburnicki commented May 25, 2021

@paulez Thanks for your comment.

I just encountered the same "unknown function: parent_hash()" error after I had temporarily downgraded the client from 3.1.3 to an older version to see if that fixes the issue I'd reported here #3347, and then upgraded to the latest 3.1.3 again because the error also occurred with the older version.

Now the client crashes shortly after start with the error mentioned above.

Your comment pointed me to the right direction, but I didn't want to fiddle with the database. So I simply deleted it because the document at https://docs.nextcloud.com/desktop/2.6/architecture.html#the-sync-journal says that it is simply rebuilt by the client. Unfortunately this doesn't seem to be quite true because it looks like lot of file (if not even all files) are synchronized from the server again, even though they haven't changed for a long time and were surely in sync when the trouble started. Just for the records. ;-)

@sapusi
Copy link

sapusi commented Jun 21, 2021

I had the same sqlite error after downgrading Nextcloud client from version 3.2 (Fedora 34) to version 3.1 (Debian Bullseye): "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata
I was able to resolve it by removing the "metadata_parent" index from the journal db using sqlitebrowser.

Thank you, paulez !

I had this issue after upgrading to Ubuntu 21.04.

The error in syslog was
com.nextcloud.desktopclient.nextcloud.desktop[108808]: [ fatal default ]:#011ENFORCE: "allow_failure" in file ./src/common/ownsql.cpp, line 265 with message: SQLITE Prepare error

Deleting the index "metadata_parent" from the "metadata" table worked perfectly for me, without having to rebuild the Journal DB or re-syncing any files.

Before I deleted the index, I noticed that newer journal databases (which I just created a few days ago) didnt have the index at all, so I felt quite safe deleting it.

@evdcush
Copy link

evdcush commented Jan 5, 2023

I had the same sqlite error after downgrading Nextcloud client from version 3.2 (Fedora 34) to version 3.1 (Debian Bullseye): "unknown function: parent_hash()" in "INSERT OR REPLACE INTO metadata I was able to resolve it by removing the "metadata_parent" index from the journal db using sqlitebrowser.

Thank you @paulez!

I was experiencing the same problem being discussed in this issue and your comment fixed my problem!

For further elaboration on what you need to do for others like me who may not know what or where the "journal db" is, it's a sql db file (like .sync_*.db) found at the root dir of your Nextcloud-synchronized directory.

Eg, if your Nextcloud-sync'd dir is ~/Nextcloud/, then you would run something like:

foo@myhostname:~/Nextcloud$ sqlitebrowser .sync_ab2f07b8e41f.db

Then, select the metadata_parent index in the db indices in the gui view, and "Delete Index".

screenshot_2023-01-05_12-52-41

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

9 participants