Cannot sync repos after Foreman update 3.7

Problem:
Since the Foreman server has been updated from 3.5 to 3.6 and then to 3.7, I cannot sync any of the repositories that were functioning correctly. When I run any repository sync, every task and sync gets stuck at 63%, and “total steps X/X”.

Expected outcome:
Being able to sync repositories

Foreman and Proxy versions:
3.7.0

Foreman and Proxy plugin versions:
foreman-tasks 8.1.1
foreman_ansible 12.0.4
foreman_remote_execution 10.0.1
katello 4.9.0

Distribution and version:
Oracle Linux 8.8

Other relevant data:
All services are running

Foreman task output



Dynflow task output

Logs



I think it’s related to this thread:Katello 4.9 is very slow

I see, I thought the repository sync task would never end, It took around 5 hours to “sync” when that repository only took around 3-5 min before the Katello update.