Closed blizzz closed 8 years ago
Logged here: https://github.com/owncloud/news/blob/master/service/feedservice.php#L164
Basically means that any find in the update method which should only ever return one result returned two (no stacktrace, can you maybe create a PR to also log the trace? http://php.net/manual/en/exception.gettraceasstring.php)
This is likely a result of a bad db migration and nothing that can be solved on my side. What you can do:
@BernhardPosselt thanks for these steps.
The trace is:
#0 /path/to/owncloud/lib/public/appframework/db/mapper.php(347): OCP\AppFramework\Db\Mapper->findOneQuery('SELECT `items`....', Array, NULL, NULL)
#1 /path/to/apps-extra/news/db/itemmapper.php(265): OCP\AppFramework\Db\Mapper->findEntity('SELECT `items`....', Array)
#2 /path/to/apps-extra/news/service/feedservice.php(235): OCA\News\Db\ItemMapper->findByGuidHash('378038c6341686e...', 87, '$USER')
#3 /path/to/apps-extra/news/service/feedservice.php(161): OCA\News\Service\FeedService->update(87, '$USER')
#4 /path/to/apps-extra/news/utility/updater.php(45): OCA\News\Service\FeedService->updateAll()
#5 /path/to/apps-extra/news/cron/updater.php(32): OCA\News\Utility\Updater->update()
#6 [internal function]: OCA\News\Cron\Updater::run()
#7 /path/to/owncloud/lib/private/backgroundjob/legacy/regularjob.php(28): call_user_func(Array)
#8 /path/to/owncloud/lib/private/backgroundjob/job.php(52): OC\BackgroundJob\Legacy\RegularJob->run(Array)
#9 /path/to/owncloud/cron.php(141): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log))
#10 {main}
There are indeed two entries in the news_items table having the same guid, guid_hash, feed_id, url and title.
select distinct guid from news_items;
returns 9703 rows, while in total there are 9996 rows. Roughly 300 dups, apparently.
Is this issue resolved? Do you feel that the stacktrace should be added in the log? If so, could you create a PR?
Not resolved, if I need to do it manually. I did not do it for the other 300 entries, yet. Might look into it, but not much time right now.
If it's a bug, it's in core because I don't touch migrations ;)
Quick guess: cronjobs are run while the database schema is being migrated.
If it's a bug, it's in core because I don't touch migrations ;)
OK. At least returning the feed id would be helpful.
Quick guess: cronjobs are run while the database schema is being migrated.
I really hope it does not run in maintenance mode :) yet need to verify.
Will improve the error messages ;)
As for the cronjob: what happens if a cronjob is running 1 hour and needs another hour to finish and then ownCloud goes into maintenance mode? Is the cronjob killed? Does it wait with the update until the cronjob is finished?
Explain the Problem
The message »Unexpected error when updating feed More than one result« is logged with every cron run. Neither it is clear what is wrong, and what should be done.
Steps to Reproduce
Explain what you did to encounter the issue
System Information
Contents of owncloud/data/owncloud.log