iflytek/astron-agent · error · BusinessException

MODEL_URL_CHECK_FAILED

MODEL_URL_CHECK_FAILED

Error message

ResponseEnum.MODEL_URL_CHECK_FAILED

What it means

Generic failure wrapper for SSRF validation of model URLs inside workflow validation. When rebuilding/normalizing a model URL and validating host/IP rules via ssrfGuard.validateUrlParam throws an unexpected (non-Business) exception, it is logged and rethrown as MODEL_URL_CHECK_FAILED. BusinessExceptions from the guard are passed through unchanged.

Solutions

  1. Check the log line 'workflow model url check failed' for the underlying exception
  2. Correct the model URL: valid scheme, hostname, and port (e.g. https://host:8443)
  3. Confirm the host is not an internal/SSRF-protected address if the guard rejects it
  4. Verify the config-driven IP rules load correctly (configInfoMapper data intact)

Example fix

// before
String url = "https://model host:notaport/v1";
// after
String url = "https://model-host:8443/v1";
Defensive patterns

Strategy: validation

Validate before calling

try { new URI(url); } catch (URISyntaxException e) { throw new IllegalArgumentException("malformed model url: " + url); }

Try / catch

try { workflowService.save(req); } catch (BusinessException e) { if ("MODEL_URL_CHECK_FAILED".equals(e.getCode().name())) { /* inspect and fix URL */ } throw e; }

Prevention

When it happens

Trigger: Model endpoint URL that fails URL normalization/parsing (malformed URI syntax, invalid host or port) during the check; unexpected exception inside the SSRF guard or IP-rule loading.

Common situations: Typos in the model URL (missing scheme fragments, invalid port); URLs with characters URI.create rejects; DNS/IP-rule subsystem misconfigured so rule loading throws.

Understand the failure class

Background: "Invalid URL" / "URL cannot be empty": fix the malformed or missing URL behind request-construction failures — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at console/backend/toolkit/src/main/java/com/iflytek/astron/console/toolkit/service/workflow/WorkflowService.java:2172

            final boolean isAgent = node.getId().startsWith(WorkflowConst.NodeType.AGENT);
            final String url = isAgent
                    ? Optional.ofNullable(nodeParam.getJSONObject("modelConfig")).map(o -> o.getString("api")).orElse(null)
                    : nodeParam.getString("url");
            if (StringUtils.isBlank(url)) {
                continue;
            }
            ensureHttpLikeScheme(url);
            try {
                SsrfValidators.Normalized n = SsrfValidators.normalizeFlex(SsrfValidators.stripUserInfo(url));
                URL norm = n.effectiveUrl;
                String rebuilt = SsrfValidators.rebuildWithOriginalScheme(norm, n.originalScheme, n.wsLike);
                String hostOnly = rebuilt + "://" + norm.getHost() + (norm.getPort() != -1 ? (":" + norm.getPort()) : "");
                ssrfGuard.validateUrlParam(hostOnly);
            } catch (BusinessException e) {
                throw e;
            } catch (Exception e) {
                log.error("workflow model url check failed :", e);
                throw new BusinessException(ResponseEnum.MODEL_URL_CHECK_FAILED);
            }
        }
    }

    private List<String> loadIpRules(String category) {
        List<ConfigInfo> cfgList = configInfoMapper.getListByCategory(category);
        if (cfgList == null || cfgList.isEmpty() || StringUtils.isBlank(cfgList.get(0).getValue())) {
            return Collections.emptyList();
        }
        return Arrays.stream(cfgList.get(0).getValue().split(","))
                .map(String::trim)
                .filter(StringUtils::isNotBlank)
                .distinct()
                .toList();
    }

    private void ensureHttpLikeScheme(String url) {
        String lower = StringUtils.left(url.trim(), 6).toLowerCase(Locale.ROOT);

View on GitHub (pinned to 5e758547a8)