QuiteRSS File locked after sync

I am using QuiteRSS as news reader on multiple PCs and I am syncing the QuiteRSS SQLite database (feeds.db) with Nextcloud. I configured QuiteRSS to only save the status of the feed to the database on disk when exiting the application.

When I close QuiteRSS Nextcloud uploads the database file. As soon as it is finished it tries to sync again and it immediately throws a “Can’t sync. File locked” error. I always have to fix the situation by manually editing the file_lock table.

Here is the log:

#=#=#=# Syncrun started 2017-06-14T20:32:18
#=#=#=#=# Propagation starts 2017-06-14T20:32:18 (last step: 590 msec, total: 590 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
||debug.log|INST_SYNC|Up|1497465137|8d6625c1e8a9e51cce99626151e515af|70470|00000019ocndnmrgh21y|3|Local file changed during sync.|0|70181|1497465058|8d6625c1e8a9e51cce99626151e515af|00000019ocndnmrgh21y|INST_NONE|
||feeds.db|INST_SYNC|Up|1497465137|0878dda3be08cf205896f97751ccef26|42078208|00055308ocndnmrgh21y|3|Local file changed during sync.|0|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
18:32:18||cookies.dat|INST_SYNC|Up|1497465136|be4c93d34b2d5c5dc6bf2dd2e4ec9e84|52686|00000018ocndnmrgh21y|4||204|53606|1497386212|7eef431d2c9638be7c9650c67ebade71|00000018ocndnmrgh21y|INST_NONE|
18:32:18||adblock/customlist.txt|INST_SYNC|Up|1497465136|4cc22b7afdf8ae3d949a26ac0980709b|101|00000021ocndnmrgh21y|4||204|101|1497386212|3e689ef943534d9d13de1bbb0ade7a51|00000021ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:32:19 (last step: 1294 msec, total: 1885 msec)
#=#=#=# Syncrun started 2017-06-14T20:32:22
#=#=#=#=# Propagation starts 2017-06-14T20:32:22 (last step: 626 msec, total: 626 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
||backup/feeds.db_0.18.3_2016-10-21_11-49-33.bak|INST_IGNORE|Up|1477043373||17088512||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
18:32:22||debug.log|INST_SYNC|Up|1497465137|e1c96e7e0ae8d25b5ea162a5978c68f4|70470|00000019ocndnmrgh21y|4||204|70181|1497465058|8d6625c1e8a9e51cce99626151e515af|00000019ocndnmrgh21y|INST_NONE|
||feeds.db|INST_SYNC|Up|1497465137|0878dda3be08cf205896f97751ccef26|42078208|00055308ocndnmrgh21y|3|Error transferring https://www.noirextreme.com/nextcloud/remote.php/dav/uploads/jeancf/567034260/.file - server replied: Locked ("QuiteRSS/feeds.db" is locked)|423|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:32:53 (last step: 30451 msec, total: 31078 msec)
#=#=#=# Syncrun started 2017-06-14T20:33:01
#=#=#=#=# Propagation starts 2017-06-14T20:33:02 (last step: 261 msec, total: 261 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
||feeds.db|INST_SYNC|Up|1497465137|0878dda3be08cf205896f97751ccef26|42078208|00055308ocndnmrgh21y|2|Error transferring https://www.noirextreme.com/nextcloud/remote.php/dav/uploads/jeancf/567034260/.file - server replied: Locked ("QuiteRSS/feeds.db" is locked)|423|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:33:03 (last step: 765 msec, total: 1027 msec)
#=#=#=# Syncrun started 2017-06-14T20:33:04
#=#=#=#=# Propagation starts 2017-06-14T20:33:05 (last step: 261 msec, total: 261 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
||feeds.db|INST_SYNC|Up|1497465137|0878dda3be08cf205896f97751ccef26|42078208|00055308ocndnmrgh21y|2|Error transferring https://www.noirextreme.com/nextcloud/remote.php/dav/uploads/jeancf/567034260/.file - server replied: Locked ("QuiteRSS/feeds.db" is locked)|423|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:33:06 (last step: 792 msec, total: 1054 msec)
#=#=#=# Syncrun started 2017-06-14T20:33:47
#=#=#=#=# Propagation starts 2017-06-14T20:33:47 (last step: 554 msec, total: 554 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
||feeds.db|INST_SYNC|Up|1497465137|0878dda3be08cf205896f97751ccef26|42078208|00055308ocndnmrgh21y|2|Error transferring https://www.noirextreme.com/nextcloud/remote.php/dav/uploads/jeancf/567034260/.file - server replied: Locked ("QuiteRSS/feeds.db" is locked)|423|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:33:48 (last step: 827 msec, total: 1381 msec)
#=#=#=# Syncrun started 2017-06-14T20:38:27
#=#=#=#=# Propagation starts 2017-06-14T20:38:28 (last step: 325 msec, total: 325 msec)
||backup|INST_IGNORE|Up|1478255154||312||6|Ignored because of the "choose what to sync" blacklist|0|0|0|||INST_NONE|
18:38:28||feeds.db|INST_SYNC|Up|1497465137|f1f510d586850c8fda24732955502f0d|42078208|00055308ocndnmrgh21y|4||204|41574400|1497386216|0878dda3be08cf205896f97751ccef26|00055308ocndnmrgh21y|INST_NONE|
#=#=#=# Syncrun finished 2017-06-14T20:38:30 (last step: 1958 msec, total: 2284 msec)

It looks like the app writes to feeds.db during sync. Is that what creates the lock situation?

Is there a way to prevent the lock in this circumstance?

Redis as locking cache is better and it gives less problems. However, if clients try to write at the same time from different clients, there will be a locking error.

Nextcloud has its own RSS-reader, it would be nice to couple QuiteRSS to the Nextcloud news-reader as a client for it, someone had this idea already in the past:

Sqlite is not built for concurrent access and frequently runs into database locked issues. Apart from that I’d advise against syncing your feeds that way since you will probably deal with conflicts a lot.

I’d advise against syncing your feeds that way

Thanks. However for me the benefits of keeping my feeds in sync far outweigh the annoyance of the lock so, unless you have a better alternative to propose I will keep doing it that way.

It would be awesome! However I am not a developer myself and cannot help with that.