apache/shenyu · error · ShenyuException
dynamic: result.getMessage() from…
Error message
dynamic: result.getMessage() from configsService.configsExport()
What it means
The /configs/export endpoint delegates to configsService.configsExport(); if the returned ShenyuAdminResult code is not SUCCESSFUL, the controller rethrows the service's message as a ShenyuException. The message is dynamic — whatever the export service failed with (e.g. data assembly or DB failure during export).
Solutions
- Read the dynamic message in the response/logs to identify the underlying service failure
- Check admin logs at export time for the root MyBatis/DB exception and fix the underlying data issue
- Retry the export after resolving; verify exported data via the dashboard
Defensive patterns
Strategy: try-catch
Validate before calling
// check admin health and DB connectivity before export
if (!adminHealthOk() || !dbReachable()) { skipExport(); } Try / catch
try {
byte[] data = exportConfigs();
} catch (ShenyuException e) {
log.error("config export failed: {}", e.getMessage());
// inspect admin logs for the underlying service failure
} Prevention
- Check admin logs immediately after a failed export — the dynamic message mirrors the service error
- Ensure the export permission (system:manager:exportConfig) and DB state are healthy
- Test exports after version upgrades before relying on them for backups
When it happens
Trigger: Calling GET /configs/export with 'system:manager:exportConfig' permission while configsService.configsExport() returns a non-success code (export data assembly failed, e.g. DB errors or empty/invalid config snapshot).
Common situations: Exporting config from an admin whose DB has corrupt/missing rows; running export during an inconsistent data state; insufficiently privileged or partially migrated databases.
Related errors
- dynamic: result.getMessage() from…
- The configuration shenyu.discovery.type in xml/yml cannot…
- can not find port automatically !
- tars client must config the contextPath, ipAndPort
- please config in xml/yml !
AI-assisted analysis of apache/shenyu@567142e072 (2026-09-12).
Data as JSON: /api/errors/a683e6ad1c567be9.
Report an issue: GitHub.
Appendix: source
Thrown at shenyu-admin/src/main/java/org/apache/shenyu/admin/controller/ConfigsExportImportController.java:78
public ConfigsExportImportController(final ConfigsService configsService,
final SyncDataService syncDataService) {
this.configsService = configsService;
this.syncDataService = syncDataService;
}
/**
* Export all configs.
*
* @param response response
* @return the shenyu result
*/
@GetMapping("/export")
@RequiresPermissions("system:manager:exportConfig")
public ResponseEntity<byte[]> exportConfigs(final HttpServletResponse response) {
ShenyuAdminResult result = configsService.configsExport();
if (!Objects.equals(CommonErrorCode.SUCCESSFUL, result.getCode())) {
throw new ShenyuException(result.getMessage());
}
HttpHeaders headers = new HttpHeaders();
String fileName = generateFileName();
response.setHeader("Access-Control-Expose-Headers", "Content-Disposition");
headers.add("Content-Disposition", "attachment;filename=" + fileName);
return new ResponseEntity<>((byte[]) result.getData(), headers, HttpStatus.OK);
}
/**
* Export all configs.
*
* @param namespace namespaceId
* @param response response
* @return the shenyu result
*/
@GetMapping("/exportByNamespace")
@RequiresPermissions("system:manager:exportConfig")
public ResponseEntity<byte[]> exportConfigsByNamespace(final String namespace, final HttpServletResponse response) {View on GitHub (pinned to 567142e072)