Skip to content

[bug] backup --stdin-command v0.11.3 #1792

Description

@pierreedbrg

Version 0.11.3 seems to have introduced changes about the --stdin-command.

The command i used since version 0.10.0 is now broken since i upgraded to 0.11.3 of rustic

export RUST_BACKTRACE=1
rustic backup --no-scan --host backup-container --tag="backupName:$BACKUP_NAME" --tag="ttl:$BACKUP_TTL" --tag="postgres" --stdin-filename=database.dump --stdin-command="pg_dump -Z0 -Fc" -

the output is

[INFO] using no config file, none of these exist: /root/.config/rustic/rustic.toml, /etc/rustic/rustic.toml, ./rustic.toml
[INFO] repository opendal:s3:backups: password is correct.
[INFO] using no cache
[INFO] using parents d1ce2dae
[INFO] starting to backup ["database.dump"] ...
[ERROR] Command error status: stdin-command:call : signal: 13 (SIGPIPE)
[ERROR] error backing up -: `rustic_core` experienced an error related to `running an external command`.

Message:
Experienced an error while calling an external command.


Some additional details ...

Caused by:
Command error status: stdin-command:call : signal: 13 (SIGPIPE)


Backtrace:
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
   8: <unknown>
   9: <unknown>
  10: <unknown>
  11: <unknown>
  12: <unknown>
  13: <unknown>

error: Not all snapshots were generated successfully!

as shown in the output below, with version 0.11.2 of rustic it works

export RUST_BACKTRACE=1
rustic backup --no-scan --host backup-container --tag="backupName:$BACKUP_NAME" --tag="ttl:$BACKUP_TTL" --tag="postgres" --stdin-filename=database.dump --stdin-command="pg_dump -Z0 -Fc" -
[INFO] using no config file, none of these exist: /root/.config/rustic/rustic.toml, /etc/rustic/rustic.toml, ./rustic.toml
[INFO] repository opendal:s3:backups: password is correct.
[INFO] using no cache
[INFO] using no parent
[INFO] starting to backup - ...
[INFO] Files:       1 new, 0 changed, 0 unchanged
[INFO] Dirs:        1 new, 0 changed, 0 unchanged
[INFO] Added to the repo: 905 B (raw: 2.0 KiB)
[INFO] processed 1 files, 1.9 KiB
[INFO] snapshot dc3c2b76 successfully saved.
[INFO] backup of - done.

i dont know if it helps but the following command works with v0.11.3 when piping the output of pg_dump directly, thats why it might be related to the rustic command handling itself

pg_dump -Z0 -Fc | rustic backup --no-scan --host backup-container --tag="backupName:$BACKUP_NAME" --tag="ttl:$BACKUP_TTL" --tag="postgres" --stdin-filename=database.dump -

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: Waiting for a maintainer to triage this issue/PR

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions