Get_scheduler_status returning 400

The web client is calling:

/api/method/frappe.core.page.background_jobs.background_jobs.get_scheduler_status

Roughly three times per minute, the logs returning a 400 response. This is messing with fail2ban, which uses the line:

failregex = <HOST>.*\" 400

to ban hosts that get more than 10 HTTP 400 response codes in 10 minutes.

I’ve used bench enable-scheduler to enable the scheduler, and I don’t know why I’m getting the 400 error. The protection fail2ban offers is very real and welcome, so I want to fix the problem rather than handicap fail2ban.

How can I troubleshoot the 400 error?