nextcloud / news

:newspaper: RSS/Atom feed reader
https://apps.nextcloud.com/apps/news
GNU Affero General Public License v3.0
861 stars 186 forks source link

Out of range exception #1092

Closed CapSel closed 3 years ago

CapSel commented 3 years ago

IMPORTANT

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

Explain the Problem

Exception on parsing https://redox-os.org/index.xml feed. Command line below is generated from python updater script. Running it manually causes same problem. Deleting feed and adding it again only changes id.

$ php7 -f ./occ news:updater:update-feed capsel 47
Could not update feed with id 47 and user capsel: An exception occurred while executing 'INSERT INTO `oc_news_items` (`unread`, `url`, `guid`, `guid_hash`, `pub_date`, `last_modified`, `title`, `body`, `search_index`, `fingerprint`, `content_hash`, `feed_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [true, "https:\/\/www.redox-os.org\/talks\/", "https:\/\/www.redox-os.org\/talks\/", "363a6295f9bdc0f883ff1616d05b2422", -62135596800, "1612098762298093", "Talks", "Cyberdeck Users Weekly By Jeremy Soller and Paul Miller on May 13, 2020\n FOSDEM 2019 By Rob$ php7 -f ./occ news:updater:update-feed capsel 47
Could not update feed with id 47 and user capsel: An exception occurred while executing 'INSERT INTO `oc_news_items` (`unread`, `url`, `guid`, `guid_hash`, `pub_date`, `last_modified`, `title`, `body`, `search_index`, `fingerprint`, `content_hash`, `feed_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [true, "https:\/\/www.redox-os.org\/talks\/", "https:\/\/www.redox-os.org\/talks\/", "363a6295f9bdc0f883ff1616d05b2422", -62135596800, "1612098762298093", "Talks", "Cyberdeck Users Weekly By Jeremy Soller and Paul Miller on May 13, 2020\n FOSDEM 2019 By Robin Randhawa on February 3, 2019\n  Linaro Connect Vancouver 2018 By Jeremy Soller and Robin Randhawa on September 21, 2018\n  The Changelog By Jeremy Soller, Adam Stacoviak and Jerod Santo on January 19, 2018\n \nLunduke Hour By Jeremy Soller and Bryan Lunduke on March 13, 2017", "cyberdeck users weekly by jeremy soller and paul miller on may 13, 2020\n fosdem 2019 by robin randhawa on february 3, 2019\n  linaro connect vancouver 2018 by jeremy soller and robin randhawa on september 21, 2018\n  the changelog by jeremy soller, adam stacoviak and jerod santo on january 19, 2018\n \nlunduke hour by jeremy soller and bryan lunduke on march 13, 2017talkshttps:\/\/www.redox-os.org\$ php7 -f ./occ news:updater:update-feed capsel 47
Could not update feed with id 47 and user capsel: An exception occurred while executing 'INSERT INTO `oc_news_items` (`unread`, `url`, `guid`, `guid_hash`, `pub_date`, `last_modified`, `title`, `body`, `search_index`, `fingerprint`, `content_hash`, `feed_id`) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)' with params [true, "https:\/\/www.redox-os.org\/talks\/", "https:\/\/www.redox-os.org\/talks\/", "363a6295f9bdc0f883ff1616d05b2422", -62135596800, "1612098762298093", "Talks", "Cyberdeck Users Weekly By Jeremy Soller and Paul Miller on May 13, 2020\n FOSDEM 2019 By Robin Randhawa on February 3, 2019\n  Linaro Connect Vancouver 2018 By Jeremy Soller and Robin Randhawa on September 21, 2018\n  The Changelog By Jeremy Soller, Adam Stacoviak and Jerod Santo on January 19, 2018\n \nLunduke Hour By Jeremy Soller and Bryan Lunduke on March 13, 2017", "cyberdeck users weekly by jeremy soller and paul miller on may 13, 2020\n fosdem 2019 by robin randhawa on february 3, 2019\n  linaro connect vancouver 2018 by jeremy soller and robin randhawa on september 21, 2018\n  the changelog by jeremy soller, adam stacoviak and jerod santo on january 19, 2018\n \nlunduke hour by jeremy soller and bryan lunduke on march 13, 2017talkshttps:\/\/www.redox-os.org\/talks\/", "e0c4b204f85cee27beed365ce66cb47f", "e0c4b204f85cee27beed365ce66cb47f", "47"]:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'pub_date' at row 1 /talks\/", "e0c4b204f85cee27beed365ce66cb47f", "e0c4b204f85cee27beed365ce66cb47f", "47"]:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'pub_date' at row 1 in Randhawa on February 3, 2019\n  Linaro Connect Vancouver 2018 By Jeremy Soller and Robin Randhawa on September 21, 2018\n  The Changelog By Jeremy Soller, Adam Stacoviak and Jerod Santo on January 19, 2018\n \nLunduke Hour By Jeremy Soller and Bryan Lunduke on March 13, 2017", "cyberdeck users weekly by jeremy soller and paul miller on may 13, 2020\n fosdem 2019 by robin randhawa on february 3, 2019\n  linaro connect vancouver 2018 by jeremy soller and robin randhawa on september 21, 2018\n  the changelog by jeremy soller, adam stacoviak and jerod santo on january 19, 2018\n \nlunduke hour by jeremy soller and bryan lunduke on march 13, 2017talkshttps:\/\/www.redox-os.org\/talks\/", "e0c4b204f85cee27beed365ce66cb47f", "e0c4b204f85cee27beed365ce66cb47f", "47"]:

SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value for column 'pub_date' at row 1 

Steps to Reproduce

Explain what you did to encounter the issue

  1. Add feed https://redox-os.org/index.xml
  2. Wait for it to be processed

System Information

anoymouserver commented 3 years ago

According to https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fredox-os.org%2Findex.xml the feed uses an invalid pub_date (Mon, 01 Jan 0001 00:00:00 +0000).

The item mentioned in the error message is one of them:

    <item>
     <title>Talks</title>
     <link>https://www.redox-os.org/talks/</link>
     <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>

     <guid>https://www.redox-os.org/talks/</guid>
     <description>Cyberdeck Users Weekly By Jeremy Soller and Paul Miller on May 13, 2020
FOSDEM 2019 By Robin Randhawa on February 3, 2019
 Linaro Connect Vancouver 2018 By Jeremy Soller and Robin Randhawa on September 21, 2018
 The Changelog By Jeremy Soller, Adam Stacoviak and Jerod Santo on January 19, 2018
Lunduke Hour By Jeremy Soller and Bryan Lunduke on March 13, 2017</description>
   </item>

Please notify the feed author to have the error fixed.

CapSel commented 3 years ago

Could you add ignoring of such dates? I encountered another rss with same problem. It seems that authors want to "advertise" themselves.

anoymouserver commented 3 years ago

As of NC News v15.2 negative dates (before 1970) are supported, which fixes the issue. (If it's not urgent, I would wait with the update until the next release, because there were problems with the purging of old items.)

Because the "advertisment" induces unreadable feeds for most parsers, I don't think that this is a very reasonable decision.