iflytek/astron-agent · error

Tenant application credential verification request failed

Error message

Tenant application credential verification request failed: {}

What it means

verify() catches IOException | RuntimeException around the HTTP execute/parse phase and logs "Tenant application credential verification request failed: {simple class name}" before returning Optional.empty(). This is the transport/exception branch: network I/O failure (OkHttp IOException) or an unexpected runtime exception (e.g. JSON parse error in parseAppId) during the verification call.

Solutions

  1. Check backend logs for the exception class name and correlated stack trace (connection vs parse failure).
  2. Verify network reachability and TLS to the tenant service (curl/timeouts).
  3. If parse errors: inspect the actual tenant response body and update parseAppId to the current schema.
  4. Add connect/read timeouts and retry-on-idempotent for transient IOExceptions.
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check reachability
boolean reachable = InetAddress.getByName(tenantHost).isReachable(2000);

Try / catch

try {
    return authClient.verify(apiKey, apiSecret);
} catch (RuntimeException e) {
    log.error("tenant verify transport failure", e);
    return Optional.empty(); // or fail-open per policy
}

Prevention

When it happens

Trigger: httpClient.newCall(request).execute() throws IOException (connection refused, timeout, TLS), or parseAppId/response handling throws RuntimeException (malformed JSON, NPE).

Common situations: Tenant service unreachable (wrong host/port, DNS failure); connection timeout under load; tenant service returns non-JSON body causing parse failure; OkHttp client misconfigured (bad TLS/proxy).

Related errors


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

Appendix: source

Thrown at console/backend/hub/src/main/java/com/iflytek/astron/console/hub/service/gateway/impl/HttpTenantGatewayAuthClient.java:80

        JSONObject requestBody = new JSONObject();
        requestBody.put("api_key", apiKey);
        requestBody.put("api_secret", apiSecret);

        Request request = new Request.Builder()
                .url(verifyAppAuthUrl)
                .header(TenantInternalApiKey.HEADER, configuredInternalKey)
                .post(RequestBody.create(requestBody.toJSONString(), JSON_MEDIA_TYPE))
                .build();

        try (Response response = httpClient.newCall(request).execute()) {
            if (!response.isSuccessful()) {
                log.warn("tenant verify app auth request failed, status={}", response.code());
                return Optional.empty();
            }
            return parseAppId(response.body());
        } catch (IOException | RuntimeException ex) {
            log.warn(
                    "Tenant application credential verification request failed: {}",
                    ex.getClass().getSimpleName());
            return Optional.empty();
        }
    }

    private Optional<String> parseAppId(ResponseBody body) throws IOException {
        if (body == null) {
            return Optional.empty();
        }
        JSONObject responseJson = JSON.parseObject(body.string());
        Integer code = responseJson == null ? null : responseJson.getInteger("code");
        if (code == null || code != 0) {
            return Optional.empty();
        }
        JSONObject data = responseJson.getJSONObject("data");
        if (data == null) {
            return Optional.empty();

View on GitHub (pinned to 5e758547a8)