Skip to content

Backrest 1.13.0 generates invalid sftp.args quoting for restic SFTP repositories #1227

@danez

Description

@danez

Describe the bug
After updating Backrest to 1.13.0, checking an SFTP repository fails because the generated restic command appears to pass an invalid --option=sftp.args=... value. I wanted to adapt a hook, but now cannot save it.

Backrest reports:

invalid argument "sftp.args=-oBatchMode=yes -i \"/root/.ssh/id_ed25519_backrest_hetzner\" -p 23 -oUserKnownHostsFile=\"/root/.ssh/known_hosts\"" for "-o, --option" flag: parse error on line 1, column 30: bare " in non-quoted-field

The generated flag seems to be:

--option=sftp.args='-oBatchMode=yes -i "/root/.ssh/id_ed25519_backrest_hetzner" -p 23 -oUserKnownHostsFile="/root/.ssh/known_hosts"'

To Reproduce
Steps to reproduce the behavior:

  1. Update Backrest to 1.13.0

  2. Configure an SFTP repository using custom SFTP args, including quoted paths, for example:

    -oBatchMode=yes -i "/root/.ssh/id_ed25519_backrest_hetzner" -p 23 -oUserKnownHostsFile="/root/.ssh/known_hosts"
  3. Run a repository check

  4. See the error shown in the screenshot

Expected behavior
The repository check should run successfully, or Backrest should generate/pass the sftp.args option in a format accepted by restic.

Screenshots

Image

Platform Info

  • OS and Architecture: Linux / Docker on Raspberry Pi 5 arm64
  • Backrest Version: 1.13.0

Additional context
This started after updating to Backrest 1.13.0. The issue seems related to quoting/escaping in the generated --option=sftp.args=... argument.

Luckily backups still work fine with the saved config, but I cannot modify it now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions