Page 1 of 1

tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 12:39
by udzguru
Hello everyone,

After upgrading my xUbuntu release from 16.10 to 17.04 my tt-rss kept throwing errors and didn't function properly anymore. I dug around a little in the error logs and found two different errors flooding my logs.

Here I want to describe how I resolved/worked around the errors and got my tt-rss running again. Perhaps other users might encounter these problems, too and find it helpful.

First error was:

Code: Select all

[Sat Apr 15 10:57:59.607604 2017] [:error] [pid 22782] [client <redactedip>:39106] PHP Fatal error:  Uncaught Error: Undefined class constant 'HOOK_ENCLOSURE_ENTRY' in /usr/share/tt-rss/www/plugins/af_zz_imgproxy/init.php:20\nStack trace:\n#0 /usr/share/tt-rss/www/classes/pluginhost.php(191): Af_Zz_ImgProxy->init(Object(PluginHost))\n#1 /usr/share/tt-rss/www/include/functions.php(843): PluginHost->load('af_comics,af_re...', 3, 1)\n#2 /usr/share/tt-rss/www/include/functions.php(885): load_user_plugins(1)\n#3 /usr/share/tt-rss/www/index.php(48): login_sequence()\n#4 {main}\n  thrown in /usr/share/tt-rss/www/plugins/af_zz_imgproxy/init.php on line 20, referer: https://<redactedurl>/tt-rss/prefs.php

Unfortunately I haven't found a real solution for this problem but to rename /plugins/af_zz_imgproxy/init.php (to init.ph_) and thus disabling/removing the plugin.

Perhaps someone with a little deeper understanding of the functioning of tt-rss could have a look at this?

Second error was:

Code: Select all

[Fri Apr 14 07:14:39.240665 2017] [:error] [pid 17804] [client <redactedip>:40786] PHP Fatal error:  Uncaught InvalidArgumentException: Select_string only accepts integers: 2 in /usr/share/tt-rss/www/lib/gettext/gettext.php:354\nStack trace:\n#0 /usr/share/tt-rss/www/lib/gettext/gettext.php(388): gettext_reader->select_string('2')\n#1 /usr/share/tt-rss/www/lib/gettext/ gettext_reader->ngettext('comment', 'comments', '2')\n#2 /usr/share/tt-rss/www/classes/feeds.php(749): _ngettext('comment', 'comments', '2')\n#3 /usr/share/tt-rss/www/classes/feeds.php(937): Feeds->format_headlines_list(7, '', 'unread', 30, false, '', 0, '', false, true, '', false)\n#4 /usr/share/tt-rss/www/backend.php(123): Feeds->view()\n#5 {main}\n  thrown in /usr/share/tt-rss/www/lib/gettext/gettext.php on line 354

This was a little harder to knack. I ended up replacing the tt-rss-supplied gettext.php with one from (which seems to be the source for the gettext lib used in tt-rss). The launchpad file only differs in one line (i.e. line 101) to the one supplied by tt-rss ... But this seems to do the trick.

Code: Select all

~$ diff gettext.php.orig gettext.php
<   function __construct($Reader, $enable_cache = true) {
>   function gettext_reader($Reader, $enable_cache = true) {

where gettext.php.orig is the tt-rss-supplied file and gettext.php is the file from the launchpad.

I know this is an external library and therefore no support is given for it here. But as my programming skills are very very low I don't exactly know why this works. If anybody can and wants to explain it to me I would be very happy to learn the difference.

Just for information here my server setup:

Code: Select all

~$ lsb_release -a
No LSB modules are available.
Distributor ID:   Ubuntu
Description:   Ubuntu 17.04
Release:   17.04
Codename:   zesty

~$ uname -a
Linux udzserver 4.10.0-19-generic #21-Ubuntu SMP Thu Apr 6 17:04:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

~$ php --version
PHP 7.0.15-1ubuntu4 (cli) (built: Feb 28 2017 21:33:59) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.15-1ubuntu4, Copyright (c) 1999-2017, by Zend Technologies

~$ mysql --version
mysql  Ver 14.14 Distrib 5.7.17, for Linux (x86_64) using  EditLine wrapper

~$ git show
commit b8f23d68484d8c0672d6c01a1344804dd5aba17f
Merge: 0eed023e 32024bdf
Author: Andrew Dolgov <redactedmailaddress>
Date:   Mon Apr 10 19:46:16 2017 +0300

    Merge branch 'fix_af_comic_tfd_filter' into 'master'
    Fix the TFD filter and add Married to the sea
    A while ago TFD changed the html for the comics page and broke the filter.
    Here is a patch to show the comics in the feed again, as well as add Married to the Sea (sister site)
    See merge request !50

Re: tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 12:47
by fox
the gettext __construct() is a known php change although i thought i replaced all of those.

your first problem and actual tt-rss path makes me think you either have both packaged and git tt-rss installed or using a broken package of some kind (php apc cache of some kind gone crazy? idk really). because regardless of ubuntu or php versions having that constant undeclared on recent git trunk is impossible, it should be at classes/pluginhost.php:54: ... st.php#L54

Re: tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 13:40
by udzguru

ok. To be honest this once was a pre-packaged tt-rss instance. But I changed it to git and (at least thought) I got everything sorted out.

Not sure, but I think I even deleted all the files and git-pulled them to be recent. This was done back when tt-rss switched from release to git.

But you were correct. I added the definition of the hook manually (I am a little confused why this wasn't done by git in fact) and now the plugin works again.

Thanks a lot for your input!

Re: tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 13:47
by fox
i strongly suggest you kill this abomination and just git clone from scratch at this point, otherwise god only knows what other problems you might run into. keep your config.php and database.

e: given that your problems started after upgrading i hope you didn't just replace package files while keeping it installed, thus causing it to update with your ubuntu version and partially downgrade the files. because holy lol if you did that.

Re: tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 14:57
by fox
btw re: gettext, what you replaced the file with is actually an old-style deprecated constructor variant, so i'm not sure why your problem got fixed.

Old style constructors are DEPRECATED in PHP 7.0, and will be removed in a future version. You should always use __construct() in new code.

i'm not surprised tho because of the whole abomination thing.

Re: tt-rss problems after xUbuntu 16.10 to 17.04 upgrade + my solutions

Posted: 15 Apr 2017, 15:36
by udzguru
I am just making everything new.

git-cloned to a fresh directory in /var/www/html, rewrote the service and apache config. so far everything seems to be working just fine and I see no new errors in my error.log.

I should've done this back when you switched to rolling release via git. But it seemed so much more comfortable to just replace the files via git and jump onto the rolling release train this way.

BTW: I removed the repository I used to install tt-rss back then the moment I switched to rolling release. So there should've been no interference from system packages anymore. Obviously a clear should have.

Thanks for your support! I really appreciate your work.