Troubleshooting Decluttarr Failed Imports Not Removing

by ADMIN 55 views
Iklan Headers

Having issues with Decluttarr not removing those pesky failed imports? You're not alone! It can be frustrating when things don't work as expected, but let's dive into how we can troubleshoot this issue and get Decluttarr working smoothly. In this comprehensive guide, we will explore common reasons why Decluttarr might not be removing failed imports, focusing on configuration settings, log analysis, and potential solutions. We'll break down the problem into manageable steps, ensuring you have a clear path to resolution. Let's get started and declutter your media server!

Understanding the Problem: Decluttarr and Failed Imports

Decluttarr is a fantastic tool for keeping your media library clean and organized. It's designed to automatically manage downloads and files across your Sonarr, Radarr, Lidarr, and Readarr instances. One of its key features is the ability to remove failed imports, which helps prevent clutter and ensures you're only keeping successful downloads. When Decluttarr fails to remove failed imports, it can lead to a buildup of unwanted files, consuming storage space and making it harder to manage your media. Understanding why this happens is the first step in resolving the issue. Let's get into the core issues that might be preventing Decluttarr from doing its job, so you can keep your media server running efficiently and smoothly.

Key Symptoms

  • Failed downloads lingering in your download client (e.g., qBittorrent).
  • Error messages in your *arr apps indicating import failures.
  • Decluttarr logs showing detection of failed imports but no removal action.

Initial Checks

Before diving deep, let’s cover the basics. Here are a few quick checks to ensure everything is set up correctly:

  1. Configuration Files: Double-check your config.yaml file for any typos or incorrect settings.
  2. Service Status: Ensure all services (qBittorrent, Sonarr, Radarr, etc.) are running and healthy.
  3. Permissions: Verify that Decluttarr has the necessary permissions to access and modify files in your download directories.

Diving into the Configuration: config.yaml

Your config.yaml file is the heart of Decluttarr's operation. It dictates how Decluttarr behaves, what it monitors, and what actions it takes. A misconfigured config.yaml is a common culprit for issues like failed import removal. Let's dissect the key sections relevant to our problem.

General Settings

general:
  log_level: VERBOSE # INFO # DEBUG
  test_run: false
  timer: 10
  private_tracker_handling: "obsolete_tag" # remove, skip, obsolete_tag. Optional. Default: remove
  public_tracker_handling: "obsolete_tag"  # remove, skip, obsolete_tag. Optional. Default: remove
  obsolete_tag: "Obsolete"
  protected_tag: "HOLD"
  • log_level: Setting this to VERBOSE or DEBUG provides detailed logs, crucial for troubleshooting. Make sure you've enabled one of these for now.
  • test_run: Ensure this is set to false. When true, Decluttarr simulates actions without actually performing them, which is great for testing configurations, but not for actual operation.
  • timer: This determines how often Decluttarr runs its checks (in minutes). A value of 10 means Decluttarr will run every 10 minutes.
  • private_tracker_handling and public_tracker_handling: These settings dictate how Decluttarr handles torrents from private and public trackers. The obsolete_tag option is a good choice as it tags the torrents rather than immediately removing them, giving you a chance to review.

Job Defaults and Specific Jobs

The job_defaults section sets the standard for all jobs, while the jobs section allows you to customize individual job behaviors.

job_defaults:
  max_strikes: 3
  min_days_between_searches: 7
  max_concurrent_searches: 3

jobs:
  remove_bad_files:
     keep_archives: true
  remove_failed_downloads: true
  remove_failed_imports: true
  remove_metadata_missing: true
  remove_missing_files: true
  remove_orphans: true
  remove_slow:
    min_speed: 25
    max_strikes: 5
  remove_stalled: true
  remove_unmonitored: true
  search_unmet_cutoff:
  search_missing:
  detect_deletions: true
  • max_strikes: The number of times a job can fail before Decluttarr stops attempting it. This helps prevent endless loops if an issue persists.
  • min_days_between_searches and max_concurrent_searches: These settings control how often Decluttarr searches for missing or unmet cutoff media, preventing excessive API calls to your *arr instances.

Now, let’s focus on the critical job for our issue: remove_failed_imports. This job must be set to true for Decluttarr to actively remove failed imports. If it’s set to false, Decluttarr will ignore failed imports, which is likely the root cause of your problem. Double-check this setting and ensure it's enabled. This is the most common reason why Decluttarr isn't removing failed imports. If this setting is true and you are still having problems, move on to the next step.

Message Patterns

Within the remove_failed_imports job, you can define message_patterns. These are regular expressions that Decluttarr uses to identify specific failure messages. If a message matches one of these patterns, Decluttarr will consider the download as failed and attempt to remove it. Here’s an example:

remove_failed_imports: true
  message_patterns:
    - "Not a Custom Format upgrade for existing*"
    - "Not an upgrade for existing*"
    - "*Found potentially dangerous file with extension*"
    - "Invalid video file*"
    - "No files found are eligible for import*"
    - "One or more episodes expected in this release were not imported or missing from the release"
    - "Not an upgrade for existing episode file(s)*"
    - "Found matching movie via grab history, but release was matched to movie by ID. Manual Import required."
    - "Book match is not close enough:*"
    - "Has the same filesize as existing file"
    - "Failed to import book."
    - "Couldn't find similar book for*"
    - "Not an upgrade for existing book file(s)"

These patterns are quite comprehensive and cover many common failure scenarios. However, it's essential to ensure these patterns match the actual error messages in your *arr instances. If the messages don’t match, Decluttarr won’t recognize the failures. So, make sure that the messages in your *arr instances match these patterns.

Instances and Download Clients

These sections define your *arr instances and download clients. Decluttarr needs this information to communicate with these services.

instances:
  sonarr:
    - base_url: "http://sonarr:8989"
      api_key: "<REDACTED>"
  radarr:
    - base_url: "http://radarr:7878"
      api_key: "<REDACTED>"
  readarr:
    - base_url: "http://readarr:8787"
      api_key: "<REDACTED>"
    - base_url: "http://speakarr:8787"
      api_key: "<REDACTED>"
  lidarr:
    - base_url: "http://lidarr:8686"
      api_key: "<REDACTED>"

download_clients:
  qbittorrent:
    - base_url: "<REDACTED>"
      username: <REDACTED>
      password: "<REDACTED>"
  sabnzbd:
    - base_url: "<REDACTED>"
      api_key: "<REDACTED>"
  • Base URLs: Ensure the URLs for your *arr instances and download clients are correct. A typo here can prevent Decluttarr from connecting.
  • API Keys: Double-check the API keys. An incorrect key will block Decluttarr from accessing the services.
  • Download Client Names: The names in the download_clients section must match the names configured in your *arr instances. If there’s a mismatch, Decluttarr won’t be able to manage those clients.

Analyzing the Logs: Debugging Decluttarr

Logs are your best friend when troubleshooting. Decluttarr's logs provide insights into what's happening behind the scenes. By examining these logs, you can identify errors, warnings, and other clues that can help you pinpoint the issue. Remember that you need to set log_level to VERBOSE or DEBUG in your config.yaml to get detailed logs. Analyzing these logs can help you figure out why Decluttarr is failing to remove failed imports, so make sure you are checking them. Here's how to interpret the logs and what to look for.

Log Snippets and Their Meanings

Let’s look at the log snippets you provided and break them down:

INFO    | *** Running jobs on Radarr (http://radarr:7878) ***
VERBOSE | ↳ Tracked Download State: importPending
VERBOSE | ↳ Status Messages:
VERBOSE |  - No files found are eligible for import in /data/torrents/movies/28.Years.Later.2025.NORDIC.2160p.SDR.WEB-DL.DDP5.1.Atmos.H.265-NorTekst
VERBOSE | Job 'search_missing' did not trigger a search: All missing movies were searched for in the last 7 days
VERBOSE | Job 'search_cutoff_unmet' did not trigger a search: All movies with unmet cutoff were searched for in the last 7 days
  • Tracked Download State: importPending: This indicates that Decluttarr is aware of a download that’s in a pending import state. This is normal for downloads that are still processing.
  • Status Messages: - No files found are eligible for import: This message suggests that while Decluttarr sees the download, the files within the download folder don’t meet the criteria for import. This could be due to missing files, incorrect file types, or other issues.
  • Job 'search_missing' did not trigger a search: This is an informational message indicating that the search_missing job didn’t run because it had run recently. It's not directly related to the failed import issue but helps understand Decluttarr’s overall activity.

Now, let’s look at the Readarr logs:

INFO    | *** Running jobs on Readarr (http://readarr:8787) ***
VERBOSE | ↳ Tracked Download State: importFailed
VERBOSE | ↳ Status Messages:
VERBOSE |  - Book match is not close enough: 52.1% vs 80% [asin, ebook format]
VERBOSE | ↳ Tracked Download State: importPending
VERBOSE | ↳ Status Messages:
VERBOSE |  - No files found are eligible for import in /data/torrents/books/Eckhart Tolle - Practicing the Power of Now/Eckhart Tolle - Practicing the Power of Now.epub
VERBOSE | ↳ Tracked Download State: importFailed
VERBOSE | ↳ Status Messages:
VERBOSE |  - Has the same filesize as existing file
VERBOSE |  - Book match is not close enough: 58.1% vs 80% [book, asin, publisher, ebook format]
VERBOSE | ↳ Tracked Download State: importFailed
VERBOSE | ↳ Status Messages:
VERBOSE |  - Has the same filesize as existing file
VERBOSE |  - No files found are eligible for import in /data/torrents/audiobooks/An Immense World by Ed Yong/An Immense World by Ed Yong.m4b
VERBOSE | Job 'search_missing' did not trigger a search: All missing books were searched for in the last 7 days
VERBOSE | Job 'search_cutoff_unmet' did not trigger a search: All books with unmet cutoff were searched for in the last 7 days
  • Tracked Download State: importFailed: This is a key indicator. Decluttarr has detected failed imports. The fact that these are showing up means Decluttarr is correctly identifying the failed imports, but something is preventing their removal.
  • Status Messages: These messages provide reasons for the import failures. For example, “Book match is not close enough” and “Has the same filesize as existing file” suggest that Readarr couldn’t import the files due to matching issues or duplicate files.

Common Log Patterns to Watch For

  • Errors: Look for lines that start with ERROR. These indicate critical issues that need immediate attention.
  • Warnings: Lines starting with WARNING suggest potential problems that might not be critical but should be investigated.
  • Job Execution: Look for logs indicating the start and end of jobs. This helps you confirm whether the remove_failed_imports job is running at all.
  • Action Confirmation: After detecting a failed import, Decluttarr should log an action to remove it. If you don’t see such logs, it’s a sign that the removal process isn’t being triggered.

Filtering and Searching Logs

When dealing with large log files, filtering and searching can be invaluable. Here are some tips:

  • Filter by Job: Search for logs related to the remove_failed_imports job to focus on relevant entries.
  • Filter by Error Level: Use keywords like ERROR or WARNING to quickly find potential issues.
  • Search for Specific Messages: If you know a particular error message, search for it to find all occurrences.

Potential Solutions and Troubleshooting Steps

Now that we’ve analyzed the configuration and logs, let’s explore some potential solutions and troubleshooting steps.

1. Verify remove_failed_imports is Enabled

This is the most straightforward solution, but it’s worth reiterating. Open your config.yaml and ensure that remove_failed_imports: true under the jobs section. Save the file and restart Decluttarr.

2. Check Message Patterns

Ensure that the message_patterns in your config.yaml match the actual error messages in your *arr instances. If the messages don’t align, Decluttarr won’t recognize the failures. If necessary, adjust the patterns to match the error messages.

3. Verify Permissions

Decluttarr needs appropriate permissions to access and delete files in your download directories. Ensure that the user Decluttarr runs under (specified by PUID and PGID in your compose.yaml) has read and write access to these directories. Mismatched permissions can prevent Decluttarr from deleting files, even if it detects them as failed imports.

4. Test Run Mode

If you’re unsure about a configuration change, you can temporarily enable test_run: true in your config.yaml. This will make Decluttarr simulate actions without actually performing them. Check the logs to see what Decluttarr would do, and if it looks correct, disable test_run to apply the changes.

5. Check for Conflicting Jobs

Sometimes, other jobs in Decluttarr can interfere with remove_failed_imports. For example, if you have a job that moves files around, it might interfere with Decluttarr's ability to track and remove failed imports. Review your other job configurations to ensure there are no conflicts.

6. Examine Download Client State

Decluttarr relies on your download client (e.g., qBittorrent) to report the state of downloads. If your download client isn’t correctly reporting failed downloads, Decluttarr won’t be able to act on them. Check your download client’s settings and logs to ensure it’s properly tracking and reporting download states. Check that the download client is also communicating well with the *arr applications and that they both are reporting failures in a timely fashion.

7. Review Private and Public Tracker Handling

The private_tracker_handling and public_tracker_handling settings can influence how Decluttarr processes torrents from different sources. If you’ve set these to skip, Decluttarr might be skipping failed imports from certain trackers. Consider using obsolete_tag or remove to ensure failed imports are handled.

8. Decluttarr Version and Updates

Ensure you’re running the latest version of Decluttarr. Updates often include bug fixes and improvements that can resolve issues like this. If you’re using a specific version (e.g., dev), consider switching to the latest tag or a stable release.

9. Docker Configuration

Review your compose.yaml file to ensure all volumes and networks are correctly configured. Incorrect volume mappings can prevent Decluttarr from accessing the necessary files and directories. Also, verify that the networks allow Decluttarr to communicate with your *arr instances and download clients.

10. External Factors

Sometimes, the issue might not be with Decluttarr itself. External factors like network issues, disk space problems, or overloaded servers can prevent Decluttarr from functioning correctly. Ensure your system has sufficient resources and that there are no network connectivity issues.

Final Thoughts: Keeping Your System Clean

Troubleshooting Decluttarr issues can be a bit like detective work, but with a systematic approach, you can usually find the root cause and get things running smoothly. Remember to:

  • Check your config.yaml: Ensure settings are correct, especially remove_failed_imports.
  • Analyze the logs: Look for errors, warnings, and patterns that indicate problems.
  • Verify permissions: Ensure Decluttarr has the necessary access to files and directories.
  • Review download client settings: Make sure your download client is reporting download states correctly.

By following these steps, you’ll be well-equipped to tackle the issue of Decluttarr not removing failed imports. Keep your system clean, and happy media managing!

Keywords Addressed

This article addresses the keywords Decluttarr, failed imports, troubleshooting, config.yaml, logs, and remove_failed_imports. It provides a comprehensive guide to diagnosing and resolving issues with Decluttarr not removing failed imports, covering various aspects from configuration to log analysis and potential solutions.