`drive files download` vs `drive files get --params alt=media`: guide which to use; `download` returns 500 `backendError` on ordinary files

Abierto Apto para principiantes
#727 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
62/100
Tipo de issue
Documentación
Claridad
Bastante claro
Estado de actividad
Tranquilo

Línea de trabajo

Empieza inspeccionando la salida de ayuda de drive files download y las recetas o la documentación existentes de Drive. Compara las rutas documentadas download y files get --params '{"alt":"media"}' y, después, haz explícita la orientación para archivos ordinarios; se considerará terminado cuando los usuarios sean dirigidos al patrón funcional de descarga binaria y el alcance de la operación de larga duración quede claro.

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

Descripción

Problem

Two subcommands look like they do the same thing, but only one works for ordinary file downloads:

  • gws drive files downloadalways returns 500 Internal error encountered (backendError) on regular Drive files (My Drive WAV/JPG/JSON/PDF, etc.)
  • gws drive files get --params '{"alt":"media"}' → works correctly

The name download strongly suggests it's the right choice, especially for agents/LLMs generating calls from the schema. It isn't — drive.files.download is a long-running operation (POST) intended for a narrow set of cases (e.g. exporting Google Vids, large export operations). For arbitrary binary downloads the correct call is files.get with alt=media.

Reproduction

FID="<any regular Drive file ID>"

# Fails every time:
gws drive files download --params "{\"fileId\":\"$FID\",\"alt\":\"media\"}" -o out.bin
# → { "error": { "code": 500, "message": "Internal error encountered.", "reason": "backendError" } }

# Works every time:
gws drive files get --params "{\"fileId\":\"$FID\",\"alt\":\"media\"}" -o out.bin

Verified on `gws 0.22.5` (macOS, Apple Silicon). 3/3 failures vs 3/3 successes against the same file ID.

Why this hurts

Agents that write calls from the discovery schema gravitate to the one literally named `download`. The resulting 500 gives no hint that a different verb is the right answer; users spend a long time assuming Drive is down or the CLI is broken. (I sunk ~30 minutes before figuring it out.)

Suggestions (any one helps)

  1. Help text / docs — add a one-liner to `drive files download --help` and any relevant recipe: "For ordinary file content downloads use `drive files get --params '{"alt":"media"}'`; this command is for long-running operations only."
  2. Recipe — add `recipe-drive-download` (or similar) that shows the `files.get` + `alt=media` pattern with `-o` for binaries and stdout for text.
  3. Pre-flight warning — if `drive files download` is invoked against a file whose MIME type doesn't require the long-running path, emit a warning pointing at `files get`.

Happy to open a PR for (1) if that's the preferred shape.

Lenguaje dominante
Rust
Estrellas
31.1k
Forks
1.8k
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

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 googleworkspace/cli

Todos los issues de googleworkspace/cli

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.