Realms are now a required field and the scheduler only schedules within ...

...the realm that the master resides.  There is no external functionality for updating the realm from the CLI or UI
A named return value isn't helping here. It just confuses things. Line 159 declares a new `err` (which shadows the named return value `err`) and then returns that on line 160. Confusing. Everywhere else you're using the named return value `err` and so your returns don't need to reference `err`. Confusing. I think you're done it this way because you need `err` as a parameter to f.afterEvent(). If that's the case lose the named return value and declare `err` at the beginning of the func.