apolloconfig/apollo · error · ServiceException

export config error

Error message

export config error

What it means

Thrown by ConfigsExportService.exportApps (bulk export of all permitted apps) when an IOException occurs while writing the top-level ZipOutputStream. The IOException is logged then re-thrown as ServiceException (HTTP 500). Per-env cluster export errors are caught and logged inside the stream and do NOT propagate; only the outer zip I/O failure escalates.

Source

Thrown at apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/service/ConfigsExportService.java:164

    try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
      // write app info to zip
      writeAppInfoToZip(hasPermissionApps, zipOutputStream);

      // export app namespace
      exportAppNamespaces(zipOutputStream);

      // export app's clusters
      exportEnvs.parallelStream().forEach(env -> {
        try {
          this.exportClusters(env, hasPermissionApps, zipOutputStream);
        } catch (Exception e) {
          logger.error("export cluster error. env = {}", env, e);
        }
      });
    } catch (IOException e) {
      logger.error("export config error", e);
      throw new ServiceException("export config error", e);
    }
  }

  private List<App> findHasPermissionApps() {
    // get all apps
    final List<App> apps = appService.findAll();

    if (CollectionUtils.isEmpty(apps)) {
      return Collections.emptyList();
    }

    // permission check
    final Predicate<App> isAppAdmin = app -> {
      try {
        return unifiedPermissionValidator.isAppAdmin(app.getAppId());
      } catch (Exception e) {
        logger.error("permission check failed. app = {}", app);
        return false;

View on GitHub (pinned to d95fc18d11)

Solutions

  1. Keep the client connection alive for the full bulk export; raise HTTP timeout if the fleet is large.
  2. Scope the export to fewer apps/envs to reduce transfer size and duration.
  3. Retry on transient I/O; this path does not corrupt portal state.
  4. Check portal/network capacity if the failure is reproducible.
Defensive patterns

Strategy: try-catch

Try / catch

try { exportApps(envs, out); }
catch (ServiceException e) { log.warn("bulk export failed: {}", e.getMessage()); /* retry with smaller scope */ }

Prevention

When it happens

Trigger: Bulk export (all apps the user has permission to) where the OutputStream fails during the multi-env write, or the client disconnects during a large aggregate download.

Common situations: Large fleet export timing out the HTTP connection; client cancellation; parallel exportEnvs.stream() consuming resources; network/disk sink failure mid-export.

Related errors


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