Manual backup via POST /api/hosts/{id}/jobs sends paths:null — "Fatal: nothing to backup" #55
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
POST /api/hosts/{id}/jobswith{"kind":"backup"}dispatches a job with no source paths, so restic aborts immediately. The per-source-group aliasPOST /api/hosts/{id}/source-groups/{gid}/runworks correctly on the same host with the same configuration.This is the same shape as #36 (manual forget not receiving
forget_groups), but for the backup kind: the manual dispatch path does not populate the structured payload that the scheduled path does.Reproduce
On a host with a healthy source group (
includespopulated, backups succeeding on schedule):Observed
Job fails in ~15ms:
Agent log shows the payload arrived empty:
Contrast — the source-group alias works
Same host, same moment, via
POST /api/hosts/{id}/source-groups/{gid}/run:That job succeeded. Note
tagis also empty in the failing case, so even if paths were supplied the snapshot would be untagged and fall outside the tag-scoped retention groups used by forget.Impact
Low-to-medium in consequence but high in confusion:
{"kind":"backup"}is the most obvious way to trigger an ad-hoc backup from the API, it is accepted with202, and it always fails. The failure also raises abackup_failedalert, so routine API use generates noise that looks like a real backup problem.For a host with multiple source groups the fix presumably needs to either back up all groups or require the caller to name one — worth deciding explicitly rather than defaulting.
Suggested fix
Mirror what #36 did for forget: have
dispatchJobpopulate the structured payload forkind: backupfrom the host's source groups (paths, excludes, tag), and reject with a structured error when the host has no usable source group — rather than dispatching a job that cannot succeed.Environment
v1.2.1, agentv1.2.1, restic0.18.1