YunoHost-Apps / friendica_ynh

Friendica package for YunoHost
http://friendi.ca/
Other
11 stars 13 forks source link

Daemon #127

Closed OniriCorpe closed 9 months ago

OniriCorpe commented 9 months ago

Problem

people are experiencing issues with the cron system see: https://forum.yunohost.org/t/friendica-worker-cron-job/28166

Solution

use the daemon instead

PR Status

yunohost-bot commented 9 months ago

May the CI gods be with you! Test Badge

tio-trom commented 9 months ago

Oh this would be fantastic to add. I have an instance with around 1k users and without the daemon it would not work. With the daemon it works very well. I even opened an issue for that here https://github.com/YunoHost-Apps/friendica_ynh/issues/78

If you can pull this off it would be fantastic!

yunohost-bot commented 9 months ago

:sunflower: Test Badge

yunohost-bot commented 9 months ago

:rocket: Test Badge

yunohost-bot commented 9 months ago

Alrighty! Test Badge

tio-trom commented 9 months ago

Latest test seemed to work? I would like to give this one a try, but do you think it is ready?

yunohost-bot commented 9 months ago

May the CI gods be with you! Test Badge

yunohost-bot commented 9 months ago

May the CI gods be with you! Test Badge

aarontrom commented 9 months ago

thanks for that awesome work! When I updated friendica, I can access everything on my phone via Tusky for example or Fedilab, however on the laptop it looks like when I try to access the feed: image

and the error message is the following:

Exception thrown in /var/www/friendica/src/Core/Renderer.php:90
Stack trace:
#0 /var/www/friendica/src/Content/Conversation.php(364): Friendica\Core\Renderer::replaceMacros()
#1 /var/www/friendica/src/Module/Item/Display.php(275): Friendica\Content\Conversation->statusEditor()
#2 /var/www/friendica/src/Module/Item/Display.php(165): Friendica\Module\Item\Display->getDisplayData()
#3 /var/www/friendica/src/BaseModule.php(250): Friendica\Module\Item\Display->content()
#4 /var/www/friendica/src/App.php(711): Friendica\BaseModule->run()
#5 /var/www/friendica/index.php(46): Friendica\App->runFrontend()
#6 {main}

Request: 65d7ef65cea62

I can access the admin panel though and my personal profile. Did that happen to anyone else?

tio-trom commented 9 months ago

I think is worth mentioning the beginning of that error unable to create directory /var/www/friendica/view/smarty3/compiled/52/4e/07

Also for my friendica I get this endless smarty3 folder repeated on a loop.

2024-02-23_02-23

How about for you @aarontrom ?

tio-trom commented 9 months ago

Plus I need to mention that I got the same errors with the ynh2 package, before the daemon implementation. Some of my profile's newsfeeds ere empty, some were normal. I do not know what's the issue.

aarontrom commented 9 months ago

Ohh true indeed: image

tio-trom commented 8 months ago

I would like to understand if the Daemon was successfully implemented since it was merged? I would like to test but to know what I need to check for. Thanks!

tio-trom commented 8 months ago

I updated to the main branch and I see these errors in the friendica-daemon:

PHP Warning:  file_put_contents(/run/friendica/daemon.pid): Failed to open stream: Permission denied in /var/www/friendica/bin/daemon.php on line 166
Pid file wasn't written.

The 166 line is if (!file_put_contents($pidfile, $pid)) {

Context:

// Fork a daemon process
    $pid = pcntl_fork();
    if ($pid == -1) {
        echo "Daemon couldn't be forked.\n";
        Logger::warning('Could not fork daemon');
        exit(1);
    } elseif ($pid) {
        // The parent process continues here
        if (!file_put_contents($pidfile, $pid)) {
            echo "Pid file wasn't written.\n";
            Logger::warning('Could not store pid file');
            posix_kill($pid, SIGTERM);
            exit(1);
        }
        echo 'Child process started with pid ' . $pid . ".\n";
        Logger::notice('Child process started', ['pid' => $pid]);
        exit(0);
    }

And the friendica-daemon-service restarts every minute or so. Friendica works for me tho....but you have to be aware of those errors.

tio-trom commented 8 months ago

We can continue the discussion here maybe https://github.com/YunoHost-Apps/friendica_ynh/issues/133