iflytek/astron-agent · error · BusinessException
8329
8329
Error message
toolbox.export.error
What it means
TOOLBOX_EXPORT_ERROR (code 8329) wraps any exception raised while exporting a tool: building the export VO, serializing it, or writing bytes to the HTTP response output stream. The catch-all logs the root cause and rethrows as a BusinessException so the client gets a uniform error.
Solutions
- Check the server log for the logged root cause under 'Export failed'
- Retry the export with a stable network connection / intact client
- Inspect the tool's stored data for values that break serialization and fix them
Defensive patterns
Strategy: try-catch
Try / catch
try { byte[] data = toolBoxApi.export(toolId); } catch (BusinessException e) { if (e.getCode() == 8329) { /* retry or surface export failure with server log reference */ } else throw e; } Prevention
- Keep the HTTP connection alive until the download completes
- Check server logs for the underlying 'Export failed' cause when it recurs
- Validate tool data integrity after direct DB edits that may break serialization
When it happens
Trigger: Export fails because serialization of the tool to JSON/YAML throws, or writing to the servlet OutputStream throws (client disconnected, broken pipe, response already committed).
Common situations: Client cancels the download mid-stream; container response buffer issues with large exports; data in the tool row that the export mapper cannot serialize.
Understand the failure class
Background: "failed to write file", "Could not save figure", "Error saving remote file" — file write failed: causes and fixes across languages and libraries — this error's family across 38 libraries.
Related errors
AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12).
Data as JSON: /api/errors/9cde72527e330a60.
Report an issue: GitHub.
Appendix: source
Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/tool/ToolBoxService.java:2256
// Convert JSON string to object tree, then write to YAML
JsonNode jsonNode = jsonMapper.readTree(jsonString);
String yamlString = yamlMapper.writeValueAsString(jsonNode);
data = yamlString.getBytes(StandardCharsets.UTF_8);
} else {
// JSON file
response.setContentType("application/json; charset=UTF-8");
response.setHeader("Content-Disposition", "attachment; filename=\"export.json\"");
data = JSONObject.toJSONString(toolBoxExportVo).getBytes(StandardCharsets.UTF_8);
}
// Set content length (important)
response.setContentLength(data.length);
// Write byte array directly
os.write(data);
os.flush();
} catch (Exception ex) {
log.error("Export failed", ex);
throw new BusinessException(ResponseEnum.TOOLBOX_EXPORT_ERROR);
}
}
/**
* Import tool from JSON or YAML file
*
* @param file Uploaded file
* @return ToolBoxExportVo
*/
public Object importTool(org.springframework.web.multipart.MultipartFile file) {
try {
// Check file type
String fileName = file.getOriginalFilename();
ObjectMapper jsonMapper = new ObjectMapper();
ObjectMapper yamlMapper = new ObjectMapper(new YAMLFactory());
if (fileName == null) {
throw new BusinessException(ResponseEnum.TOOLBOX_IMPORT_FILE_NAME_NULL);View on GitHub (pinned to 5e758547a8)