You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ARIS工具调用ARIS API仓库遇Connection refused错误求助

Troubleshooting "Connection refused: connect" in ARIS API Calls

Let’s break down the possible issues here and walk through how to fix your connection refused error in ARIS:

First, a quick key point: the Connection refused error almost always signals a network-level problem, not an authentication issue (since you’ve confirmed your credentials work directly in the API repository). Here’s how to diagnose and resolve this step by step:

1. Verify Network Connectivity from the ARIS Environment

Start by confirming the machine running ARIS can even reach the API repository URL:

  • On the ARIS host machine, use a command-line tool like curl to test the connection:
    curl -X POST [your-full-api-url] -H "Authorization: Basic [your-base64-encoded-auth-string]"
    
  • If you can’t use command-line tools, try accessing the API URL via a browser on the same machine.
  • If this test fails, the root cause is likely one of these:
    • A firewall rule blocking outbound traffic from ARIS to the API’s port (e.g., port 443 for HTTPS).
    • ARIS requires a proxy server to access external APIs, which isn’t configured in your script or the ARIS environment.
    • The API repository is only accessible from your local dev machine (where you tested it) but not from the network where ARIS is hosted.

2. Fix Critical Authentication Header Bugs (For When Connectivity Works)

Even though your current error is network-related, your script has a common auth header bug that will break things once connectivity is fixed:

  • The Basic auth header requires a space between "Basic" and the encoded string. Your code has:
    con.setRequestProperty("Authorization", "Basic" + encoder);
    
    This should be updated to:
    con.setRequestProperty("Authorization", "Basic " + encoder);
    
  • Double-check your Base64 encoding logic. In modern Java, the correct way to encode your auth string is:
    byte[] authBytes = authString.getBytes(java.nio.charset.StandardCharsets.UTF_8);
    String encoder = java.util.Base64.getEncoder().encodeToString(authBytes);
    
    If ARIS uses an older Java version without java.util.Base64, you may need to use a compatible library (like Apache Commons Codec) or ARIS-specific Base64 utilities.
  • Also, confirm the ARIS API explicitly supports a 4-part auth string (tenant:name:password:key) for Basic auth. Most standard Basic auth uses a 2-part string, but if the API docs specify this format, you’re good to go.

3. Check ARIS Script Execution Restrictions

ARIS may have built-in constraints on outbound network calls:

  • Verify your ARIS license allows scripted external API calls—some licenses restrict this functionality.
  • Check with your ARIS administrator if there are server-level policies blocking outbound HTTP/HTTPS requests from scripts.

4. Add Debug Logging for More Context

If you’re still stuck, add debug statements to your script to gather extra details:

  • Print the full URL you’re trying to connect to (ensure there are no typos or missing protocols like https://).
  • Catch and print any additional exceptions beyond the connection error to get clearer context.

内容的提问来源于stack exchange,提问作者programernc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 04:23:31