Skip to content

[BUG] [Lidarr] LidarrTaskStatusCheck hangs indefinitely when ProcessMonitoredDownloads is running #407

@barrettclark

Description

@barrettclark

Description

The LidarrTaskStatusCheck function in Audio.service.bash polls the Lidarr command API and waits until all started commands complete before proceeding. However, ProcessMonitoredDownloads is an internal Lidarr background task with isLongRunning: true that runs continuously and never finishes. This causes the Audio script to hang indefinitely at:

STATUS :: LIDARR BUSY :: Pausing/waiting for all active Lidarr tasks to end...

Root Cause

File: lidarr/Audio.service.bash, LidarrTaskStatusCheck function

taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq -r '.[] | select(.status=="started") | .name' | wc -l)

The Lidarr API returns ProcessMonitoredDownloads with "status": "started" and "body": {"isLongRunning": true}. Since this task never transitions to completed, taskCount is always ≥ 1 and the loop never breaks.

Symptoms

  • Audio script permanently stuck at "LIDARR BUSY" after any Lidarr restart
  • All queued Lidarr commands (MoveArtist, RescanFolders, DownloadedAlbumsScan) pile up and never run
  • No downloads are processed until the container is restarted

Fix

Filter out long-running commands from the task count:

taskCount=$(curl -s "$arrUrl/api/v1/command?apikey=${arrApiKey}" | jq '[.[] | select(.status=="started") | select(.body.isLongRunning != true)] | length')

This excludes ProcessMonitoredDownloads (and any other future long-running background tasks) while still correctly waiting for user-initiated tasks like RefreshArtist, DownloadedAlbumsScan, etc.

Environment

  • Lidarr v2.13.x
  • arr-scripts v2.48
  • linuxserver/lidarr container

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