Invalid state: could not determine which events template to apply.