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

New admin redact endpoint doesn't work when setting run_background_tasks_on #17823

Closed
morguldir opened this issue Oct 12, 2024 · 1 comment · Fixed by #17847
Closed

New admin redact endpoint doesn't work when setting run_background_tasks_on #17823

morguldir opened this issue Oct 12, 2024 · 1 comment · Fixed by #17847

Comments

@morguldir
Copy link

Description

The redact tasks seems to only work for processes with the admin handler running, which is only the main process, due to there being a block disabling the admin handler if it's running as a worker

The redact task is registered here https://github.com/element-hq/synapse/blob/v1.117.0rc1/synapse/handlers/admin.py#L72-L74

I've successfully used the purge room endpoint with the background worker before, which i believe is because the task is registered in the pagination handler here instead https://github.com/element-hq/synapse/blob/v1.117.0rc1/synapse/handlers/pagination.py#L131-L133

Steps to reproduce

  • Run admin command to redact https://matrix.sulian.eu/_synapse/admin/v1/user/@morguldir:sulian.eu/redact
  • See that the task gets stuck with https://matrix.sulian.eu/_synapse/admin/v1/user/redact_status/sVZFiCXPYhyBSUjt
  • Check logs and see that it didn't recognize the task

Homeserver

sulian.eu

Synapse Version

1.117.0rc1

Installation Method

Docker (matrixdotorg/synapse)

Database

postgres 15.6, split main and state

Workers

Multiple workers

Platform

kubespray + containerd + ananace/charts + synapse docker image

Configuration

run_background_tasks_on
Presence
limit_profile_requests_to_users_who_share_rooms
MSC3266
MSC2815

Relevant log output

matrix-synapse-background-tasker-5875d8c798-b5pvv background-tasker Exception: No function associated with action redact_all_events of the scheduled task sVZFiCXPYhyBSUjt

Anything else that would be useful to know?

Commenting out run_background_tasks_on made the redaction go through instantly

Although it still failed with this error matrix-synapse-86b9446569-rv8sc synapse 2024-10-12 18:43:16,033 - synapse.handlers.admin - 492 - INFO - task-redact_all_events-0-sVZFiCXPYhyBSUjt- Redaction of event $Xgmx26-_7Wsh_a3_WE0uCqRTb6If6RqKn38mg1YOI6g failed due to: User must be our own: @nex:nexy7574.co.uk, but worked when i tried it on myself.

I'm curious if it would make sense to let the command run the redactions as the admin user, if they have sufficient permission in the room

I also noticed that you can redact events even after you leave a room, although this will most likely soft fail on any other servers 🤔

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

Successfully merging a pull request may close this issue.

2 participants