nextcloud / news

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

HTTP 500 error after adding https://geneva.cs.umd.edu/papers/, completely breaking this app #2797

Open Mynacol opened 4 days ago

Mynacol commented 4 days ago

IMPORTANT

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

Explain the Problem

I tried to add the website https://geneva.cs.umd.edu/papers/ as new feed (from an android client app). That seemed to work fine, but any reload of the News webpage or unread items list in the android client returns a HTTP 500 error. The feed I added is seemingly valid. The feed https://geneva.cs.umd.edu/index.xml is also affected (and also valid and contains items). Still, the error log shows that the feed title is null, leading to the HTTP error. The database has created the following entry in oc_news_feeds

 id  | folder_id | user_id |  last_modified   |             url_hash             |                                                                                                                                                                                                                                                                    url                                                                                                                                                                                                                                                                     |                                                                                                                                                                                                                                                                  location                                                                                                                                                                                                                                                                  |                                                    title                                                     |                                                                          link                                                                           |                                                                                                                     favicon_link                                                                                                                     |       http_last_modified        |   added    | articles_per_update | update_error_count |                                                                                                   last_update_error                                                                                                    | basic_auth_user | basic_auth_password | deleted_at | prevent_update | pinned | full_text_enabled | ordering | update_mode
 703 |        21 | user    | 1728466527257876 | fd1002fc21c325512ae14a795de48a1f | https://geneva.cs.umd.edu/papers/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | https://geneva.cs.umd.edu/papers/                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |                                                                                                              |                                                                                                                                                         |                                                                                                                                                                                                                                                      |                                 | 1728466524 |                   0 |                  1 | malformed xml string. parsing error : DOMDocument::loadXML(): Specification mandates value for attribute async in Entity, line: 64 (2)                                                                                 |                 |                     |          0 | f              | f      | f                 |        0 |           0

Setting the title column in the database to a string fixes this error.

Steps to Reproduce

Explain what you did to encounter the issue

  1. Add https://geneva.cs.umd.edu/papers/ as new feed (probably uses https://geneva.cs.umd.edu/papers/index.xml as it is referenced with a rel="alternate" type="application/rss+xml" tag)
  2. Try to open the main News webpage view (or refresh the list of unread elements in another client)
  3. A HTTP 500 error code is returned

System Information

Contents of nextcloud/data/nextcloud.log ```json {"reqId":"70SaVrXj9TLEvCULJ4k0","level":3,"time":"2024-10-09T09:57:04+00:00","remoteAddr":"[redacted]","user":"user","app":"index","method":"GET","url":"/apps/news/items?limit=40&oldestFirst=false&search=&showAll=false&type=6","message":"{\"Exception\":\"Exception\",\"Message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\",\"Code\":0,\"Trace\":[{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/App.php\",\"line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/Route/Router.php\",\"line\":331,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"Line\":170,\"Previous\":{\"Exception\":\"TypeError\",\"Message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75\",\"Code\":0,\"Trace\":[{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php\",\"line\":75,\"function\":\"setTitle\",\"class\":\"OCA\\\\News\\\\Db\\\\Feed\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/QBMapper.php\",\"line\":321,\"function\":\"fromRow\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\Entity\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/QBMapper.php\",\"line\":339,\"function\":\"mapRowToEntity\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\QBMapper\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/FeedMapperV2.php\",\"line\":69,\"function\":\"findEntities\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\QBMapper\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Service/FeedServiceV2.php\",\"line\":101,\"function\":\"findAllFromUser\",\"class\":\"OCA\\\\News\\\\Db\\\\FeedMapperV2\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Controller/ItemController.php\",\"line\":141,\"function\":\"findAllForUser\",\"class\":\"OCA\\\\News\\\\Service\\\\FeedServiceV2\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":232,\"function\":\"index\",\"class\":\"OCA\\\\News\\\\Controller\\\\ItemController\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":138,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/App.php\",\"line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/Route/Router.php\",\"line\":331,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php\",\"Line\":561},\"message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\",\"exception\":{},\"CustomMessage\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\"}","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0","version":"29.0.7.1"} {"reqId":"7xoMsPxNiKuVCSmH5zUb","level":3,"time":"2024-10-09T09:57:05+00:00","remoteAddr":"[redacted]","user":"user","app":"index","method":"GET","url":"/apps/news/feeds","message":"{\"Exception\":\"Exception\",\"Message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\",\"Code\":0,\"Trace\":[{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/App.php\",\"line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/Route/Router.php\",\"line\":331,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"Line\":170,\"Previous\":{\"Exception\":\"TypeError\",\"Message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75\",\"Code\":0,\"Trace\":[{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php\",\"line\":75,\"function\":\"setTitle\",\"class\":\"OCA\\\\News\\\\Db\\\\Feed\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/QBMapper.php\",\"line\":321,\"function\":\"fromRow\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\Entity\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/QBMapper.php\",\"line\":339,\"function\":\"mapRowToEntity\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\QBMapper\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/FeedMapperV2.php\",\"line\":69,\"function\":\"findEntities\",\"class\":\"OCP\\\\AppFramework\\\\Db\\\\QBMapper\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Service/FeedServiceV2.php\",\"line\":101,\"function\":\"findAllFromUser\",\"class\":\"OCA\\\\News\\\\Db\\\\FeedMapperV2\",\"type\":\"->\"},{\"file\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Controller/FeedController.php\",\"line\":83,\"function\":\"findAllForUser\",\"class\":\"OCA\\\\News\\\\Service\\\\FeedServiceV2\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":232,\"function\":\"index\",\"class\":\"OCA\\\\News\\\\Controller\\\\FeedController\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/Http/Dispatcher.php\",\"line\":138,\"function\":\"executeController\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/AppFramework/App.php\",\"line\":184,\"function\":\"dispatch\",\"class\":\"OC\\\\AppFramework\\\\Http\\\\Dispatcher\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/private/Route/Router.php\",\"line\":331,\"function\":\"main\",\"class\":\"OC\\\\AppFramework\\\\App\",\"type\":\"::\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/base.php\",\"line\":1058,\"function\":\"match\",\"class\":\"OC\\\\Route\\\\Router\",\"type\":\"->\"},{\"file\":\"/nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/index.php\",\"line\":49,\"function\":\"handleRequest\",\"class\":\"OC\",\"type\":\"::\"}],\"File\":\"/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php\",\"Line\":561},\"message\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\",\"exception\":{},\"CustomMessage\":\"OCA\\\\News\\\\Db\\\\Feed::setTitle(): Argument #1 ($title) must be of type string, null given, called in /nix/store/sccg58vzrqkb5j2c026h46hcis6jn3hg-nextcloud-29.0.7/lib/public/AppFramework/Db/Entity.php on line 75 in file '/nix/store/wmfrrzp8zrm0wx38ay5npjg9ax38wqba-source-patched/lib/Db/Feed.php' line 561\"}","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0","version":"29.0.7.1"} ```

The error points at https://github.com/nextcloud/news/blob/25.0.0-alpha9/lib/Db/Feed.php#L561, which extends the core Nextcloud Entity class, which enforces that title is a real string (not null).

The browser console is irrelevant here, but for completeness sake:

Contents of Browser Error Console Read http://ggnome.com/wiki/Using_The_Browser_Error_Console if you are unsure what to put here ``` Unified search initialized! UnifiedSearch.vue:54 XHRGET https://cloud.mynacol.xyz/apps/news/items?limit=40&oldestFirst=false&search=&showAll=false&type=6 [HTTP/2 500 51ms] session heartbeat polling started session-heartbeat.js:103:9 Registering notifications container as a menu NotificationsApp.vue:237 Browser does not support notifications NotificationsApp.vue:474 Polling interval updated to 30000 NotificationsApp.vue:443 Started background fetcher as session_keepalive is enabled NotificationsApp.vue:293 Got notification data, restoring default polling interval. NotificationsApp.vue:399 Contacts Array(26) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ] UnifiedSearchModal.vue:279 XHRGET https://cloud.mynacol.xyz/apps/news/feeds [HTTP/2 500 58ms] Search providers Array(15) [ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ] UnifiedSearchModal.vue:275 Uncaught (in promise) Object { stack: Getter & Setter, message: Getter & Setter, name: Getter & Setter, code: Getter & Setter, config: Getter & Setter, request: Getter & Setter, response: Getter & Setter, … } vuex.esm.js:542:13 Uncaught (in promise) Object { stack: Getter & Setter, message: Getter & Setter, name: Getter & Setter, code: Getter & Setter, config: Getter & Setter, request: Getter & Setter, response: Getter & Setter, … } main.js:33:16 ```
SMillerDev commented 15 hours ago

Seems related to https://github.com/nextcloud/news/pull/2745. But that would mean that we can't have feeds with empty titles.