Skip to content

[BUG] [Lidarr] BeetsTagger broken pipe: find piped to read causes SIGPIPE #411

@barrettclark

Description

@barrettclark

Description

BeetsTagger.bash line 49 uses find "$1" -type f -iname "*.flac" | read to test whether any FLAC files exist. The read builtin closes the pipe after consuming one line, sending SIGPIPE to find before it finishes traversing the directory. This produces log noise on every BeetsTagger run:

[Error] BeetsTagger.bash: find: 'standard output': Broken pipe
[Error] BeetsTagger.bash: find: write error

Fix

Replace find ... | read with find ... | grep -q .:

# Before
if find "$1" -type f -iname "*.flac"  | read; then

# After
if find "$1" -type f -iname "*.flac" | grep -q .; then

grep -q . exits 0 if any output exists (equivalent to the original intent) without closing the pipe early.

This is the same class of broken pipe as the jq | head -n1 issue in the Connect scripts.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions