diff --git a/lib/workers/repository/init/index.ts b/lib/workers/repository/init/index.ts
index 0ce1e190f947f1820e22a91f34beb0e298c75c49..81f05826c03f10bba1bacc9caf0f752d87a9f196 100644
--- a/lib/workers/repository/init/index.ts
+++ b/lib/workers/repository/init/index.ts
@@ -48,8 +48,8 @@ export async function initRepo(
   let config: RenovateConfig = initializeConfig(config_);
   await resetCaches();
   logger.once.reset();
-  await initializeCaches(config as WorkerPlatformConfig);
   config = await initApis(config);
+  await initializeCaches(config as WorkerPlatformConfig);
   config = await getRepoConfig(config);
   setRepositoryLogLevelRemaps(config.logLevelRemap);
   checkIfConfigured(config);