Skip to content

panic: failed to get config: 502 under WSL #337

Closed

Description

@sudo-tee

I'm facing this issue under WSL, it's probably related to some corporate network config. But every other network related stuff is working properly under my WSL config.

panic: failed to get config: 502

goroutine 1 [running]:
main.main()
        /home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:64 +0xaba

WSL distro info

uname -a
Linux MTL-DB283 6.6.87.2-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Thu Jun  5 18:30:46 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

When I curl to 0.0.0.0/config_get I get this error from a proxy server

curl http://0.0.0.0/config_get -I
HTTP/1.1 502 cannotconnect
Via: 1.1 10.180.111.22 (Skyhigh Secure Web Gateway 12.2.7.48536)
Content-Type: text/html
Cache-Control: no-cache
X-Frame-Options: deny

And the error message is
The proxy could not connect to the destination in time.

verbose output

opencode --print-logs
INFO  2025-06-23T17:22:47 +64ms service=default version=0.1.121 args=--print-logs opencode
INFO  2025-06-23T17:22:47 +1ms service=app cwd=/home/francis/dots creating
INFO  2025-06-23T17:22:47 +3ms service=app git=/home/francis/dots git
INFO  2025-06-23T17:22:47 +14ms service=app name=provider registering service
INFO  2025-06-23T17:22:47 +0ms service=app name=config registering service
INFO  2025-06-23T17:22:47 +8ms service=config $schema=https://opencode.ai/config.json theme=opencode autoshare=false autoupdate=true model=github-copilot/gpt-4.1 loaded
INFO  2025-06-23T17:22:47 +1ms service=models.dev refreshing
INFO  2025-06-23T17:22:47 +2ms service=provider init
INFO  2025-06-23T17:22:48 +405ms service=provider providerID=github-copilot found
INFO  2025-06-23T17:22:48 +0ms service=provider providerID=openai found
INFO  2025-06-23T17:22:48 +0ms service=app name=share registering service
INFO  2025-06-23T17:22:48 +0ms service=bus type=storage.write subscribing
INFO  2025-06-23T17:22:48 +0ms service=app name=bus registering service
panic: failed to get config: 502

goroutine 1 [running]:
main.main()

and of course I don't have any access to the corporate proxy server.

Activity

  1. self-assigned this
    on Jun 23, 2025
  2. danriedl commented on Jun 24, 2025

    @danriedl

    i do face the same issue with a macbook behind corporate proxy:

    $ opencode --print-logs .
    INFO  2025-06-24T12:46:53 +22ms service=default version=0.1.126 args=--print-logs,. opencode
    INFO  2025-06-24T12:46:53 +1ms service=app cwd=/Users/dan creating
    INFO  2025-06-24T12:46:53 +1ms service=app git=/Users/dan git
    INFO  2025-06-24T12:46:53 +3ms service=app name=provider registering service
    INFO  2025-06-24T12:46:53 +0ms service=app name=config registering service
    INFO  2025-06-24T12:46:53 +2ms service=config loaded
    INFO  2025-06-24T12:46:53 +1ms service=models.dev refreshing
    INFO  2025-06-24T12:46:53 +0ms service=provider init
    INFO  2025-06-24T12:46:53 +0ms service=provider providerID=github-copilot found
    INFO  2025-06-24T12:46:53 +0ms service=provider providerID=openai found
    INFO  2025-06-24T12:46:53 +0ms service=app name=share registering service
    INFO  2025-06-24T12:46:53 +1ms service=bus type=storage.write subscribing
    INFO  2025-06-24T12:46:53 +0ms service=app name=bus registering service
    panic: failed to get config: 500
    
    goroutine 1 [running]:
    main.main()
    	/home/runner/work/opencode/opencode/packages/tui/cmd/opencode/main.go:64 +0x8c0
    error: InvalidHTTPResponse fetching "https://api.github.com/repos/sst/opencode/releases/latest". For more information, pass `verbose: true` in the second argument to fetch()
      path: "https://api.github.com/repos/sst/opencode/releases/latest",
     errno: 0,
      code: "InvalidHTTPResponse"
    
    
    Bun v1.2.16 (macOS arm64)
    

    curl and other tools are working with my env:

    curl "https://api.github.com/repos/sst/opencode/releases/latest"
    {
      "url": "https://api.github.com/repos/sst/opencode/releases/227216807",
      "assets_url": "https://api.github.com/repos/sst/opencode/releases/227216807/assets",
      "snip": "..."
    }
  3. sudo-tee commented on Jun 26, 2025

    @sudo-tee
    Author

    Last update to 0.1.140 seems to have resolved this issue for me

  4. danriedl commented on Jun 26, 2025

    @danriedl

    I also can confirm that it is working with 0.1.140.
    @sudo-tee do you mind closing this issue?

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions