apolloconfig/apollo · error · ServiceException

export app config error

Error message

export app config error

What it means

Thrown by ConfigsExportService.exportAppConfigByEnvAndCluster when an IOException occurs while writing the ZipOutputStream for a single-app export. The IOException is logged then re-thrown as a ServiceException (HTTP 500) wrapping the cause. Note inner BadRequestException/namespace errors are swallowed; only stream I/O failures escalate.

Source

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

    }
    ClusterDTO cluster = clusterService.loadCluster(appId, env, clusterName);
    if (cluster == null) {
      throw new BadRequestException(
          "The app does not exist in the specified environment and cluster.");
    }

    try (final ZipOutputStream zipOutputStream = new ZipOutputStream(outputStream)) {
      try {
        this.exportNamespaces(env, app, cluster, zipOutputStream, true);
      } catch (BadRequestException badRequestException) {
        // ignore
      } catch (Exception e) {
        logger.error("export namespace error. appId = {}, env = {}, cluster = {}", app.getAppId(),
            env.getName(), cluster.getName(), e);
      }
    } catch (IOException e) {
      logger.error("export app config error", e);
      throw new ServiceException("export app config error", e);
    }
  }

  private void exportApps(final Collection<Env> exportEnvs, OutputStream outputStream) {
    List<App> hasPermissionApps = findHasPermissionApps();

    if (CollectionUtils.isEmpty(hasPermissionApps)) {
      return;
    }

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

      // export app namespace
      exportAppNamespaces(zipOutputStream);

      // export app's clusters

View on GitHub (pinned to d95fc18d11)

Solutions

  1. Ensure the client keeps the download stream open for the full transfer (avoid timeouts/cancellations).
  2. Retry the export; transient I/O failures are not state-corrupting.
  3. If reproducible, check portal disk space / network egress and the size of the exported namespace set.
  4. Reduce export scope (narrow namespaces) if the zip is extremely large.
Defensive patterns

Strategy: try-catch

Try / catch

try { exportAppConfigByEnvAndCluster(appId, env, cluster, out); }
catch (ServiceException e) { log.warn("single-app export failed: {}", e.getMessage()); /* retry or narrow scope */ }

Prevention

When it happens

Trigger: The OutputStream backing the download is closed/broken mid-transfer, the client disconnects, disk/network sink fails, or the zip write hits an I/O error.

Common situations: Client cancels the download; servlet output stream aborted; disk full on a streamed temp path; network blip between portal and client during a large export.

Related errors


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