DOMNodeList not found

Errors in log after updating this morning. Seems to pop up every 20 minutes, coinciding with update.php being called:

$ sudo crontab -lu www-data | grep reader
*/20 * * * * /var/www/example.com/html/reader/update.php --feeds

The error:

mysql> select * from ttrss_error_log;
[...]
|  5 |      NULL |     1 | Uncaught Error: Class 'andreskrey\Readability\Nodes\DOM\DOMNodeList' not found in /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php:171
Stack trace:
#0 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeTrait.php(425): andreskrey\Readability\Nodes\NodeUtility::filterTextNodes(Object(DOMNodeList))
#1 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(736): andreskrey\Readability\Nodes\DOM\DOMElement->hasSingleTagInsideElement('p')
#2 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(159): andreskrey\Readability\Readability->getNodes(Object(andreskrey\Readability\Nodes\DOM\DOMElement))
#3 /var/www/example.com/html/reader/plugins/af_readability/init.php(188): andreskrey\Readability\Readability->parse('<!DOCTYPE html>...')
#4 /var/www/example.com/html/reader/plugins/af_readability/init.php(220): Af_ | plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php |    171 |         | 2019-08-16 11:20:33 |
|  6 |      NULL |     1 | Uncaught Error: Class 'andreskrey\Readability\Nodes\DOM\DOMNodeList' not found in /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php:171
Stack trace:
#0 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeTrait.php(425): andreskrey\Readability\Nodes\NodeUtility::filterTextNodes(Object(DOMNodeList))
#1 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(736): andreskrey\Readability\Nodes\DOM\DOMElement->hasSingleTagInsideElement('p')
#2 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(159): andreskrey\Readability\Readability->getNodes(Object(andreskrey\Readability\Nodes\DOM\DOMElement))
#3 /var/www/example.com/html/reader/plugins/af_readability/init.php(188): andreskrey\Readability\Readability->parse('<!DOCTYPE html>...')
#4 /var/www/example.com/html/reader/plugins/af_readability/init.php(220): Af_ | plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php |    171 |         | 2019-08-16 11:40:02 |
|  7 |      NULL |     1 | Uncaught Error: Class 'andreskrey\Readability\Nodes\DOM\DOMNodeList' not found in /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php:171
Stack trace:
#0 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeTrait.php(425): andreskrey\Readability\Nodes\NodeUtility::filterTextNodes(Object(DOMNodeList))
#1 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(736): andreskrey\Readability\Nodes\DOM\DOMElement->hasSingleTagInsideElement('p')
#2 /var/www/example.com/html/reader/plugins/af_readability/vendor/andreskrey/Readability/Readability.php(159): andreskrey\Readability\Readability->getNodes(Object(andreskrey\Readability\Nodes\DOM\DOMElement))
#3 /var/www/example.com/html/reader/plugins/af_readability/init.php(188): andreskrey\Readability\Readability->parse('<!DOCTYPE html>...')
#4 /var/www/example.com/html/reader/plugins/af_readability/init.php(220): Af_ | plugins/af_readability/vendor/andreskrey/Readability/Nodes/NodeUtility.php |    171 |         | 2019-08-16 12:00:02 |

I don’t seem to see any other symptoms however - everything appears to be working as normal.

Versions etc..

tt-rss version (including git commit id):

# git rev-parse --verify HEAD
88077702f3a517a0c5b3dbf52acc3f2f51bc6c62

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:

# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
# uname -a
Linux li1004-82 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

# php --version
PHP 7.2.19-0ubuntu0.18.04.1 (cli) (built: Jun  4 2019 14:48:12) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.2.19-0ubuntu0.18.04.1, Copyright (c) 1999-2018, by Zend Technologies

# mysql --version
mysql  Ver 14.14 Distrib 5.7.27, for Linux (x86_64) using  EditLine wrapper

# psql --version
psql (PostgreSQL) 10.9 (Ubuntu 10.9-0ubuntu0.18.04.1)

# grep DB_TYPE config.php
        define('DB_TYPE', 'mysql');

oops, https://git.tt-rss.org/fox/tt-rss/commit/3e4701116d9a7a2b93646f2c9aed80b63175d206

Event Log shows this when reability is enabled:

Error Filename Message User Date
E_PARSE (4) plugins/af_readability/vendor/andreskrey/Readability/Nodes/DOM/DOMNodeList.php:68 syntax error, unexpected ‘:’, expecting ‘;’ or ‘{’ 8:27

Then update daemon has hick ups and won’t refresh anymore.

looks like php-readability library started to use syntax specific to php 7 (explicit types).

since php7 was released in 2015 or so, i’m going to increase version requirements for af_readability because people might as well upgrade already.

for people running ancient versions of php, it should be possible to provide a separate plugin with an older version of readability library, i think.

tell me if this works: https://git.tt-rss.org/fox/ttrss-readability-legacy

e: it probably should be obvious, but don’t enable both readability plugins at the same time.

Thank you, the legacy plugin works.