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

Abierto Apto para principiantes
#825 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
72/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
go
Área
cli

Línea de trabajo

Empieza en internal/pathmeta/path_meta.go alrededor de las líneas 143-146, donde $HOME/.vfox/tmp se crea con os.MkdirAll, mientras que los directorios de instalaciones y plugins de VFOX_HOME usan os.Mkdir y se ignoran los errores. El error aparece en internal/manager.go:563. Para reproducirlo, establece VFOX_HOME en un directorio que no exista y ejecuta vfox add --source sobre un zip de plugin. Está terminado cuando VFOX_HOME se crea con MkdirAll, o cuando add falla pronto con un mensaje que menciona VFOX_HOME, y los errores ya no se descartan.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Go
Estrellas
4k
Forks
177
Merge medio
1 d 20 h
PR fusionados (30 d)
31

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de version-fox/vfox

Todos los issues de version-fox/vfox

Issues similares

Más issues de Go

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.