opencode update/upgrade times out behind corporate npm mirror: installer hard-codes registry.npmjs.org and ignores configured registry
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- bash, typescript
調査の方向性
install にある curl インストーラーを読み、特に 195、199、212 行目のレジストリ URL と、npm の設定をどのように受け取るかを確認してください。レジストリミラーを設定して再現し、インストーラーが利用可能性の確認と tarball のダウンロードの両方でそのミラーを使用することを確かめてください。設定済みのレジストリを更新処理で使用でき、未設定の場合は引き続き npmjs にフォールバックすれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
opencode update (and the opencode upgrade step it shells out to) times out on networks where registry.npmjs.org is unreachable, even though the machine has a fully working corporate npm mirror (JFrog Artifactory) configured in ~/.npmrc.
Root cause: the curl installer script hard-codes https://registry.npmjs.org in three places, ignoring the configured npm registry:
installline 195 — version availability check:https://registry.npmjs.org/$package_scope%2fcli-$target/$specific_versioninstallline 199 — legacy package name fallback, same hard-coded hostinstallline 212 — tarball download:url="https://registry.npmjs.org/$package_name/-/$filename"
On my network registry.npmjs.org connections hang until timeout (the corporate egress proxy never completes the TLS handshake to that host), so both the availability check and the tarball download fail. opencode update reports only "Timed out" with no indication of which URL/host failed, and no way to point it at the internal mirror.
Evidence from this network:
$ curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" https://registry.npmjs.org/@opencode%2fcli-linux-x64/2.2.5
HTTP 000 / connection hangs (killed after 15 s)
$ curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" https://api.github.com/ # control
HTTP 200 0.55 s
The internal mirror serves the exact same package and tarball (same path shape, same checksums):
$ curl -s -o /dev/null -w "%{http_code} %{time_total}s\n" \
https://<internal-artifactory>/api/npm/npm-group-all/@opencode%2fcli-linux-x64/2.2.5
HTTP 200 2.2 s
Workaround I used: download the GitHub release tarball manually and install it with install --binary, which correctly skips the npm download path.
This is the installer-side instance of the registry problem tracked in #57797 (which covers the Desktop SSH bootstrap). Suggested fix, same as proposed there: respect NPM_CONFIG_REGISTRY / npm_config_registry (and ideally ~/.npmrc registry=) with fallback to https://registry.npmjs.org:
registry="${NPM_CONFIG_REGISTRY:-${npm_config_registry:-https://registry.npmjs.org/}}"
registry="${registry%/}"
then use $registry in place of the three hard-coded URLs. Additionally, failing fast with a clear error naming the unreachable host (instead of a generic "Timed out") would make this class of problem diagnosable.
Steps to reproduce
- Be on a network where
registry.npmjs.orgis unreachable (direct or via corporate egress proxy that cannot reach it), with a working npm mirror set in~/.npmrc. - Run
opencode updatewith any version prior to the target. - The
opencode upgrade --method curlstep shells out to the install script, which hangs onregistry.npmjs.organd is killed by the updater's timeout.
┌ Upgrade
│ ● Using method: curl
│ ● From 2.0.18 → 2.2.5
│ ■ Upgrade failed
│ ■ The OpenCode installer failed
│ │ Timed out
│ │ Command opencode upgrade 2.2.5 --method curl
└ Failed
OpenCode version
2.0.18 → 2.2.5 (upgrade attempt); affected installer script served at https://opencode.ai/v2/install
Operating System
RHEL 8 x86_64 (linux-x64)
Terminal
bash
- 主要言語
- TypeScript
- スター
- 224k
- フォーク
- 30k
- 平均マージ
- 4時間 44分
- マージ済み PR(30日)
- 513
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
anomalyco/opencode のほかの issue
-
pending close triaging
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#62582 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anomalyco/opencode#62516 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
anomalyco/opencode#62374 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
anomalyco/opencode#62362 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
reproduced
難易度 2/5 1〜3時間 初心者へのやさしさ 63/100
anomalyco/opencode#62343 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
anomalyco/opencode の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
callstack/react-native-paper#5189 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
live-codes/livecodes#1079 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add: ESP 2 ROオープンapproved check:passed streams:add
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信