goauthentik / goauthentik/authentik
Huge number of Certificate Discovery tasks being scheduled after Update
- Dominant language
- Python
- Stars
- 25.6k
- Forks
- 2k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 651
Description
### Describe the bug
After doing the update to 2026.5.0 a huge amount of Certificate Discovery Tasks were being scheduled. I didn't notice immediately so this was the number of tasks being scheduled after some days:
```
>>> from authentik.tasks.models import Task
>>> count = Task.objects.filter(state="queued").count()
>>> print(f"Wartende Tasks: {count}")
Wartende Tasks: 249308
```
Each single task finishes successfully and a single task would only run a few seconds, but there where multiple tasks per second being newly scheduled so this accumulated.
I stopped the tasks with this
```
Task.objects.filter(state="queued").update(state="done")
```
and paused the Certificate Discovery task, because I saw in the webui that it was this task being scheduled. After that the number of tasks being queued went back to zero and stayed there.
I have 14 directories in the certs folder and each has 2 Files "fullchain.pem" and "privkey.pem".
For now pausing the task works, but I need it, since all the certificates are acme certificates and might change pretty soon.
I did not change the scheduling of the task, it was at all times "11 * * * *".
I just updated to 2026.5.2 but nothing changed. I initially updated from 2026.2.1 to 2026.5.0 and now to 2026.5.2
### How to reproduce
1. have multiple Directories with Certificates in the certs/ Folder
2. Let the Certificate Discovery Task run normally
3. See the tasks accumulating and your DB suffering.
### Expected behavior
Certificate Discovery Task running once per hour, like configured.
### Screenshots
_No response_
### Additional context
_No response_
### Deployment Method
Docker
### Version
2026.5.2
### Relevant log output
```shell
```
Contributor guide
Assessment
This issue has not been assessed yet.