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 clustersView on GitHub (pinned to d95fc18d11)
Solutions
- Ensure the client keeps the download stream open for the full transfer (avoid timeouts/cancellations).
- Retry the export; transient I/O failures are not state-corrupting.
- If reproducible, check portal disk space / network egress and the size of the exported namespace set.
- 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
- Keep the download stream open for the full transfer.
- Retry transient I/O failures; they do not corrupt state.
- Narrow the export scope if the zip is very large.
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
- Write app error. {}
- Write namespace error. {}
- Write error. {}
- export config error
- import configs failed: %s
AI-assisted analysis of apolloconfig/apollo@d95fc18d11 (2026-08-14).
Data as JSON: /api/errors/8432fe3e318b3ddf.
Report an issue: GitHub.