nextcloud / desktop

šŸ’» Desktop sync client for Nextcloud
https://nextcloud.com/install/#install-clients
GNU General Public License v2.0
2.97k stars 784 forks source link

`nextcloud` SQL error `Database is locked` when using selective sync list #3422

Open shahzebs opened 3 years ago

shahzebs commented 3 years ago

How to use GitHub

Expected behaviour

When running the nextcloudcmd cli tool with --unsyncedfolders <path to file with selective sync list> I expect the selective sync to complete within reasonable time and without errors.

Actual behaviour

With a selective sync file formatted as

folder1/
folder2/

I get the following log outputs when doing a selective sync:

06-09 19:57:41:706 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::exec ]:    SQL exec "SELECT path FROM selectivesync WHERE type=?1"
06-09 19:57:41:706 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 1 1
06-09 19:57:41:706 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::exec ]:    SQL exec "DELETE FROM selectivesync WHERE type == ?1"
06-09 19:59:23:977 [ warning nextcloud.sync.database.sql ]: Sqlite exec statement error: 5 "database is locked" in "DELETE FROM selectivesync WHERE type == ?1"
06-09 19:59:23:977 [ warning nextcloud.sync.database ]: SQL error when deleting selective sync list ("folder1/", "folder2/") "database is locked"
06-09 19:59:23:980 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 1 "folder1/"
06-09 19:59:23:980 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 2 1
06-09 19:59:23:980 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::exec ]:    SQL exec "INSERT INTO selectivesync VALUES (?1, ?2)"
06-09 20:01:06:251 [ warning nextcloud.sync.database.sql ]: Sqlite exec statement error: 5 "database is locked" in "INSERT INTO selectivesync VALUES (?1, ?2)"
06-09 20:01:06:251 [ warning nextcloud.sync.database ]: SQL error when inserting into selective sync 1 "folder1/" "database is locked"
06-09 20:01:06:251 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 1 "folder2/"
06-09 20:01:06:251 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::bindValue ]:   SQL bind 2 1
06-09 20:01:06:251 [ debug nextcloud.sync.database.sql ]    [ OCC::SqlQuery::exec ]:    SQL exec "INSERT INTO selectivesync VALUES (?1, ?2)"
06-09 20:02:48:523 [ warning nextcloud.sync.database.sql ]: Sqlite exec statement error: 5 "database is locked" in "INSERT INTO selectivesync VALUES (?1, ?2)"
06-09 20:02:48:523 [ warning nextcloud.sync.database ]: SQL error when inserting into selective sync 1 "folder2/" "database is locked"

The selective sync takes a long time, much longer than syncing non-selectively. Note the time stamps 19:57:41 to 19:59:23. But the sync is correct, i.e. the remote folders I want to exclude are excluded from the sync.

Steps to reproduce

  1. Sync files to a new source directory with selective sync. It should complete normally.
  2. Do another selective sync run and this starts happening.

Client configuration

Client version: Nextcloud version 3.2.2git Git revision 04afaa1fe62133480272ba5e660dd5f773356cd6 Using Qt 5.15.2, built against Qt 5.15.2 Using 'OpenSSL 1.1.1k 25 Mar 2021' Running on Arch Linux, x86_64

Operating system: Arch Linux

Server configuration

Nextcloud version: latest docker image

Storage backend (external storage): mariadb latest docker image

github-actions[bot] commented 3 years ago

This bug report did not receive an update in the last 4 weeks. Please take a look again and update the issue with new details, otherwise the issue will be automatically closed in 2 weeks. Thank you!

github-actions[bot] commented 3 years ago

This bug report is getting automatically closed due to no answer since the issue has been staled. Thank you!

aHcVolle commented 2 years ago

is there any fix yet?

sebastianschauenburg commented 2 years ago

had a similar issue, but in my case it was 'fixed' by removing the line in the unsyncedfolders file (which is a list containing the unsynced folders). In my case the unsynced folder mentioned, was not present anymore on the server side.

mayonezo commented 1 year ago

Same issue for me. Additionally, I would really appreciate documentation or an example of an unsyncedfolders file.

Haelle commented 4 months ago

same issue here

rainbowbreeze commented 3 months ago

Likewise. Both for the error, and fo a working example of a --unsyncedfolders file