All btrfs-tools commands need a quiet option for scripting

Bug #1694891 reported by Lucas Sandery on 2017-06-01
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
btrfs-tools (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Gianfranco Costamagna
Yakkety
Undecided
Unassigned
Zesty
Undecided
Unassigned
Artful
Undecided
Unassigned

Bug Description

[ Impact ]

by default btrfs spams a lot of messages on stderr, and has no "quiet" option to avoid that

[ Test Case ]
* Use it for a while and look at stderr messages

[ Regression potential ]
* none, the default behaviour won't change

[ Other info ]
* this is fixed in yakkety+ releases, only xenial and older are affected

Btrfs send and receive are noisy on stderr by default (messages like "At subvol foo"). It'd be great to get an option to only print there if there is an error condition. I assume there are other commands which do the same.

See the patched version that quiets send but not receive. (I didn't realise receive was also noisy when requesting the backport.)
https://lists.ubuntu.com/archives/ubuntu-devel-discuss/2017-May/017455.html
https://launchpad.net/~costamagnagianfranco/+archive/ubuntu/locutusofborg-ppa/+packages

Many scripts/cron wrappers check for output on stderr in order to notify when warnings/errors occur. There should be a way to avoid triggering such notifications when btrfs commands are successful.

Lucas Sandery (lucas+-) wrote :

Looks like it's on the horizon upstream:
https://bugzilla.kernel.org/show_bug.cgi?id=111421#c1

Maybe a prod from distro devs can help things along?

hello, does my ppa fix the issue for you? (the receive issue I mean)?

Can you please convert your bug into an SRU request if you want the patch be uploaded into the main archive.
https://wiki.ubuntu.com/StableReleaseUpdates#SRU_Bug_Template

Changed in btrfs-tools (Ubuntu):
status: New → Fix Released
Changed in btrfs-tools (Ubuntu Zesty):
status: New → Fix Released
Changed in btrfs-tools (Ubuntu Yakkety):
status: New → Fix Released
Changed in btrfs-tools (Ubuntu Xenial):
status: New → Confirmed
Changed in btrfs-tools (Ubuntu Xenial):
assignee: nobody → LocutusOfBorg (costamagnagianfranco)

Subscribing xnox :)

Uploaded in xenial new queue

Changed in btrfs-tools (Ubuntu Xenial):
status: Confirmed → Fix Committed
description: updated

Hello Lucas, or anyone else affected,

Accepted btrfs-tools into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/btrfs-tools/4.4-1ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed

The quiet mode is now there!
usage: btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]

    Send the subvolume(s) to stdout.

    Sends the subvolume(s) specified by <subvol> to stdout.
    By default, this will send the whole subvolume. To do an incremental
    send, use '-p <parent>'. If you want to allow btrfs to clone from
    any additional local snapshots, use '-c <clone-src>' (multiple times
    where applicable). You must not specify clone sources unless you
    guarantee that these snapshots are exactly in the same state on both
    sides, the sender and the receiver. It is allowed to omit the
    '-p <parent>' option when '-c <clone-src>' options are given, in
    which case 'btrfs send' will determine a suitable parent among the
    clone sources itself.

    -e If sending multiple subvols at once, use the new
                     format and omit the end-cmd between the subvols.
    -p <parent> Send an incremental stream from <parent> to
                     <subvol>.
    -c <clone-src> Use this snapshot as a clone source for an
                     incremental send (multiple allowed)
    -f <outfile> Output is normally written to stdout. To write to
                     a file, use this option. An alternative would be to
                     use pipes.
    --no-data send in NO_FILE_DATA mode, Note: the output stream
                     does not contain any file data and thus cannot be used
                     to transfer changes. This mode is faster and useful to
                     show the differences in metadata.
    -v|--verbose enable verbose output to stderr, each occurrence of
                     this option increases verbosity
    -q|--quiet suppress all messages, except errors

tags: added: verification-done-xenial
removed: verification-needed

old help menu
usage: btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>...]

    Send the subvolume(s) to stdout.

    Sends the subvolume(s) specified by <subvol> to stdout.
    By default, this will send the whole subvolume. To do an incremental
    send, use '-p <parent>'. If you want to allow btrfs to clone from
    any additional local snapshots, use '-c <clone-src>' (multiple times
    where applicable). You must not specify clone sources unless you
    guarantee that these snapshots are exactly in the same state on both
    sides, the sender and the receiver. It is allowed to omit the
    '-p <parent>' option when '-c <clone-src>' options are given, in
    which case 'btrfs send' will determine a suitable parent among the
    clone sources itself.

    -v Enable verbose debug output. Each occurrence of
                     this option increases the verbose level more.
    -e If sending multiple subvols at once, use the new
                     format and omit the end-cmd between the subvols.
    -p <parent> Send an incremental stream from <parent> to
                     <subvol>.
    -c <clone-src> Use this snapshot as a clone source for an
                     incremental send (multiple allowed)
    -f <outfile> Output is normally written to stdout. To write to
                     a file, use this option. An alternative would be to
                     use pipes.
    --no-data send in NO_FILE_DATA mode, Note: the output stream
                     does not contain any file data and thus cannot be used
                     to transfer changes. This mode is faster and useful to
                     show the differences in metadata.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package btrfs-tools - 4.4-1ubuntu1

---------------
btrfs-tools (4.4-1ubuntu1) xenial; urgency=medium

  * debian/patches/09c052a8b4dcaa96fe5e6c28b12ce24729e827a4.patch:
    backport upstream commit to add new "quiet option" and prevent printing of
    messages on stderr (LP: #1694891)

 -- Gianfranco Costamagna <email address hidden> Wed, 14 Jun 2017 19:48:16 +0200

Changed in btrfs-tools (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for btrfs-tools has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Alessandro Polverini (polve) wrote :

I'm using btrfs-progs version 4.12-1

I found a -q option to btrfs send, but since there is no btrfs receive I still see this message:
At subvol XXX

Is there any way to avoid that output too?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.