friendica / docker

Docker image for Friendica
https://friendi.ca
GNU Affero General Public License v3.0
45 stars 18 forks source link

docker install can't run workers at all #189

Open ggrensteiner opened 2 years ago

ggrensteiner commented 2 years ago

Running cron.sh, php bin/worker.php or php bin/daemon.php does nothing in a docker container.

The daemon.php always returns Friendica isn't properly installed yet.

worker.php isn't running the jobs as the admin page logs that the worker process has never run.

Is this thing stuck in some kind of install tag process? daemon.php seems to be checking DI::mode() -> isInstall()) and failing, but I can't seem to trace what it's checking that fails.

This is being run inside a shell in the app container within docker that is running a functional (I think) install that lets me login and upload images and whatnot.

nupplaphil commented 2 years ago

I tried it with this setup

version: '2.1'
services:

  db:
    image: mariadb
    restart: always
    volumes:
      - db:/var/lib/mysql/
    environment:
      - MYSQL_RANDOM_ROOT_PASSWORD=yes
    env_file:
      - db.env

  redis:
    image: redis
    restart: always

  app:
    image: friendica:apache
    restart: always
    volumes:
      - friendica:/var/www/html
    environment:
      - FRIENDICA_ADMIN_MAIL=admin@friendica.local
      - FRIENDICA_TZ=Europe/Vienna
      - FRIENDICA_LANG=de
      - FRIENDICA_URL=https://friendica.local
      - FRIENDICA_SITENAME=Friendica
      - SMTP=mail
    env_file:
      - db.env
    depends_on:
      - db
    ports:
      - "80:80"

volumes:
  db:
  friendica:

And started the daemon manually inside with: gosu www-data tini -s -- php bin/daemon.php -f start

At least the output looks good to me:

2022-02-17T21:20:23Z daemon [NOTICE]: Starting worker daemon. {"pid":null} - {"file":"daemon.php","line":145,"function":null,"uid":"5eabb6","process_id":162}
2022-02-17T21:20:23Z worker [NOTICE]: Load: 3.06/20 - processes: 0/1/0 (0:1) - maximum: 7/10 [] - {"file":"Worker.php","line":786,"function":"tooMuchWorkers","uid":"c0b27c","process_id":164}
2022-02-17T21:20:23Z worker [NOTICE]: Load: 3.06/20 - processes: 0/1/1 (0:1) - maximum: 7/10 [] - {"file":"Worker.php","line":786,"function":"tooMuchWorkers","uid":"c0b27c","process_id":164}
2022-02-17T21:20:23Z worker [NOTICE]: Load: 3.06/20 - processes: 0/1/2 (0:1) - maximum: 7/10 [] - {"file":"Worker.php","line":786,"function":"tooMuchWorkers","uid":"c0b27c","process_id":164}
2022-02-17T21:20:23Z daemon [NOTICE]: Load: 3.06/20 - processes: 0/1/1 (0:0, 20:1) - maximum: 7/10 [] - {"file":"Worker.php","line":786,"function":"tooMuchWorkers","uid":"5eabb6","process_id":162}
ggrensteiner commented 2 years ago

Please update the docs to include that functional docker-compose.

scifijunk commented 2 years ago

Well, I just started noticing that I have the same problem in my Kubernetes cluster with the friendica:stable image since yesterday. According to my friendica node, it's Friendica 'Siberian Iris' 2022.03 - 1452.

I have tried redeploying both the cron and main friendica app. I tried running php /var/www/html/bin/daemon.php -f start. I tried gosu www-data tini -s -- php bin/daemon.php -f start. I tried removing the cron app and redeploying friendica. Nothing seems to work because I still have the following error on my Administration - Summary page:

"The last worker process started at 2022-04-16 14:26:28 UTC. This is more than one hour ago. Please adjust your crontab settings."

What is even odder though is the fact that I'm still getting something since I am getting posts that state "13 hours ago (Received 5 hours ago)" but according to the Administration - Summary it states "Message queues 0 - 0" and has not changed since I started having the error.

What a rather odd error to have.

update1: I put the cron app and it now shows Message queues 0 - 1 but the "The last worker process started at 2022-04-16 14:26:28 UTC. This is more than one hour ago. Please adjust your crontab settings." is still there. The only thing I changed was checking the box for "Synchronize the contacts with the directory server" so something doesn't seem to be right somewhere I just don't know where.

update2: I put the cron app back the way I had it and now the "The last worker process started at 2022-04-16 14:26:28 UTC. This is more than one hour ago. Please adjust your crontab settings." error is gone. The only thing I changed was put the Environment variables back in for MariaDB. Maybe it just worked itself out I guess.