tine-groupware / tine

tine groupware main repository
https://www.tine-groupware.de
GNU Affero General Public License v3.0
12 stars 2 forks source link

php setup.php --update taking long time, without progress output #52

Closed mokraemer closed 3 months ago

mokraemer commented 4 months ago

After the latest update, I ran php setup.php --update

This is taking a long time, not indicating what is going on. I guess some kind of progress, e.g. 10 of 560000 or anything else could help.

mokraemer commented 4 months ago

finally it stops with "waited for Action Queue to become empty for more than 300 sec"

ignoreigor commented 4 months ago

Hi,

try to run sudo -u yourwwwuser php worker.php before, to do the queued actions and empty the list. Or: reduce your config and remove actionlist (I remove caches and sessions in this step as well ).

mokraemer commented 4 months ago

thanks for your comment. The documentation is not very clear about the config and how to setup tine. Maybe I am missing sth.

I tried your command. It did not return, but after cancelling it, the setup worked. Attaching my config, maybe I am missing sth relevant... config.txt

Looking at AdminQueue, tried to execute

php tine20.php --method Tinebase.monitoringCheckQueue
QUEUE FAIL: Tinebase_Exception - state actionQueueLastDuration not set

finally this has no result: redis-cli --scan --pattern "*tine20worker*"

Is it better to enable cron, and trigger the worker or should I prefer Scheduler "/usr/sbin/tine20-cli" - which I guess is sth. like php tine20.php (not documented anywhere)

ignoreigor commented 4 months ago

I tried your command. It did not return, but after cancelling it, the setup worked. Attaching my config, maybe I am missing sth relevant... config.txt

There is no output, except logging, if activated. It works the queued tasks silently, like sending some mails. Normally it never ends.

worker != Tinebase.triggerAsyncEvents Best approach is to daemonize the worker, there were some hints in the packages. Personally I run the command with screen and detached the terminal, so that it survives my logout.

Worker was originally created to decouple long running tasks from UI, so that UI have to wait until task is queued instead of waiting until task has finished.

Additionally you should run a cron, that Tinebase.triggerAsyncEvents

That is my output.

sudo -u www-data php tine20.php --method Tinebase.monitoringCheckQueue
QUEUE OK | size=0;lrsize=0;lastJobId=0;lastDuration=0.001;lastDurationUpdate=50;

nearly configures as your, but added queueName (no idea why I did it)

'actionqueue' => array ( 'active' => true, 'backend' => 'Redis', 'host' => 'localhost', 'port' => 6379, 'queueName' => 'tine20worker', ),

Looking at AdminQueue, tried to execute

php tine20.php --method Tinebase.monitoringCheckQueue
QUEUE FAIL: Tinebase_Exception - state actionQueueLastDuration not set

finally this has no result: redis-cli --scan --pattern "*tine20worker*"

This gave me some: tine20workerDeadLetter

Corrections, if something is explained wrong. Maybe a topic for one of the next podcad episodes.

mokraemer commented 4 months ago

hmm. But why do you have 2 different Tasks for the same problem: cron is triggering events and long running tasks and you have a worker task for the same thing. I would prefer the idea of having a cron job trigger events on the other hand, when worker is running (maybe as systemd unit), why need a cron job too?

I've added 'queueName' => 'tine20worker',, but

php tine20.php --method Tinebase.monitoringCheckQueue
QUEUE FAIL: Tinebase_Exception - state actionQueueLastDuration not set

still happens - I don't know how to solve this? is this some kind of initialiazation problem? It fails because actionQueueLastDuration is not found, and it is set after running???

ignoreigor commented 4 months ago

I suppose there are no entries in your db when querying select * from tine20_application_states where name like '%actionQueueLastDuration%';

But why? (Edit: -> Task Tinebase_ActionQueueActiveMonitoring is doing this)

Try: insert into tine20_application_states (id,name,state) select id,'actionQueueLastDuration',0.001 from tine20_applications where name ='Tinebase';

insert into tine20_application_states (id,name,state) select id,'actionQueueLastDurationUpdate',1716547501 from tine20_applications where name ='Tinebase';

ignoreigor commented 4 months ago

Your crons, e.g. Tinebase.triggerAsyncEvents, are not working, while you have configured 'cron_disabled' => true,

Is there a reason to do so?

mokraemer commented 4 months ago

I guess, I read it somewhere... removed that line, but no change for the cron-job - same exception

pschuele commented 3 months ago

see https://tine-docu.s3web.rz1.metaways.net/operators/howto/tine20AdminQueue/ for information about the worker + the --update error message "waited for Action Queue to become empty for more than 300 sec". the queue needs to be emptied (or disabled) first before the update can commence.

is there still a problem here or can we close this issue?

mokraemer commented 3 months ago

since queue did not want to get empty, I guess this problem still exists. FYI: this is new. Never had this in years.

pschuele commented 3 months ago

I would close this issue as setup.php works as intended. it looks more like a problem with the worker - we should open a new issue if that persists.