News-App Update error

Hello together,

I run the news app a few days in parallel to my TT-RRS instance.
I am running Nextcloud at a shared hoster (Strato).
To update the news feeds I am using a php script (REST update) which is triggered from a shell script, also I have created a small C++ programm which updates via REST.
The problem is, that some feeds stopped to update, and I found the folling error in log file:

Could not update feed Did not expect more than one result when executing: query “SELECT items.* FROM *PREFIX*news_items items JOIN *PREFIX*news_feeds feeds ON feeds.id = items.feed_id AND feeds.deleted_at = 0 AND feeds.user_id = ? AND items.guid_hash = ? AND feeds.id = ? LEFT OUTER JOIN *PREFIX*news_folders folders ON folders.id = feeds.folder_id WHERE feeds.folder_id = 0 OR folders.deleted_at = 0 ORDER BY items.id DESC”; parameters Array\n(\n [0] => myuser\n [1] => 1b4667febb44e8b883119250c20b840c\n [2] => 217\n)\n; limit “”; offset “”",“level”:0,“time”:“2016-08-31T09:46:56+00:00”,“method”:“GET”,“url”:"/myurl/nextcloud/index.php/apps/news/api/v1-2/feeds/update",“user”:“myuser”}

Can anybody explain the error to me?

Thank you in advance.
Stephan

First: use the issue tracker for stuff like this
Second: your items database is inconsistent. There are muliple entries in the same feed with the same guidHash which normally can’t happen because in case items have the same guid, they will fetch and update the same item multiple times. Might be from a failed upgrade (Sqlite?) or custom tinkering

Could ofc also be caused by race conditions if you run multiple update scripts (e.g. REST update api + console update API) assuming you did not modify the soure code.

Thanks for your quick answer.
I use only the REST api to update, maybe the update is running in parallel.
I have not changed any code.
Any hints to fix the database?

Thank you in advance.
Stephan

Find duplicates in oc_news_items that contain:

  • the same guid_hash
  • the same feed_id

and delete them