Af_comics breaks installation after upgrade

  • [ ] I’m using stock docker compose setup, unmodified.
  • [ ] I’m using docker compose setup, with modifications (modified .yml files, third party plugins/themes, etc.) - if so, describe your modifications in your post. Before reporting, see if your issue can be reproduced on the unmodified setup.
  • [ ] I’m not using docker on my primary instance, but my issue can be reproduced on the aforementioned docker setup and/or official demo.
  • [X] I’m running tt-rss in host mode on a shared hosting.

I hope it’s still ok to ask for support for host mode (i.e. non-docker) installations. Before posting, to avoid wasting everyone’s time, I’ve tried to spin a fresh installation of tt-rss on the same environment on a different subdomain to make sure that everything works as intended in my environment, and indeed it does. The problem below is only related to my particular install and upgrade, it’s not a general issue with the installation environment.

Until yesterday I was running a very old version of tt-rrs on a DreamHost shared hosting (schema was v. 140, the config file still had define() rather than putenv() - that old). As I’m now forced to update the environment to php 8.1 and the old install didn’t work with it, I’ve tried to update tt-rss to the latest version. I’ve updated the git repo (git pull origin master), modified the config file to the new definitions using putenv(), and I’ve run the --update-schema script. After the upgrade surprisingly things didn’t explode, but I have an annoying issue.

I have the af_comics plugin enabled and after the upgrade the website opened up in safe mode (although I didn’t enable safe mode) and the cron job failed to update feeds, with the following error on each of them:

Declaration of Af_Feedmod::hook_prefs_tabs($args) must be compatible with Plugin::hook_prefs_tabs()

If I disable the af_comics plugin in the preferences, log out, enable safe mode on next log in, log out, log in again without safe mode everything works correctly, except of course the features of af_comics are not there anymore.

What can I do to make this error go away and keep using the plugin?

As I said, everything works correctly in a fresh install, so it’s not something quite reproducible by others as it’s tied to this particular upgrade. However, I’m happy to provide a dump of the mysql database and of the config file if it can help to reproduce the issue in a different environment.

  • Tiny Tiny RSS version: schema 147; git commit id: cddbf5bf5a7e2c433275a3bec089f318d4f211af
  • Platform versions: DreamHost shared hosting (8.0.28-0ubuntu0.20.04.3); PHP 8.1.9; mysql/mariadb Ver 14.14 Distrib 5.7.41 (I think)

this looks like a different plugin (af_feedmod) being broken, not af_comics. check plugins.local.

Hi. I did notice that the plugin mentioned in the error was different, but af_feedmod is not even present in my plugin list. I assumed maybe af_comics depended on this one somehow. I’m not quite sure what you mean with “check plugins.local”, however this is the content of the plugins.local folder of my installation:

index.html
large_apod

af_feedmod is present in the plugins folder of the installation, though. Should I remove it?

Does tt-rss save anything profile-related on disk? I was thinking that I may try to backup the config.php file, delete all files of the previous install (but not the database), do a fresh git pull and restore the config.php file to reconnect to the existing database. Would I lose something of my current installation by doing that?

It sounds like you have some custom plugins (af_feedmod, at least) in plugins (intended for bundled plugins). Although not strictly required, you might want to move the directories you don’t see in https://dev.tt-rss.org/tt-rss/tt-rss/src/branch/master/plugins to plugins.local (intended for non-bundled plugins) to keep things organized. If you’re not using certain custom plugins (e.g. af_feedmod; don’t move or remove the bundled ones) I’d suggest removing them.

If you do find you still need/want af_feedmod, you could probably just replace function hook_prefs_tabs($args) with function hook_prefs_tabs() (remove $args) in af_feedmod/init.php. It looks like that plugin is no longer maintained.

it’s not present in the list because tt-rss can’t load the class from php file because it’s incompatible.

like @wn_name said you’ll need to either remove af_feedmod folder or patch it to current function definition.

Thanks to both of you for your suggestions. I’ve removed the af_feedmod folder and the problem seems to have disappeared. I’m still not quite sure why disabling af_comics would remove the problem if it was with a different plugin entirely, but I’m glad it works now.