I have searched the forum for similar issues
on
This category is for issues regarding specific apps, NOT general issues with YunoHost.
on
This form is written in English but feel free to write in French if you’re more comfortable!
on
What app is this about, and its version
Friendica (2026.05-1~ynh1)
What YunoHost version are you running
12.1.41.2
What type of hardware are you using
VPS bought online
Describe your issue
I’ve had some unusual behaviour on my server. I’m picking up from a previous post on the same issue Timeouts running Friendica
I was not seeing notifications as I browsed the site on the number of new items were not appearing.
Eventually performance degraded to the point where I needed to restart the service every few page views.
I’ve subsequently done some investigation and saw that I was getting very long running queries in mysql like the one below:
SELECT contact.id, contact.name, COUNT(*) AS count FROM post-user-view INNER JOIN contact ON post-user-view.contact-id = contact.id WHERE post-user-view.uid = 2 AND post-user-view.visible AND NOT post-user-view.deleted AND post-user-view.unseen AND contact.network IN (‘dfrn’, ‘apub’) AND contact.contact-type = 27 AND NOT contact.blocked AND NOT contact.hidden AND NOT contact.pending AND NOT contact.archive AND contact.uid = 3 GROUP BY contact.id
I didnt realise at the time but I was also getting reports on the Admin page that the The last worker process had not started for some time.
I then noticed that private messages were not being delivered to contacts on other instances.
I looked at the Friendica daemon and it appeared to be running ok ..
Because of the long running queries I looked at the definition of post-user-view and recreated it from the friendica database.sql definition. Testing on a snapshot of my live server i noticed that when the query returned with no results it ran very quickly but otherwise even with a few records to return it would take many minutes (5+)_and appeared to be triggered multiple times a minute by any loaded friendica page.
I also looked at why my worker queue appeared to be rising even though the daemon appeared to be running and have managed to get this processed by manually running
sudo -u friendica /usr/bin/php8.4 -f /var/www/friendica/bin/console.php worker - I’m currently working through this backlog by running this every few minutes using cron - but I have noticed that this is taking several minutes to complete because there is step in the process where the job runs an "OPTIMIZE TABLE workerqueue " and this takes quite a long time to complete with so many records in the table.
I have been looking around at similar issues and at one time found a command that caused console.php to report that Friendica had not yet been installed which appeared strange.
I’m currently working through the backlog in the job queue to work out whether this resolves the performance issues .. then I’lll look at why the daemon is not causing the console.php to process to the worker queue
Share relevant logs or error messages
I’m not sure if these are any use - I don’t quite get that the daemon is reporting any issues
journalctl
Oct 28 08:47:04 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:47:15 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 12.
Oct 28 08:47:15 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:15 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:15 systemd[1]: friendica-daemon.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 28 08:47:15 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:47:25 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 13.
Oct 28 08:47:25 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:25 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:25 systemd[1]: friendica-daemon.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 28 08:47:25 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:47:35 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 14.
Oct 28 08:47:35 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:35 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:35 systemd[1]: friendica-daemon.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 28 08:47:35 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:47:45 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 15.
Oct 28 08:47:45 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:45 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:45 systemd[1]: friendica-daemon.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 28 08:47:45 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:47:56 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 16.
Oct 28 08:47:56 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:56 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:47:56 systemd[1]: friendica-daemon.service: Main process exited, code=exited, status=255/EXCEPTION
Oct 28 08:47:56 systemd[1]: friendica-daemon.service: Failed with result ‘exit-code’.
Oct 28 08:48:06 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 17.
Oct 28 08:48:06 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 28 08:48:06 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 31 18:56:02 systemd[1]: Stopping friendica-daemon.service - Friendica: Decentralized Social Network…
Oct 31 18:56:03 systemd[1]: friendica-daemon.service: Deactivated successfully.
Oct 31 18:56:03 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 31 18:56:03 systemd[1]: friendica-daemon.service: Consumed 3min 21.499s CPU time.
– Boot 3dbce337d8784bfd8d48bc57e09356f6 –
Oct 31 18:58:50 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 31 19:51:20 systemd[1]: Stopping friendica-daemon.service - Friendica: Decentralized Social Network…
Oct 31 19:51:22 systemd[1]: friendica-daemon.service: Deactivated successfully.
Oct 31 19:51:22 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Oct 31 19:51:22 systemd[1]: friendica-daemon.service: Consumed 3.154s CPU time.
Oct 31 19:52:21 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Nov 01 19:23:23 systemd[1]: Stopping friendica-daemon.service - Friendica: Decentralized Social Network…
Nov 01 19:23:24 systemd[1]: friendica-daemon.service: Deactivated successfully.
Nov 01 19:23:24 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Nov 01 19:23:24 systemd[1]: friendica-daemon.service: Consumed 1min 1.907s CPU time.
– Boot 24125a248706448fa5cbbe403e6263c8 –
Nov 01 19:26:42 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
Nov 02 21:22:54 systemd[1]: friendica-daemon.service: Deactivated successfully.
Nov 02 21:22:54 systemd[1]: friendica-daemon.service: Consumed 1min 12.266s CPU time.
Nov 02 21:23:04 systemd[1]: friendica-daemon.service: Scheduled restart job, restart counter is at 1.
Nov 02 21:23:04 systemd[1]: Stopped friendica-daemon.service - Friendica: Decentralized Social Network.
Nov 02 21:23:04 systemd[1]: friendica-daemon.service: Consumed 1min 12.266s CPU time.
Nov 02 21:23:04 systemd[1]: Started friendica-daemon.service - Friendica: Decentralized Social Network.
/var/log/friendica/daemon.log
#5 /var/www/friendica/vendor/level-2/dice/Dice.php(247): Dice\Dice->create()
#6 /var/www/friendica/vendor/level-2/dice/Dice.php(132): Dice\Dice->{closure:Dice\Dice::getParams():224}()
#7 /var/www/friendica/vendor/level-2/dice/Dice.php(96): Dice\Dice->{closure:Dice\Dice::getClosure():125}()
#8 /var/www/friendica/src/Core/DiceContainer.php(48): Dice\Dice->create()
#9 /var/www/friendica/src/App.php(281): Friendica\Core\DiceContainer->create()
#10 /var/www/friendica/src/App.php(209): Friendica\App->setupContainerForAddons()
#11 /var/www/friendica/bin/console.php(25): Friendica\App->processConsole()
#12 {main}
thrown in /var/www/friendica/src/Database/Database.php on line 187
PHP Fatal error: Uncaught mysqli_sql_exception: No such file or directory in /var/www/friendica/src/Database/Database.php:187
Stack trace:
#0 /var/www/friendica/src/Database/Database.php(187): mysqli->__construct()
#1 /var/www/friendica/src/Database/Database.php(92): Friendica\Database\Database->connect()
#2 [internal function]: Friendica\Database\Database->__construct()
#3 /var/www/friendica/vendor/level-2/dice/Dice.php(132): ReflectionMethod->invokeArgs()
#4 /var/www/friendica/vendor/level-2/dice/Dice.php(96): Dice\Dice->{closure:Dice\Dice::getClosure():125}()
#5 /var/www/friendica/vendor/level-2/dice/Dice.php(247): Dice\Dice->create()
#6 /var/www/friendica/vendor/level-2/dice/Dice.php(132): Dice\Dice->{closure:Dice\Dice::getParams():224}()
#7 /var/www/friendica/vendor/level-2/dice/Dice.php(96): Dice\Dice->{closure:Dice\Dice::getClosure():125}()
#8 /var/www/friendica/src/Core/DiceContainer.php(48): Dice\Dice->create()
#9 /var/www/friendica/src/App.php(281): Friendica\Core\DiceContainer->create()
#10 /var/www/friendica/src/App.php(209): Friendica\App->setupContainerForAddons()
#11 /var/www/friendica/bin/console.php(25): Friendica\App->processConsole()
#12 {main}
thrown in /var/www/friendica/src/Database/Database.php on line 187
PHP Fatal error: Uncaught mysqli_sql_exception: No such file or directory in /var/www/friendica/src/Database/Database.php:187
Stack trace:
#0 /var/www/friendica/src/Database/Database.php(187): mysqli->__construct()
#1 /var/www/friendica/src/Database/Database.php(92): Friendica\Database\Database->connect()
#2 [internal function]: Friendica\Database\Database->__construct()
#3 /var/www/friendica/vendor/level-2/dice/Dice.php(132): ReflectionMethod->invokeArgs()
#4 /var/www/friendica/vendor/level-2/dice/Dice.php(96): Dice\Dice->{closure:Dice\Dice::getClosure():125}()
#5 /var/www/friendica/vendor/level-2/dice/Dice.php(247): Dice\Dice->create()
#6 /var/www/friendica/vendor/level-2/dice/Dice.php(132): Dice\Dice->{closure:Dice\Dice::getParams():224}()
#7 /var/www/friendica/vendor/level-2/dice/Dice.php(96): Dice\Dice->{closure:Dice\Dice::getClosure():125}()
#8 /var/www/friendica/src/Core/DiceContainer.php(48): Dice\Dice->create()
#9 /var/www/friendica/src/App.php(281): Friendica\Core\DiceContainer->create()
#10 /var/www/friendica/src/App.php(209): Friendica\App->setupContainerForAddons()
#11 /var/www/friendica/bin/console.php(25): Friendica\App->processConsole()
#12 {main}
thrown in /var/www/friendica/src/Database/Database.php on line 187
Starting Friendica daemon
Daemon process 148873 was killed (/var/www/friendica/daemon.pid)
Starting Friendica daemon
Daemon process 1438 was killed (/var/www/friendica/daemon.pid)
Starting Friendica daemon
Daemon process 9529 was killed (/var/www/friendica/daemon.pid)
Starting Friendica daemon
Daemon process isn’t running (/var/www/friendica/daemon.pid)
Starting Friendica daemon