diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java index af2585349..24bdc60ac 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalConfigInfoProcessor.java @@ -104,10 +104,14 @@ public class LocalConfigInfoProcessor { } } else { try { - boolean isMdOk = file.getParentFile().mkdirs(); - if (!isMdOk) { - log.error(envName, "NACOS-XXXX", "save snapshot error"); + File parentFile = file.getParentFile(); + if (!parentFile.exists()) { + boolean isMdOk = parentFile.mkdirs(); + if (!isMdOk) { + log.error(envName, "NACOS-XXXX", "save snapshot error"); + } } + if (JVMUtil.isMultiInstance()) { ConcurrentDiskUtil.writeFileContent(file, config, Constants.ENCODE);