Skip to content

vfox add --source fails with a raw rename error when VFOX_HOME does not exist #825

Done

Description

@linghengqian

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.

Activity

  1. added
    bug
    help wanted
    and removed
    help wanted
    on Nov 22, 2026
  2. added this to the 1.1.1 milestone on Nov 23, 2026
  3. added a commit that references this issue on Nov 23, 2026
    3fc868e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions