iflytek/astron-agent · error · BusinessException

RESPONSE_FAILED

RESPONSE_FAILED

Error message

BusinessException(ResponseEnum.RESPONSE_FAILED)

What it means

OpenPlatformService.syncWorkflowUpdate parses the open-platform HTTP response; if parsing fails (invalid JSON or incompatible structure) it logs a warn including body size and throws BusinessException(RESPONSE_FAILED). The workflow update result is therefore unavailable.

Solutions

  1. Check the warn log for url/workflowId/bodyBytes, then reproduce the request to inspect the raw response
  2. Verify open-platform credentials and endpoint URL are for the correct environment
  3. Confirm the response contract after any open-platform SDK/API upgrade
  4. Check gateway/proxy logs for 5xx responses converted to HTML
Defensive patterns

Strategy: try-catch

Validate before calling

if (response == null || response.isBlank()) throw new IllegalStateException("empty open-platform response");

Type guard

boolean parsesToEntity(String body) {
    try { return com.alibaba.fastjson.JSON.parseObject(body) != null; } catch (Exception e) { return false; }
}

Try / catch

try {
    openPlatformService.syncWorkflowUpdate(workflowId, payload);
} catch (BusinessException e) {
    log.error("workflow sync failed to parse response", e);
    // queue for retry / alert on open-platform health
}

Prevention

When it happens

Trigger: The open platform sync-workflow endpoint returns a body that cannot be deserialized into the expected response entity: non-JSON payload, HTML gateway error, or changed response schema.

Common situations: Open platform outage returning error pages; app id/secret misconfig causing auth redirects to HTML; API version upgrade changing response fields; proxy interference.

Understand the failure class

Background: "Invalid JSON response" and "Failed to parse response" errors: when an API answers 200 but the body isn't the JSON your library expected — this error's family across 28 libraries.

Related errors


AI-assisted analysis of iflytek/astron-agent@5e758547a8 (2026-09-12). Data as JSON: /api/errors/a92d799b25dd14d3. Report an issue: GitHub.

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/extra/OpenPlatformService.java:109

                .toString();

        log.info(
                "OpenPlatformService syncWorkflowUpdate, url = {}, workflowId = {}, bodyBytes = {}",
                url,
                id,
                reqBody.getBytes(StandardCharsets.UTF_8).length);
        String response = OkHttpUtil.post(url, headers, reqBody);
        FlagResponseEntity responseEntity;
        try {
            responseEntity = JSON.parseObject(response, FlagResponseEntity.class);
        } catch (RuntimeException exception) {
            log.warn(
                    "OpenPlatformService syncWorkflowUpdate response parse failed, url = {}, workflowId = {}, bodyBytes = {}, errorType = {}",
                    url,
                    id,
                    response == null ? 0 : response.getBytes(StandardCharsets.UTF_8).length,
                    exception.getClass().getSimpleName());
            throw new BusinessException(ResponseEnum.RESPONSE_FAILED);
        }
        log.info(
                "OpenPlatformService syncWorkflowUpdate response, url = {}, workflowId = {}, statusCode = {}",
                url,
                id,
                responseEntity == null ? null : responseEntity.getCode());
        if (responseEntity == null || responseEntity.getCode() != 0) {
            throw new BusinessException(ResponseEnum.RESPONSE_FAILED);
        }
        return responseEntity.getData();
    }

    /**
     * Builds authentication headers for open platform API requests Generates timestamp and signature
     * for secure API communication
     *
     * @return Map containing authentication headers (timestamp, signature, appId)
     */

View on GitHub (pinned to 5e758547a8)