opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opencode fails to start after chocolatey install: HTTPThread: the CA is invalid

Open Mattwmaster58 opened this issue 3 months ago • 6 comments

possibly related to: https://github.com/oven-sh/bun/issues/17325

INFO  2025-10-06T15:06:52 +70ms service=default version=0.14.3 args=[] opencode
INFO  2025-10-06T15:06:52 +0ms service=project directory=C:\Users\<my username> fromDirectory
INFO  2025-10-06T15:06:52 +7ms service=config path=C:\Users\<my username>\.config\opencode\config.json loading
INFO  2025-10-06T15:06:52 +1ms service=config path=C:\Users\<my username>\.config\opencode\opencode.json loading
INFO  2025-10-06T15:06:52 +0ms service=config path=C:\Users\<my username>\.config\opencode\opencode.jsonc loading
INFO  2025-10-06T15:06:52 +3ms service=plugin [email protected] loading plugin
INFO  2025-10-06T15:06:52 +0ms service=bun pkg=opencode-copilot-auth version=0.0.3 installing package using Bun's default registry resolution
INFO  2025-10-06T15:06:52 +0ms service=bun cmd=["C:\\ProgramData\\chocolatey\\lib\\opencode\\tools\\opencode.exe","add","--force","--exact","--cwd","C:\\Users\\<my username>\\.cache\\opencode","[email protected]"] cwd=C:\Users\<my username>\.cache\opencode running
INFO  2025-10-06T15:06:52 +51ms service=bun code=1 stdout=bun add v1.2.21 (7c45ed97)
 stderr=Resolving dependencies
HTTPThread: the CA is invalid
 done
ERROR 2025-10-06T15:06:52 +2ms service=default pkg=opencode-copilot-auth version=0.0.3 name=BunInstallFailedError message=BunInstallFailedError cause=Error: Command failed with exit code 1 stack=BunInstallFailedError: BunInstallFailedError
    at new NamedError (unknown:1:28)
    at new BunInstallFailedError (B:/~BUN/root/index.js:61352:14)
    at <anonymous> (B:/~BUN/root/index.js:62739:43)
    at processTicksAndRejections (native:7:39) fatal

Different than #1694 I think - opencode doesn't even start

Windows 11, behind Cloudflare WARP

NODE_TLS_REJECT_UNAUTHORIZED=0 doesn't fix this

Setting NODE_EXTRA_CA_CERTS (ex setx NODE_EXTRA_CA_CERTS C:\ProgramData\Cloudflare\installed_cert.pem) also doesn't work, which is what I would expect based on that linked bun issue - there doesn't seem to be an easy workaround here.

Mattwmaster58 avatar Oct 06 '25 13:10 Mattwmaster58