Skip to content

ConnectionRefused: Unable to connect. Is the computer able to access the url? #54056

Closed as not planned

Description

@NecorChen

Activity

  1. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Thanks for the report and for attaching the debug logs! They show OpenCode Desktop 2.0.26 on Windows, with the opencode-go provider (mostly deepseek-v4.1-flash). Sessions there fail with:

    AI.Error.Transport: ConnectionRefused: Unable to connect. Is the computer able to access the url?
    

    The same logs also show requests to https://models.opencode.ai/api.json failing with self signed certificate, and the app's update check failing with ERR_CONNECTION_RESET. That usually means something on the network is intercepting or blocking HTTPS traffic, such as a corporate proxy, a VPN, or antivirus/firewall software that inspects HTTPS.

    To look into this further, could you tell us briefly, in your own words:

    1. What you were doing when it happened (e.g. sending a prompt in a new session) and whether it ever worked on this machine or network.
    2. Whether you're behind a proxy, VPN or company network, or running security software that inspects HTTPS. If so, have you set HTTPS_PROXY and/or NODE_EXTRA_CA_CERTS? Both are covered in the network docs.
    3. Whether https://opencode.ai opens normally in a browser on the same machine, and whether curl -v https://models.opencode.ai/api.json reports a certificate problem.

    You can reply here or edit the issue. If you edit it, please also leave a comment saying you've updated it so we know you're done.

    These related issues might also help. They're ordered from most to least likely to be relevant:

  2. NecorChen commented on Oct 9, 2026

    @NecorChen
    Author

    opencode-debug-20261009T073523.zip
    I didn't modify anything. It worked properly for a while just now, but now it's malfunctioning again. I don't think this is a network configuration issue.

  3. opencode-agent commented on Oct 9, 2026

    @opencode-agent
    Contributor

    Thanks for the second set of logs, that helps! You're right that you didn't change anything in OpenCode, and "works for a while, then breaks" matches what the logs show. But the logs point to something between your machine and the internet, not to an OpenCode bug. Here's what the new logs contain (times in UTC):

    • Sessions failed again with ConnectionRefused: Unable to connect at 07:10:42 and 07:11:27.
    • From about 05:28 to 07:28, requests to models.opencode.ai timed out about every 5 minutes. At 07:27:48 the hostname didn't resolve at all: getaddrinfo ENOTFOUND models.opencode.ai. Your first zip also had self signed certificate errors for the same host.
    • At 07:24:56 your Context7 MCP server failed with the same ConnectionRefused error. Context7 is a third-party service, not OpenCode's model provider, so connections to unrelated hosts were failing at the same time.

    OpenCode only makes normal HTTPS requests. Name lookups (DNS), certificates and refused connections are handled by Windows or by software sitting in the path, such as a proxy/VPN client, a company network, or antivirus/firewall software that scans HTTPS. Failures that come and go across several unrelated hosts usually come from one of those.

    To help narrow it down, could you tell us:

    1. Do you run a proxy or VPN client (for example Clash, v2rayN or a company VPN), or antivirus or security software that inspects HTTPS? If so, does the problem go away when you turn it off, or when you set HTTPS_PROXY / NODE_EXTRA_CA_CERTS as described in the network docs?
    2. When it fails again, what do nslookup models.opencode.ai and curl -v https://opencode.ai show in a terminal on the same machine?

    If both of those work while OpenCode is failing at the same moment, please reply here with the output. That would point back to OpenCode, and we'll look into it further.

  4. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Closing this for now because we didn't get the details needed to look into it further. Thanks for sending both debug zips. They show the ConnectionRefused errors happening at the same time as other connection failures: DNS lookups failing (ENOTFOUND models.opencode.ai), timeouts, self signed certificate errors, and failed connections to the separate Context7 MCP server. That points to something between your machine and the internet, such as a proxy/VPN client, unstable DNS, or antivirus that scans HTTPS, rather than to OpenCode itself.

    If it happens again, you can comment here or open a new issue. Please include:

    • whether you use a proxy, VPN or HTTPS-scanning security software
    • the output of nslookup models.opencode.ai and curl -v https://opencode.ai, run while OpenCode is failing

    If those commands work at the same moment OpenCode fails, that's a strong sign of an OpenCode bug and we'll be glad to look again. The network docs cover HTTPS_PROXY and NODE_EXTRA_CA_CERTS, which might help in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions