migration: Make cache_init() take an error parameter