news icon indicating copy to clipboard operation
news copied to clipboard

Feed not updated, without any errors [$15]

Open v1r0x opened this issue 6 years ago • 89 comments

IMPORTANT

Read and tick the following checkbox after you have created the issue or place an x inside the brackets ;)

Explain the Problem

After update to news 14.1.0 a couple of feeds are no longer updated

Steps to Reproduce

Explain what you did to encounter the issue

  1. add http://blog.fefe.de/rss.xml?html as feed
  2. Either wait for the cron to update feeds or run php ./occ news:updater:update-feed <feedid> <userid>
  3. no new entries are shown in the news app, although new entries should be available

System Information

  • News app version: 14.1.0
  • Nextcloud version: 17.0.2
  • Cron type: system cron
  • PHP version: 7.3.x
  • Database and version: 10.4.11 mariadb
  • Browser and version:
  • Distribution and version: ubuntu 18.04 lts

Contents of nextcloud/data/nextcloud.log

{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Json","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Atom","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rss","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"new parser added : FeedIo\\Standard\\Rdf","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"read access : http:\/\/blog.fefe.de\/rss.xml?html into a feed instance (feed class : FeedIo\\Feed)","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"start reading http:\/\/blog.fefe.de\/rss.xml?html","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":1,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"hitting http:\/\/blog.fefe.de\/rss.xml?html","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"response ok, now turning it into a document","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":1,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"the stream is modified, parsing it","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"accurate parser : FeedIo\\Parser\\XmlParser","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":1,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"correct last modified date for feed Fefes Blog","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":1,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"correct public id for node Fefes Blog","userAgent":"--","version":"17.0.2.1"}
{"reqId":"QgkF79bFne0ZG2suHbeb","level":0,"time":"2020-01-02T14:43:28+00:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"Feed http:\/\/blog.fefe.de\/rss.xml?html was modified since last fetch. #0 items","userAgent":"--","version":"17.0.2.1"}

Contents of Browser Error Console

Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put here

nothing

There is a $15 open bounty on this issue. Add to the bounty at Bountysource.

v1r0x avatar Jan 02 '20 14:01 v1r0x

Yea Just checked my instance same issue.

My guess is that it's related to #594 and the feed not having a lastBuildDate nor pubDate for the items.

Do your other feeds also lack that element?

Grotax avatar Jan 02 '20 16:01 Grotax

I've checked another feed and there is no lastBuildDate or pubDate.

I reverted the changes from #594 and only reverting these lines didn't work. But also reverting this line fixed the problem (at least for manual fetching). Do you know why there's a difference between DateTime and \DateTime?

v1r0x avatar Jan 02 '20 19:01 v1r0x

@kesselb could you take a look at this?

Grotax avatar Jan 04 '20 09:01 Grotax

The difference is the need to include the class first. If there's no include \Class; at the top new Class(); won't work. Would be a simple fix but probably means that the class isn't tested properly either.

SMillerDev avatar Jan 04 '20 11:01 SMillerDev

Yeah, I know that difference :)

My question was why the feeds won't work with new DateTime() although it is included, but using new \DateTime() works. Sorry for the bad wording in my last comment.

v1r0x avatar Jan 04 '20 12:01 v1r0x

Index: lib/Fetcher/FeedFetcher.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- lib/Fetcher/FeedFetcher.php	(revision 7d02d59d671f2d63737bc49510693c1cf3df711b)
+++ lib/Fetcher/FeedFetcher.php	(date 1578148278618)
@@ -288,7 +288,7 @@
         $newFeed->setUrl($url);  // the url used to add the feed
         $newFeed->setLocation($location);  // the url where the feed was found
         $newFeed->setLink($feed->getLink());  // <link> attribute in the feed
-        if ($feed->getLastModified() instanceof DateTime) {
+        if ($feed->getLastModified() instanceof DateTime && $feed->getLastModified()->getTimestamp() > 0) {
             $newFeed->setHttpLastModified($feed->getLastModified()->format(DateTime::RSS));
         }
         $newFeed->setAdded($this->time->getTime());

Updating http://blog.fefe.de/rss.xml?html works for me with above patch. But this seems to be more a workaround than a fix.

curl -I http://blog.fefe.de/rss.xml?html
HTTP/1.1 200 Here you go
Server: Gatling/0.16
Content-Type: text/xml; charset=utf-8
Content-Length: 11276
Last-Modified: Sat, 04 Jan 2020 10:49:42 GMT
Date: Sat, 04 Jan 2020 14:38:42 GMT
curl -I --header "If-Modified-Since: Sat, 04 Jan 2020 10:49:42 GMT" http://blog.fefe.de/rss.xml?html
HTTP/1.1 304 Nix Neues

This seems to be an issue with feed-io because the feed support if-modified-since and is also sending a last modified value. Pushed a fix upstream: https://github.com/alexdebril/feed-io/pull/259

This is probably still a issue with news because somewhere the items are lost / something is done to not add the items. I'm not sure where :see_no_evil:

kesselb avatar Jan 04 '20 15:01 kesselb

I am also facing this issue with numerous feeds (but not all, not even all from the same provider like Reddit) and it seems to try to update, but finds zero new items:

{"reqId":"l8ztdRUWNhsughzIuUyH","level":0,"time":"2020-01-09T14:45:12+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"read access : https:\/\/www.reddit.com\/r\/cats\/.rss into a feed instance (feed class : FeedIo\\Feed)","userAgent":"--","version":"17.0.2.1"}
{"reqId":"l8ztdRUWNhsughzIuUyH","level":0,"time":"2020-01-09T14:45:12+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"start reading https:\/\/www.reddit.com\/r\/cats\/.rss","userAgent":"--","version":"17.0.2.1"}
{"reqId":"l8ztdRUWNhsughzIuUyH","level":1,"time":"2020-01-09T14:45:12+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"hitting https:\/\/www.reddit.com\/r\/cats\/.rss","userAgent":"--","version":"17.0.2.1"}
{"reqId":"l8ztdRUWNhsughzIuUyH","level":0,"time":"2020-01-09T14:45:12+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"Feed https:\/\/www.reddit.com\/r\/cats\/.rss was modified since last fetch. #0 items","userAgent":"--","version":"17.0.2.1"}
{"reqId":"O7hrq78DYjFwoSNbsjb0","level":0,"time":"2020-01-09T15:00:11+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"read access : https:\/\/www.reddit.com\/r\/cats\/.rss into a feed instance (feed class : FeedIo\\Feed)","userAgent":"--","version":"17.0.2.1"}
{"reqId":"O7hrq78DYjFwoSNbsjb0","level":0,"time":"2020-01-09T15:00:11+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"start reading https:\/\/www.reddit.com\/r\/cats\/.rss","userAgent":"--","version":"17.0.2.1"}
{"reqId":"O7hrq78DYjFwoSNbsjb0","level":1,"time":"2020-01-09T15:00:11+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"hitting https:\/\/www.reddit.com\/r\/cats\/.rss","userAgent":"--","version":"17.0.2.1"}
{"reqId":"O7hrq78DYjFwoSNbsjb0","level":0,"time":"2020-01-09T15:00:12+01:00","remoteAddr":"","user":"--","app":"news","method":"","url":"--","message":"Feed https:\/\/www.reddit.com\/r\/cats\/.rss was modified since last fetch. #0 items","userAgent":"--","version":"17.0.2.1"}

e-alfred avatar Jan 09 '20 14:01 e-alfred

Yea so the issue persists with news 14.1.1 which includes the fixed feed-io. Seems like the fetching is working but then the items are not added to the feed. Deleting and re-adding the feed will update the feed but probably just once.

Grotax avatar Jan 12 '20 11:01 Grotax

Hmm. Probably revert https://github.com/nextcloud/news/pull/594 then? Unfortunately, I'm running short on time next weeks.

kesselb avatar Jan 12 '20 15:01 kesselb

Hello, i using nextcloud 17.0.2 et news 14.1.2 and i have the same problem. My only solution is to put this command : sudo -u www-data php ./occ news:updater:all-feeds | jq --raw-output '.feeds | map("\(.id) \(.userId)") | join("\n")' | sudo -u www-data xargs -L 1 php ./occ news:updater:update-feed i have no error...

I have remove and reinstall the app but i have no change...

Disciplus86 avatar Jan 13 '20 13:01 Disciplus86

Hmm. Probably revert #594 then? Unfortunately, I'm running short on time next weeks.

Grrr 👎, i have try to modify this #594... now, it s not working a message : httpLastModified is not a valid attribute

and now i have : Could not update feed with id 13 and user userx : DateTime::__construct(): Failed to parse time string (1578923602365093) at position 15 (3): Unexpected character

For this problem : the solution is to activate/deactivate full text on all feed manually. but the autoupdate not working...

Disciplus86 avatar Jan 13 '20 14:01 Disciplus86

I think i got hit by this. It seemed to affect my reddit /r/news feed pretty badly (https://www.reddit.com/r/news/.rss), which is weird because I have other reddit feeds that occasionally would show a few entries. I ended up downgrading back to 14.0.2, but my feeds still weren't updating. I had to update the last_modified column on the oc_news_feeds table before it started finding any of the missing entries. I don't remember what they were set to at the time, but they seemed to be set to the current time in UTC, so I updated to current date at midnight. A bit of a hack job, but maybe this info will be useful?

gameman733 avatar Jan 13 '20 15:01 gameman733

Ok I guess reverting this change is our best option right now.

Grotax avatar Jan 14 '20 19:01 Grotax

Hi, i have resolve my problem with 2 actions:

  • I have remove all reddit rss list
  • i have disable full text in all news list.

can you confirme this solution?

Disciplus86 avatar Jan 15 '20 14:01 Disciplus86

I started another nextcloud instance with the news app, for testing purposes. Added the reddit news rss feed I mentioned before, and after the initial population, it stopped adding anything new. Full text indexing was disabled. I enabled it, and it populated more, but then stopped again. I just now disabled it, and more feed items were imported.

gameman733 avatar Jan 20 '20 23:01 gameman733

Yeah toggling full text will fetch the data again forcefully. It seems it just doesn't import this feed and the change will have to be reverted.

SMillerDev avatar Jan 21 '20 01:01 SMillerDev

Hello, I'm also seeing a behavior similar to this on several feeds. It doesn't seem to fetch data when I have "enable full text" on except for when I'm turning it on or off. So it force updates them

tdoerrich avatar Jan 24 '20 19:01 tdoerrich

Unless you can offer some new information, please don't comment that you have the same problem. It only hides the useful information

SMillerDev avatar Jan 25 '20 01:01 SMillerDev

I'm able to reproduce it :tada:

Example for http://blog.fefe.de/rss.xml:

  1. Subscribe to feed via ui
  2. First import is successful. 20 items importeded, Last Modified is Fri, 24 Jan 2020 17:22:00 +0000 for feed and every item (that is expected because the items have no date itself).
  3. Delete latest 4 items and run update-feed command. No new items are added because the server responded with 304 (thats's expected).
  4. Change last modified to Fri, 24 Jan 2020 17:20:00 +0000. Now the latest item should be added again but feed-io will not return it.

https://github.com/alexdebril/feed-io/blob/c651b6fc8952ebf0121bc0cc06ceeb3a69d482cf/src/FeedIo/Filter/ModifiedSince.php#L37-L44

If we call feed-io with modifiedSince the above filter is enabled. Any news item without a pubDate is not valid then. I think that's wrong and pushed a fix upstream.

We are not able to change this behaviour from news (it all happens within feed-io). So the right workaround until this is fixed is to not use modified since.

kesselb avatar Jan 25 '20 14:01 kesselb

Another feed that isn't updated anymore: https://www.klimareporter.de/feed/rss/

It has a <lastBuildDate> for the feed and <pubDate> for the items.

ghost avatar Jan 26 '20 17:01 ghost