Server stuck in shutdown loop