Skip to content

[Bug] MangaBaka provider initializes and logs WARN even when enabled=false #287

@leonardoschwider

Description

@leonardoschwider

[Bug] MangaBaka provider initializes and logs WARN even when enabled=false

Description

Even with mangaBaka.enabled: false configured in application.yml, the MangaBakaDbMetadata logger outputs WARN messages at every container startup regarding missing timestamp and checksum files. The provider appears to initialize and perform IO checks before verifying whether it is actually enabled.

Environment

  • Komf Image: sndxr/komf:latest
  • Deployment: Docker Compose
  • Configuration: MangaBaka provider explicitly disabled.

Expected Behavior

When a provider is disabled (enabled: false), it should not attempt to initialize, access files, or log warnings related to missing configuration files.

Actual Behavior

The following warnings are logged during the main initialization sequence:

20:25:37.523 [main] WARN snd.komf.providers.mangabaka.db.MangaBakaDbMetadata -- failed to find MangaBaka timestamp file
20:25:37.530 [main] WARN snd.komf.providers.mangabaka.db.MangaBakaDbMetadata -- failed to find MangaBaka checksum file

Root Cause Analysis

The MangaBakaDbMetadata class attempts to load timestamp and checksum files during initialization.

Only after file access fails does the code check the enabled flag. As a result, disabled providers still trigger initialization logic and log warnings.

Attempted Workarounds (unsuccessful)

  • Setting KOMF_LOG_LEVEL=ERROR
    Suppresses all warnings globally, hiding legitimate alerts.

  • Creating placeholder files in:

    • /config/mangabaka/
    • /config/mangabaka/mangabaka/
      Files were still not detected/read.
  • Using logback.xml logger configuration
    Not detected/applied by Komf.

  • Using JAVA_OPTS with SimpleLogger flags
    No effect.

Impact

  • Minor: Log noise in container logs
  • No functional impact: App works normally and the provider does not run
  • User confusion: File-not-found warnings appear for a provider that is intentionally disabled

Suggested Fix

Reorder initialization in MangaBakaDbMetadata to check the enabled flag before attempting file access:

if (!config.enabled) {
    return  // Skip initialization entirely
}
// Then attempt to load timestamp/checksum files

Configuration:

metadataProviders:
  defaultProviders:
    mangaBaka:
      priority: 4
      enabled: false  # Disabled
      mode: API

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