This error occurs when the school phase is missing on your school table: - if you go to Admin>Config>Core Set Up and check the below:-
Phase must be present and with a value of:
'NS' (Nursery)
'PS' (Primary)
'MP' (Middle Deemed Primary)
'MS' (Middle Deemed Secondary)
'SS' (Secondary)
'SP' (Special)
'AT' (All-Through)
'PR' (Pupil Referral Unit / Alternative Provision)