CMS-4312 Make repository initializer more robust