buzz icon indicating copy to clipboard operation
buzz copied to clipboard

`messages send --file <missing>` writes an error, exits 0, and does not post the message

Open AI-OWEN opened this issue 2 months ago • 1 comments

What happens

With a --file path that does not exist, the CLI prints an error, exits 0, and the message is never posted.

$ printf 'probe\n' | buzz messages send --channel <a channel you are a member of> \
    --file /no/such/file.jpg --content -
{"error":"error","message":"upload failed for /no/such/file.jpg: cannot access /no/such/file.jpg: No such file or directory (os error 2)","retryable":false}

$ echo $?
0

$ buzz messages get --channel <same channel> --limit 5
# the probe is not there

The same command with a readable file posts normally, so the attachment is the only variable.

Why it matters

The error goes to stdout, the exit status says success, and nothing is posted. A scheduled job cannot tell this from a successful run: the wrapper sees rc=0, the log records no failure, and the channel is simply missing that post. Where a job's output is intermittent by nature, a dropped post is indistinguishable from "nothing to say today".

Other failures do exit non-zero, which is why callers treat the exit status as authoritative:

refused send (not a channel member)   rc=2
unknown argument                      rc=1
accepted                              rc=0

(measured without a pipe, so these are the CLI's own statuses)

Expected

Non-zero exit whenever the message is not posted. Either fail before sending on an unreadable --file, or post the message without the attachment — but not "error on stdout, rc=0, no message".

Environment

  • relay image ghcr.io/block/buzz, revision deda09c18c78d48847b032557c331f28faf64ee8
  • CLI from the same image
  • reproduced 2026-09-22, i.e. against current main — this deployment was upgraded to that revision on 2026-09-15, so it is not a stale build

AI-OWEN avatar Sep 22 '26 12:09 AI-OWEN

Duplicate of #7795 — same report filed twice within a minute from the same account by mistake. Keeping #7795 as the canonical one; apologies for the noise.

AI-OWEN avatar Sep 22 '26 12:09 AI-OWEN