Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daemon #127

Merged
merged 33 commits into from Feb 22, 2024
Merged

Daemon #127

merged 33 commits into from Feb 22, 2024

Conversation

OniriCorpe
Copy link
Member

@OniriCorpe OniriCorpe commented Feb 13, 2024

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

  • Code finished and ready to be reviewed/tested
  • The fix/enhancement were manually tested (if applicable)

@OniriCorpe OniriCorpe changed the base branch from master to testing February 13, 2024 20:41
@yunohost-bot
Copy link
Contributor

May the CI gods be with you!
Test Badge

@tio-trom
Copy link

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 #78

If you can pull this off it would be fantastic!

@yunohost-bot
Copy link
Contributor

🌻
Test Badge

@yunohost-bot
Copy link
Contributor

🚀
Test Badge

@OniriCorpe OniriCorpe linked an issue Feb 14, 2024 that may be closed by this pull request
@yunohost-bot
Copy link
Contributor

Alrighty!
Test Badge

scripts/install Outdated Show resolved Hide resolved
@tio-trom
Copy link

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

@yunohost-bot
Copy link
Contributor

May the CI gods be with you!
Test Badge

@yunohost-bot
Copy link
Contributor

May the CI gods be with you!
Test Badge

@OniriCorpe OniriCorpe merged commit f316878 into testing Feb 22, 2024
@OniriCorpe OniriCorpe deleted the daemon branch February 22, 2024 04:04
@aarontrom
Copy link

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
Copy link

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
Copy link

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
Copy link

Ohh true indeed:
image

@tio-trom
Copy link

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
Copy link

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
Copy link

We can continue the discussion here maybe #133

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move from CRON to Daemon
4 participants