Describe the problem you’re having:

Since some days, I get a lot of errors reported:
Update process for feed 8 ([…], owner UID: 1) terminated with non-zero exit code: -1 ().

If possible include steps to reproduce the problem:

tt-rss version (including git commit id):

v20.09-de22464

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

CentOS 7.8.2003, PHP 7.2.5, mysql Ver 15.1 Distrib 5.5.65-MariaDB

Please provide any additional information below:

In general, the updates are performed. tt-rss behaves as usual and shows me new messages in all my feeds. But the error messages are inconvenient.

you need to check affected feeds to see why they specifically fail to update. use feed debugger, etc.

Feed debugger does not report any errors.

For example, one of my affected feeds is
http:/ /feeds.feedburner.com/AmazonWebServicesBlog
and on https:/ /tt-rss.org/myfeedsucks/ there is no error reported.

Other feeds are:
https:/ / www.nzz.ch/startseite.rss
https:/ /www.nzz.ch/international.rss

I already set the log-level of the update script to 9:
ExecStart=/usr/bin/php /home/web1/tt-rss/update_daemon2.php --log /var/log/ttrss-update.log --log-level 9
But even that does not write any kind of information, WHAT and WHY it failed, into the log file.

(Space added between slashes because links are not allowed to be posted).

I’ve got the same for all feeds though they are all updating.

tt-rss version (including git commit id): v20.09-d4d0e976d

Platform (i.e. Linux distro, PHP, PostgreSQL, etc) versions:
CentOS Linux release 8.2.2004 (Core)
PHP 7.2.24
PostgreSQL 10.14

well there’s this:

If you’re trying to use exec in a script that uses signal SIGCHLD, (i.e. pcntl_signal(SIGCHLD,‘sigHandler’):wink: it will return -1 as the exit code of the command (although output is correct!). To resolve this remove the signal handler and add it again after exec. Code will be something like this:

updater does use a SIGCHLD handler (the daemon, that is). if this is the case, we could simply consider -1 a valid exit code.

task-specific exit codes are different, and i think failure to exec is something like -128 or 128 (don’t remember) so we shouldn’t miss anything of value.

Okay. That sounds plausible. So there will be a bugfix with the next “git pull” available? :wink:

i’d rather not rush into adding workarounds until it’s clear that daemon parent SIGCHLD handler is to blame. as far as i remember, signal handlers are normally inherited by child processes, however i’m not seeing this behavior on my test instances and docker setup, which use that same exact daemon.

which means something else on the host might be causing this, and i’d rather not blindly trust an exit code which could be generated by a misconfigured host.

i.e. Php exec() return code is -1 when in a forked process, but 0 in a normal script - Stack Overflow etc

i must note (again) that issues similar to this one are what is inevitably forcing me into only supporting docker deployment.

e: try running without systemd, just php ./update.php --feeds - this doesn’t set a SIGCHLD handler, only forking daemon does. maybe try running the daemon from command line directly, without systemd. play around with it.

When running update_daemon2.php from command line using
sudo -u apache /usr/bin/php /home/web1/tt-rss/update_daemon2.php
there are also the errors:

[12:52:21/11022] Spawn interval: 120 sec
[12:52:21/11022] [MASTER] installing shutdown handlers
[12:52:21/11022] [MASTER] spawned client 0 [PID:11026]…
[12:52:21/11022] [MASTER] spawned client 1 [PID:11027]…
[12:52:21/11028] Using task id 0
[12:52:21/11028] Lock: update_daemon-11026.lock
[12:52:21/11029] Using task id 1
[12:52:21/11029] Lock: update_daemon-11027.lock
[12:52:21/11028] Waiting before update (0)
[12:52:21/11029] Waiting before update (5)
[12:52:21/11028] Scheduled 6 feeds to update…
[12:52:21/11028] Base feed: http:/ /www.videobuster.de/rss.php
[12:52:21/11028] => 25 neue Filme bei Video Buster (ID: 4, UID: 1), last updated: 2020-09-28 12:37:07
[12:52:21/11036] Lock: update_daemon-feed-4.lock
[12:52:21/11036] Purged feed 4 (60): deleted 0 articles
[12:52:21/11028] <= 0.3541 (sec) exit code: -1
[12:52:21/11028] !! Last error:
[12:52:21/11028] Base feed: http:/ /www.pcbheaven.com/rss/rss.xml
[12:52:21/11028] => PCB Heaven RSS Feed (ID: 73, UID: 1), last updated: 2020-09-28 12:37:07
[12:52:21/11043] Lock: update_daemon-feed-73.lock
[12:52:23/11043] Purged feed 73 (60): deleted 0 articles
[12:52:23/11028] <= 1.7912 (sec) exit code: -1
[12:52:23/11028] !! Last error:
[12:52:23/11028] Base feed: https:/ /www.mikrocontroller.net/feed/forum/1
[12:52:23/11028] => Neue Beiträge im Forum Mikrocontroller und Digitale Elektronik (ID: 134, UID: 1), last updated: 2020-09-28 12:37:08
[12:52:23/11052] Lock: update_daemon-feed-134.lock
[12:52:23/11052] Purged feed 134 (60): deleted 0 articles
[12:52:23/11028] <= 0.4455 (sec) exit code: -1
[12:52:23/11028] !! Last error:
[12:52:23/11028] Base feed: https:/ /www.nzz.ch/startseite.rss
[12:52:23/11028] => NZZ – Neue Zürcher Zeitung | Aktuelle News, Hintergründe & mehr (ID: 137, UID: 1), last updated: 2020-09-28 12:37:08
[12:52:23/11057] Lock: update_daemon-feed-137.lock
[12:52:24/11057] Purged feed 137 (60): deleted 0 articles
[12:52:24/11028] <= 0.5595 (sec) exit code: -1
[12:52:24/11028] !! Last error:
[12:52:24/11028] Base feed: http:/ /www.dreamsourcelab.com/blog/?feed=rss2
[12:52:24/11028] => DreamSourceLab (ID: 89, UID: 1), last updated: 2020-09-28 12:37:10
[12:52:24/11062] Lock: update_daemon-feed-89.lock
[12:52:26/11029] Scheduled 0 feeds to update…
[12:52:26/11029] Sending digests, batch of max 15 users, headline limit = 1000
[12:52:26/11029] All done.
[12:52:27/11022] [reap_children] child 11027 reaped.
[12:52:27/11022] [SIGCHLD] jobs left: 1
[12:52:27/11062] Purged feed 89 (60): deleted 0 articles
[12:52:27/11028] <= 2.8965 (sec) exit code: -1
[12:52:27/11028] !! Last error:
[12:52:27/11028] Base feed: https:/ /vegan-masterclass.de/feed/
[12:52:27/11028] => Vegan Masterclass (ID: 129, UID: 1), last updated: 2020-09-28 12:37:11
[12:52:27/11074] Lock: update_daemon-feed-129.lock
[12:52:27/11028] <= 0.5884 (sec) exit code: -1
[12:52:27/11028] !! Last error:
[12:52:27/11028] Processed 6 feeds in 6.6478 (sec), 1.1080 (sec/feed avg)
[12:52:27/11028] Running housekeeping tasks for user 1…
[12:52:27/11028] Sending digests, batch of max 15 users, headline limit = 1000
[12:52:27/11028] All done.
[12:52:27/11028] Expired cache/export: removed 0 files.
[12:52:27/11028] Expired cache/feeds: removed 0 files.
[12:52:27/11028] Expired cache/images: removed 0 files.
[12:52:27/11028] Expired cache/js: removed 0 files.
[12:52:27/11028] Expired cache/upload: removed 0 files.
[12:52:27/11028] Removed 0 old lock files.
[12:52:27/11028] Removing old error log entries…
[12:52:27/11028] Removing old archived feeds…
[12:52:27/11028] Purged 0 orphaned posts.
[12:52:28/11022] [reap_children] child 11026 reaped.
[12:52:28/11022] [SIGCHLD] jobs left: 0

The same when su-ing to user apache and running the script without “sudo”.

When using update.php, there is no error reported.

oh well

https://git.tt-rss.org/fox/tt-rss/commit/7c8bed05243156a4dc6290c6ac411401d773a03a

Great! Thank you. Just pull-ed the change and restarted the service. :wink:

Looks good! No errors so far …

I stopped the update deamon, waited a bit for there to be feeds to update, then ran the manual command. No errors.

[rob@ttrss-centos8 html]$ sudo systemctl stop ttrss_backend
[rob@ttrss-centos8 html]$ sudo -u apache ./update.php --feeds
[13:12:18/1562527] Lock: update.lock
[13:12:18/1562527] Scheduled 6 feeds to update...
[13:12:18/1562527] Base feed: https://www.reddit.com/r/cars/.rss
[13:12:18/1562527]  => 2020-09-28 12:56:57.67664, 55 2
[13:12:18/1562531] Lock: update_daemon-feed-55.lock
[13:12:19/1562531] Purged feed 55 (60): deleted 0 articles
[13:12:19/1562527]     1.3642 (sec) RC=0
[13:12:19/1562527] Base feed: https://www.reddit.com/r/vintagecomputing/.rss
[13:12:19/1562527]  => 2020-09-28 12:56:58.821931, 42 2
[13:12:19/1562536] Lock: update_daemon-feed-42.lock
[13:12:20/1562536] Purged feed 42 (60): deleted 0 articles
[13:12:20/1562527]     1.0736 (sec) RC=0
[13:12:20/1562527] Base feed: http://www.reddit.com/r/NASCAROffseasonSeries/.rss
[13:12:20/1562527]  => 2020-09-28 12:56:59.873846, 16 2
[13:12:20/1562541] Lock: update_daemon-feed-16.lock
[13:12:21/1562541] Purged feed 16 (60): deleted 0 articles
[13:12:21/1562527]     1.1864 (sec) RC=0
[13:12:21/1562527] Base feed: http://feeds.arstechnica.com/arstechnica/index
[13:12:21/1562527]  => 2020-09-28 12:57:00.661573, 43 2
[13:12:21/1562548] Lock: update_daemon-feed-43.lock
[13:12:22/1562548] Purged feed 43 (60): deleted 0 articles
[13:12:22/1562527]     0.7423 (sec) RC=0
[13:12:22/1562527] Base feed: https://www.reddit.com/r/oldcomputers/.rss
[13:12:22/1562527]  => 2020-09-28 12:57:01.619706, 39 2
[13:12:22/1562553] Lock: update_daemon-feed-39.lock
[13:12:23/1562553] Purged feed 39 (60): deleted 0 articles
[13:12:23/1562527]     1.1501 (sec) RC=0
[13:12:23/1562527] Base feed: https://www.gocomics.com/garfield
[13:12:23/1562527]  => 2020-09-28 12:57:02.381286, 8 2
[13:12:23/1562558] Lock: update_daemon-feed-8.lock
[13:12:24/1562558] Purged feed 8 (60): deleted 0 articles
[13:12:24/1562527]     0.7534 (sec) RC=0
[13:12:24/1562527] Processed 6 feeds in 6.2785 (sec), 1.0464 (sec/feed avg)
[13:12:24/1562527] Running housekeeping tasks for user 2...
[13:12:24/1562527] Sending digests, batch of max 15 users, headline limit = 1000
[13:12:24/1562527] All done.
[13:12:24/1562527] Expired cache/export: removed 0 files.
[13:12:24/1562527] Expired cache/feeds: removed 0 files.
[13:12:24/1562527] Expired cache/images: removed 0 files.
[13:12:24/1562527] Expired cache/upload: removed 0 files.
[13:12:24/1562527] Removed 0 old lock files.
[13:12:24/1562527] Removing old error log entries...
[13:12:24/1562527] Removing old archived feeds...
[13:12:24/1562527] Purged 0 orphaned posts.

My issue was resolved by that update as well. Thanks fox!