News: No feeds returned for folder

Created on 14 Feb 2021  路  4Comments  路  Source: nextcloud/news

IMPORTANT

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

  • [x] I have read the CONTRIBUTING.md and followed the provided tips
  • [x] I accept that the issue will be closed without comment if I do not check here
  • [x] I accept that the issue will be closed without comment if I do not fill out all items in the issue template.

Explain the Problem

What problem did you encounter?

__Internal server error!__
InvalidArgumentException: Only strings, Literals and Parameters are allowed

Steps to Reproduce

Explain what you did to encounter the issue

  1. open web app
  2. select folder (with feeds)
  3. see Internal server error!

System Information

  • News app version: master (8ca7ef7)
  • Nextcloud version: 20.0.7
  • Cron type: (system cron/python updater/...)
  • PHP version: 7.3.25
  • Database and version:
  • Browser and version:
  • OS and version:


Contents of nextcloud/data/nextcloud.log

``json { "reqId": "mIdGWiwzntSZ9oalN4VR", "level": 3, "time": "2021-02-14T20:34:45+00:00", "remoteAddr": "127.0.0.1", "user": "anoymouserver", "app": "index", "method": "GET", "url": "/apps/news/items?id=3&limit=40&oldestFirst=false&search=&showAll=true&type=1", "message": { "Exception": "InvalidArgumentException", "Message": "Only strings, Literals and Parameters are allowed", "Code": 0, "Trace": [{ "file": "/var/www/cloud/lib/private/DB/QueryBuilder/ExpressionBuilder/ExpressionBuilder.php", "line": 140, "function": "quoteColumnName", "class": "OC\\DB\\QueryBuilder\\QuoteHelper", "type": "->", "args": [3] }, { "file": "/var/www/cloud/apps/news/lib/Db/ItemMapperV2.php", "line": 476, "function": "eq", "class": "OC\\DB\\QueryBuilder\\ExpressionBuilder\\ExpressionBuilder", "type": "->", "args": ["feeds.folder_id`", 3]
}, {
"file": "/var/www/cloud/apps/news/lib/Service/ItemServiceV2.php",
"line": 368,
"function": "findAllFolder",
"class": "OCA\News\Db\ItemMapperV2",
"type": "->",
"args": ["anoymouserver", 3, 40, 0, false, false, []]
}, {
"file": "/var/www/cloud/apps/news/lib/Controller/ItemController.php",
"line": 152,
"function": "findAllInFolderWithFilters",
"class": "OCA\News\Service\ItemServiceV2",
"type": "->",
"args": ["anoymouserver", 3, 40, 0, false, false, []]
}, {
"file": "/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 169,
"function": "index",
"class": "OCA\News\Controller\ItemController",
"type": "->",
"args": [1, 3, 40, 0, true, false, ""]
}, {
"file": "/var/www/cloud/lib/private/AppFramework/Http/Dispatcher.php",
"line": 100,
"function": "executeController",
"class": "OC\AppFramework\Http\Dispatcher",
"type": "->",
"args": [{
"__class__": "OCA\News\Controller\ItemController"
}, "index"]
}, {
"file": "/var/www/cloud/lib/private/AppFramework/App.php",
"line": 152,
"function": "dispatch",
"class": "OC\AppFramework\Http\Dispatcher",
"type": "->",
"args": [{
"__class__": "OCA\News\Controller\ItemController"
}, "index"]
}, {
"file": "/var/www/cloud/lib/private/Route/Router.php",
"line": 309,
"function": "main",
"class": "OC\AppFramework\App",
"type": "::",
"args": ["OCA\News\Controller\ItemController", "index", {
"__class__": "OC\AppFramework\DependencyInjection\DIContainer"
}, {
"_route": "news.item.index"
}
]
}, {
"file": "/var/www/cloud/lib/base.php",
"line": 1008,
"function": "match",
"class": "OC\Route\Router",
"type": "->",
"args": ["/apps/news/items"]
}, {
"file": "/var/www/cloud/index.php",
"line": 37,
"function": "handleRequest",
"class": "OC",
"type": "::",
"args": []
}
],
"File": "/var/www/cloud/lib/private/DB/QueryBuilder/QuoteHelper.php",
"Line": 62,
"CustomMessage": "--"
},
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0",
"version": "20.0.7.1",
"id": "6029898465050"
}

API bug regression

Most helpful comment

The 'offset' however seems to be the lowest id of the currently displayed items (if most recent on top) and not a real offset (number of items which should be skipped)

This app really seems to be written around a desire for the most complex implementations. I'll see if that is fixable.

All 4 comments

Just noticed that the loading of further items when scrolling down doesn't work either.
The following requests are copied for the 'Unread articles' section, but the issue also occures for a single feed.

  1. https://cloud.example.com/apps/news/items?limit=40&oldestFirst=false&search=&showAll=true&type=6
    first request always returns correct data:
    jsonc {"newestItemId":129155,"feeds":[/* list of feeds */],"starred":543,"items":[/* list of items */]}
  2. https://cloud.example.com/apps/news/items?limit=40&offset=129116&oldestFirst=false&showAll=true&type=6
    following requests (after scrolling down) return empty data:
    jsonc {"items":[]}

Furthermore the 'All articles' section doesn't return any items at all.

  1. https://cloud.example.com/apps/news/items?limit=40&oldestFirst=false&search=&showAll=true&type=3
    jsonc {"newestItemId":129155,"feeds":[/* list of feeds */],"starred":543}

https://cloud.example.com/apps/news/items?limit=40&offset=129116&oldestFirst=false&showAll=true&type=6
following requests (after scrolling down) return empty data:

Do you even have that many items in your DB?

Furthermore the 'All articles' section doesn't return any items at all.
https://cloud.example.com/apps/news/items?limit=40&oldestFirst=false&search=&showAll=true&type=3

I didn't realize this was a possible type. Fixed soon.

My test database currently contains 10352 items for 105 feeds (not all unread).
More than 40 unread per folder aren't unusual. The 'offset' however seems to be the lowest id of the currently displayed items (if most recent on top) and not a real offset (number of items which should be skipped)

Highest id is 129155, since there are 40 displayed, the last of them is 129116 (offset from my request url).

The 'offset' however seems to be the lowest id of the currently displayed items (if most recent on top) and not a real offset (number of items which should be skipped)

This app really seems to be written around a desire for the most complex implementations. I'll see if that is fixable.

Was this page helpful?
0 / 5 - 0 ratings