apolloconfig/apollo · error · ServiceException

import app config error.

Error message

import app config error.

What it means

Thrown as a ServiceException by ConfigsImportService.importAppConfigFromZipFile() wrapping any Exception raised during doImport() of the collected namespace data. This is the single-app equivalent of error 184: after successfully parsing all zip entries, the actual import (creation/update of namespaces and items) fails. The root cause is logged with full stack trace.

Solutions

  1. Examine portal logs for the 'import app config error.' line containing the root cause stack trace.
  2. If the cause is a namespace conflict, retry with ignoreConflictNamespace=true.
  3. Verify the target environment's admin/config service is reachable and healthy.
  4. Check for duplicate item keys or invalid item values in the imported namespace data.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  configsImportService.importAppConfigFromZipFile(appId, env, clusterName, zip, ignoreConflict, operator);
} catch (ServiceException e) {
  log.error("App config import failed during doImport", e);
  if (!ignoreConflict && e.getCause() != null) {
    log.warn("Retry with ignoreConflictNamespace=true after reviewing conflicts");
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling importAppConfigFromZipFile where doImport fails: namespace conflict when ignoreConflictNamespace is false, admin/config service unreachable, database constraint violation, or item validation failure during the parallel import.

Common situations: Namespace already exists with different items and ignoreConflictNamespace is false; target config service is down; database unique constraint on namespace name; item key validation failure (duplicate keys, invalid characters).

Related errors


AI-assisted analysis of apolloconfig/apollo@d95fc18d11 (2026-08-14). Data as JSON: /api/errors/adac6a8f6c639200. Report an issue: GitHub.

Appendix: source

Thrown at apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsImportService.java:219

          || !fileName.startsWith(fileNamePrefix)) {
        throw new BadRequestException("The content of the file to be imported is incorrect.");
      }
      if (!fileName.endsWith(ConfigFileUtils.CLUSTER_METADATA_FILE_SUFFIX)) {
        toImportNSs.add(new ImportNamespaceData(env, fileName, content, ignoreConflictNamespace));
      }
    }

    if (CollectionUtils.isEmpty(toImportNSs)) {
      throw new BadRequestException("The configuration to be imported is empty.");
    }

    try {
      LOGGER.info("Import namespace. namespace = {}", toImportNSs.size());
      doImport(Lists.newArrayList(), Lists.newArrayList(), Lists.newArrayList(),
          Lists.newArrayList(), toImportNSs, operator);
    } catch (Exception e) {
      LOGGER.error("import app config error.", e);
      throw new ServiceException("import app config error.", e);
    }
  }

  private void doImport(List<Env> importEnvs, List<String> toImportApps,
      List<String> toImportAppNSs, List<ImportClusterData> toImportClusters,
      List<ImportNamespaceData> toImportNSs, String operator) throws InterruptedException {
    LOGGER.info("Start to import app. size = {}", toImportApps.size());

    long startTime = System.currentTimeMillis();
    CountDownLatch appLatch = new CountDownLatch(toImportApps.size());
    toImportApps.parallelStream().forEach(app -> {
      try {
        importApp(app, importEnvs, operator);
      } catch (Exception e) {
        LOGGER.error("import app error. app = {}", app, e);
      } finally {
        appLatch.countDown();
      }

View on GitHub (pinned to d95fc18d11)