Feed updating broken with php7.2

Describe the problem you’re having:
I recently updated my php install from 7.1 to 7.2 and everything seemed to be working fine, initially, but my feeds seemed to stopped updating. Switching back to 7.1 lead to load of new articles being downloaded, so the feed updating seemed indeed to have stopped.

The updater output looks as always to me, without throwing any errors, so does the webserver log.
There are loads of warnings in the built-in error system, though. Like for example:

E_WARNING (2): classes/feedparser.php:34
DOMDocument::loadXML(): Empty string supplied as input

  1. classes/feedparser.php(34): loadXML()
  2. classes/rssutils.php(254): __construct()
  3. classes/rssutils.php(308): set_basic_feed_info(852)
  4. classes/rssutils.php(175): update_rss_feed(852, 1, )
  5. update.php(198): update_daemon_common(50)

E_WARNING (2): classes/pref/prefs.php:836
count(): Parameter must be an array or an object that implements Countable

  1. classes/pref/prefs.php(836): ttrss_error_handler(2, count(): Parameter must be an array or an object that implements Countable, classes/pref/prefs.php, 836, Array)
  2. backend.php(123): index()

E_WARNING (2): classes/api.php:248
Use of undefined constant is_numeric - assumed ‘is_numeric’ (this will throw an Error in a future version of PHP)

  1. classes/api.php(248): ttrss_error_handler(2, Use of undefined constant is_numeric - assumed ‘is_numeric’ (this will throw an Error in a future version of PHP), classes/api.php, 248, Array)
  2. api/index.php(80): updateArticle()

E_WARNING (2): classes/api.php:248
Use of undefined constant is_numeric - assumed ‘is_numeric’ (this will throw an Error in a future version of PHP)

  1. classes/api.php(248): ttrss_error_handler(2, Use of undefined constant is_numeric - assumed ‘is_numeric’ (this will throw an Error in a future version of PHP), classes/api.php, 248, Array)
  2. api/index.php(80): updateArticle()

The first two warning are repeater quite often.

If possible include steps to reproduce the problem:
Might be as simple as running tt-rss with php 7.2, maybe there’s more to it.

tt-rss version (including git commit id):
17.4-219-gf53b23c1a

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
Arch Linux, php 7.1 and 7.2, MySQL (MariaDB 10.1.29)

that’s interesting, i can’t find any mention of is_numeric() being deprecated or removed in any version of php.

oh. maybe you should consider running your server stuff on a platform that is meant for actual server use, like centos or debian.

I’ve been thinking about migrating to NixOS, actually.

Anyways, has any other testing been done with 7.2 so far? I found a thread on here, which is where I got the tip to use “–decrypt-feeds” from, since mcrypt was dropped, but besides that?

Edit: If you want to I have a debian host, I can dump my db, import it there and install php7.2 on it and try it. I doubt it’ll help, though.

i don’t think debian ships php 7.2 in anything approaching stable so no, it probably won’t help

imo as an arch linux user you should be able to use your valuable power user skills to figure out why is_numeric() is missing in your php install without any deprecation mentions on the internet and do accordingly

so far i’m not convinced that your problem is caused by php 7.2 per se

you don’t say

I’ve been using ttrss (latest git version) with PHP 7.2 on FreeBSD for around a fortnight now and have seen no problems at all. It just works fine. And I have deprecated and strict warnings enabled as well.

The only issue is with a 3rd party plugin (fever API) which is now logging the below error. But this isn’t core ttrss. And this plugin will probably break much worse when the PDO database stuff goes live.

PHP Warning: Use of undefined constant ADD_ATTACHED_FILES - assumed ‘ADD_ATTACHED_FILES’ (this will throw an Error in a future version of PHP) in /var/www/ttrss/plugins.local/repos/fever/fever/fever_api.php on line 560

If you rely on the Fever API I would hold off updating to the PDO changes as it’s almost certain to break. I’m not sure that plugin is actively developed anymore. Maybe I’ll take a quick look if I have time; no promises though.

not necessarily, legacy api is still fully available to plugins. the warning above is just some undeclared constant.

unless plugin interferes with pdo transactions it should just work.

you will see legacy connection warning in the log, just ignore it.

E_WARNING (2): classes/api.php:248
Use of undefined constant is_numeric - assumed ‘is_numeric’ (this will throw an Error in a future version of PHP)the underlying

The mistake in classes/api.php:248
$article_ids = array_filter(explode(“,”, $this->dbh->escape_string($_REQUEST[“article_ids”])), is_numeric);

is that the last parameter isn’t quoted: PHP: Callbacks / Callables - Manual

PHP errors and warnings leave much room for improvement.

that probably is no longer in master btw

and yes it’s a very misleading error message

Yeah, I get that. My comment was because, to my memory, the Fever API interacted with the database directly for everything and I’m not sure to what extent the PDO changes would impact that.

Unfortunately the fever api plugin doesn’t use the API. It uses SQL commands directly to the database. I did say when the author first wrote it that it would be better if it spoke to the official API.

well internally there’s almost no database changes so if plugin is self contained it should continue working imo

i think we’re hijacking the thread

Hm… so I upgraded my php again and updated to newest master (d0cce0c7a431d886403632ef94add650363d4ef6) and it seems to be working, so it might have been an issue with my installation, after all. Not sure exactly what I did. Possibly upgraded php extensions and stuff, but not php itself (oops). I should take a look at the logs. My php install was kind of a mess, because it’s also running nextcloud which does not support 7.2 yet, in a stable release…

The only warning that remains now is the “count(): Parameter must be an array or an object that implements Countable” one. That seems harmless, though.

I’ll report back if the updater breaks again…

I hope you’ll excuse my (most likely) wrong conclusion that this was related to 7.2. I’m not a php guy, so debugging these things is always hard for me.

i’ll take a look at that, basically it’s just count() being used on a non-array, no big deal

it was, it’s just the error message was poorly designed and thus misleading.

re: countable warning

if you still get this on latest trunk post the warning again because the lines have moved and there’s nothing of note at line 836.

The warnings now mention line 817 and 757 in classes/pref/prefs.php, which both read as:
if (count($tmppluginhost->get_all($plugin)) > 0) {

thanks, should be fixed now i think.