vfox add --source fails with a raw rename error when VFOX_HOME does not exist
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
internal/pathmeta/path_meta.go の143〜146行目付近から始めてください。ここでは $HOME/.vfox/tmp が os.MkdirAll で作成されていますが、VFOX_HOME 配下のインストール先とプラグインのディレクトリは os.Mkdir で作成され、エラーは無視されています。エラーは internal/manager.go:563 を経由して表面化します。再現するには、VFOX_HOME を存在しないディレクトリに設定し、プラグインの zip に対して vfox add --source を実行します。VFOX_HOME が MkdirAll で作成されるか、VFOX_HOME の名前を含むメッセージで add が早期に失敗するようになり、エラーが破棄されなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
With VFOX_HOME set to a directory that does not exist, vfox add --source validates the plugin, then fails with an operating system error. docs/guides/multi-user-sharing.md asks users to create the directory first (mkdir -p /opt/vfox, then export VFOX_HOME=/opt/vfox). The error does not name VFOX_HOME, and the code that should create the directories ignores its errors.
Reproduction on a GitHub-hosted runner (Ubuntu 26.04.1, x86_64) with the vfox 1.1.0 release archive (checksum verified) and the zip archive of the vfox-etcd v0.2.3 tag. Run: https://github.com/version-fox/vfox-plus/actions/runs/45056971190
VFOX_HOME="$W/no-such-dir/vfox-home" vfox add --source vfox-etcd-v0.2.3.zip
# exit 1
# stdout: Validating .../vfox-etcd-v0.2.3.zip ...
# stderr: install plugin error: rename .../.vfox/tmp/vfox-4056581461 .../no-such-dir/vfox-home/plugin/etcd: no such file or directory
mkdir -p "$W/no-such-dir/vfox-home"
VFOX_HOME="$W/no-such-dir/vfox-home" vfox add --source vfox-etcd-v0.2.3.zip
# exit 0
The same error occurs when only VFOX_HOME itself is missing and its parent exists (checked on Linux with vfox 1.1.0).
Without VFOX_HOME, a HOME that has no .vfox yet works: vfox add --source exits 0, because $HOME/.vfox is created.
With the same missing VFOX_HOME, vfox list exits 1 with you don't have any sdk installed yet, which does not say that the directory is missing.
Cause: internal/pathmeta/path_meta.go:143 creates $HOME/.vfox/tmp with os.MkdirAll, but path_meta.go:145-146 create the installs and plugin directories of VFOX_HOME with os.Mkdir, which does not create parents, and ignore its error (_ = os.Mkdir(...)). The rename of the validated plugin into plugin/ then fails, and internal/manager.go:563 wraps it as install plugin error.
Expected: VFOX_HOME is created, or add stops before the download with a message that names VFOX_HOME.
Severity: low. The directory is a documented step, so this concerns the error message and the ignored errors.
- 主要言語
- Go
- スター
- 4k
- フォーク
- 177
- 平均マージ
- 1日 20時間
- マージ済み PR(30日)
- 31
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
version-fox/vfox のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
version-fox/vfox#823 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
version-fox/vfox#824 ·
メンテナーはふだん 1 日以内に返信
-
Plugins fail to load when the HOME path contains ';' or '?' (Lua package.path)対応中かも @Xnadir が今日担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
version-fox/vfox#821 ·
メンテナーはふだん 1 日以内に返信
-
[BUG]: the Available cache ignores the environment, so one setting's list is shown for another対応中かも @nanami7777777 が今日担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
version-fox/vfox#816 ·
メンテナーはふだん 1 日以内に返信
-
[Feature]: treat two names of one install as the same version対応中かも @Detoy が今日担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
version-fox/vfox#814 ·
メンテナーはふだん 1 日以内に返信
version-fox/vfox の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
seaweedfs/seaweed-block#443 ·
メンテナーはふだん 1 日以内に返信
-
HTTP `batch.Send` returns nil and inserts no rows when the block does not encode対応中かも @Indian-boult が今日担当しました。 オープンbug queries
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ClickHouse/clickhouse-go#2155 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
transparency-dev/tessera#1286 ·
メンテナーはふだん 1 日以内に返信