[Bug]: task scheduler does not run properly in a separate container on 0.19.4-beta.5
mattbathje opened this issue · 1 comments
mattbathje commented
Requirements
- Is this a bug report? For questions or discussions use https://lemmy.ml/c/lemmy_support
- Did you check to see if this issue already exists?
- Is this only a single bug? Do not put multiple bugs in one issue.
- Do you agree to follow the rules in our Code of Conduct?
- Is this a backend issue? Use the lemmy-ui repo for UI / frontend issues.
Summary
A 0.19.4-beta.5 instance can not run the task scheduler as a separate container. When you attempt to do this, the task scheduler container keeps restarting, and tasks (such as updating Hot / Scaled / etc. sort types) never run.
If you move the task scheduler to run in the main lemmy container, the container does not restart and tasks run properly.
Steps to Reproduce
- Configure lemmy's docker-compose.yml to have a separate container for running tasks. In the tasks entrypoint, make sure the entrypoint is configured as:
entrypoint: lemmy_server --disable-http-server --disable-activity-sending
. On all other lemmy services in the docker-compose.yml, make sure the entrypoint contains--disable-scheduled-tasks
- (re) start your docker containers
- Watch the logs using
docker compose logs -f lemmy-tasks
- after a short period of time, the lemmy-tasks container will exit. If you usedocker compose ps
, you will see lemmy-tasks in a restarting state.
Technical Details
The following log is an example of the tasks container exiting, however the info/debug messages leading up to the exit are not always the same.
lemmy-tasks_1 | 2024-05-06T17:45:46.638489Z INFO lemmy_server::scheduled_tasks: Updating active site and community aggregates ...
lemmy-tasks_1 | 2024-05-06T17:45:46.638589Z DEBUG tokio_postgres::query: executing statement s3 with parameters: [ToSqlHelper(PgTypeMetadata(Ok(InnerPgTypeMetadata { oid: 23, array_oid: 1007 })), Some([0, 0, 0, 1]))]
lemmy-docker_lemmy-tasks_1 exited with code 0
Version
0.19.4-beta.5
Lemmy Instance URL
No response
Nothing4You commented
fix is in