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

オープン 初心者向け
#727 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
静か

調査の方向性

まず drive files download のヘルプ出力と、既存の Drive レシピまたはドキュメントを確認します。ドキュメントに記載されている downloadfiles get --params '{"alt":"media"}' のパスを比較し、通常のファイルについての案内を明確にします。完了の条件は、ユーザーが動作するバイナリダウンロードのパターンに誘導され、長時間実行オペレーションの範囲が明確になっていることです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
31.1k
フォーク
1.8k
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

googleworkspace/cli のほかの issue

googleworkspace/cli の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。