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

Closed
opened 2026-02-16 17:25:54 -05:00 by yindo · 3 comments
Owner

Originally created by @sudo-tee on GitHub (Jun 23, 2025).

Originally assigned to: @thdxr on GitHub.

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.

Originally created by @sudo-tee on GitHub (Jun 23, 2025). Originally assigned to: @thdxr on GitHub. 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.
yindo closed this issue 2026-02-16 17:25:54 -05:00
Author
Owner

@danriedl commented on GitHub (Jun 24, 2025):

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": "..."
}
@danriedl commented on GitHub (Jun 24, 2025): i do face the same issue with a macbook behind corporate proxy: ```sh $ 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: ```sh curl "https://api.github.com/repos/sst/opencode/releases/latest" ``` ```json { "url": "https://api.github.com/repos/sst/opencode/releases/227216807", "assets_url": "https://api.github.com/repos/sst/opencode/releases/227216807/assets", "snip": "..." } ```
Author
Owner

@sudo-tee commented on GitHub (Jun 26, 2025):

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

@sudo-tee commented on GitHub (Jun 26, 2025): Last update to `0.1.140` seems to have resolved this issue for me
Author
Owner

@danriedl commented on GitHub (Jun 26, 2025):

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

@danriedl commented on GitHub (Jun 26, 2025): I also can confirm that it is working with `0.1.140`. @sudo-tee do you mind closing this issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#243