Last night I updated www/tt-rss@php83 on FreeBSD-RELEASE-13.2-p11 GENERIC amd64 to the latest version (tt-rss-php83-g20240421,2). The main program itself is working fine, but the update daemon, ttrssd, no longer starts up successfully: # service ttrssd start PHP Fatal error: Cannot redeclare get_pref() (previously declared in /usr/local/www/tt-rss/include/functions.php:44) in /usr/local/www/tt-rss/include/functions.php on line 45 /usr/local/etc/rc.d/ttrssd: ERROR: Unknown database configured: That's the whole thing - there's nothing after the final colon on the last line. I'll point out that the two filenames are the same, the lines are off by one, and at a quick glance by my non-PHP-expert eye only one of the two lines (44) actually declares that function; the other just looks like a line *in* the function. Maybe it's a "include vs. include-once" kind of thing? I'd like to mention for the benefit of anyone who may also be facing this issue that you can work around it by manually running the update script: # su -m www -c "/usr/local/bin/php /usr/local/www/tt-rss/update.php --feeds --quiet" The tt-rss website has several other suggestions for how to update when you're having problems with the standard way. Seems to be written from a Linuxish point of view, but: https://tt-rss.org/wiki/UpdatingFeeds
What does your /usr/local/www/tt-rss/config.php look like?
Here's a redacted version of my /usr/local/www/tt-rss/config.php (which has been unmodified and working fine for a long time): <?php putenv('TTRSS_PHP_EXECUTABLE=/usr/local/bin/php'); putenv("PATH=/usr/local/bin/:" . getenv("PATH")); putenv('TTRSS_DB_TYPE=mysql'); putenv('TTRSS_DB_HOST=redacted'); putenv('TTRSS_DB_NAME=redacted'); putenv('TTRSS_DB_USER=redacted'); putenv('TTRSS_DB_PASS=hunter2'); putenv('TTRSS_DB_PORT=redacted'); putenv('TTRSS_SELF_URL_PATH=redacted');
Ok I was able to reproduce this. Moved to a new machine without a php.ini and it was hiding error reporting.
I'm starting to think the local db check isn't needed. I believe this was only there if ttrssd starts faster than the local database. Since update.php and update2.php would otherwise not retry giving it 10 seconds. However, since we're now using daemon it can retry on termination. Downside it will retry forever until the service is stopped (less of a issue). Upside you don't need to restart the service if you need to stop the database.
Created attachment 250405 [details] Fix files/ttrss_db_check.php.in with Upstream 16b89cc293 broke files/ttrss_db_check.php.in autoload was importing functions.php. testport: ok. 14amd64.
Give this patch a try. I also have something in the oven to just remove the local db check. I'd like to review that a little bit more.
I'm sorry, but I'm a bit swamped at the moment. I will try to get to trying out the patch, but I'm afraid I can't promise that I will get to it soon (or, frankly, at all).
Ok you can get around rebuilding the package and update ttrss_db_check.php directly. Change /usr/local/www/tt-rss/ttrss_db_check.php line with functions.php from require_once "/usr/local/www/tt-rss/include/functions.php"; to require_once "/usr/local/www/tt-rss/include/autoload.php"; and run php -f /usr/local/www/tt-rss/ttrss_db_check.php and expect to get your database type pgsql or mysql
I just tried the direct modification of ttrss_db_check.php. It then did, in fact, print out mysql when run. I then tried starting up ttrssd, which seems to have worked... not yet sure if it's actually updating stuff, but it is running*, so I'm guessing it probably is. *: Speaking of ttrssd running: Would it be possible to please enable the "status" and "onestatus" commands for it? The lack of them has been a minor annoyance for me for quite some time. Although minor, I figured that I might as well mention it. Thanks.
Re: "I then tried starting up ttrssd, which seems to have worked... not yet sure if it's actually updating stuff, but it is running*, so I'm guessing it probably is.": I just noticed a feed that has actually been updated.
I can add status to the todo list. Best to commit this ASAP since it's broken in the current state.
(In reply to Derek Schrock from comment #11) Great - thanks again!
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=fa9f289eb033f95f2f5029498c33b3eb765d1ef0 commit fa9f289eb033f95f2f5029498c33b3eb765d1ef0 Author: Derek Schrock <dereks@lifeofadishwasher.com> AuthorDate: 2024-06-04 06:45:25 +0000 Commit: Alexander Leidinger <netchild@FreeBSD.org> CommitDate: 2024-06-04 06:47:11 +0000 www/tt-rss: Only include functions.php via autoload.php - Upstream 16b89cc293 broke files/ttrss_db_check.php.in PR: 278761 www/tt-rss/Makefile | 1 + www/tt-rss/files/ttrss_db_check.php.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
(In reply to Robert William Vesterman from comment #12) You can checkout status update here. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279803