Skip to content

[Bug]: WebUI can't load config.xml with env_var #1065

@Grutorel

Description

@Grutorel

Describe the Bug

Describe the bug

The Web UI returns an "Internal Server Error" when trying to load the configuration page (/api/configs/config.yml). The error occurs because the !env_var custom YAML tag cannot be serialized to JSON by Pydantic.

Error message:
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'ruamel.yaml.comments.TaggedScalar'>

To Reproduce

  1. Configure config.yml with an !env_var tag (e.g., pass: !env_var QB_PASSWORD)
  2. Enable the web server (QBT_WEB_SERVER=true)
  3. Access the Web UI and navigate to the configuration page
  4. The page fails to load with "Internal Server Error"

Expected behavior

The Web UI should display the configuration, either by:

  • Converting !env_var tags to a string representation (e.g., "!env_var QB_PASSWORD")
  • Masking the value (e.g., "********")
  • Showing a placeholder indicating an environment variable is used

Environment

  • qbit_manage version: 4.6.5
  • Docker image: bobokun/qbit_manage:latest
  • Platform: Linux aarch64 (Raspberry Pi)

Additional context

All other API endpoints work correctly (/api/health, /api/scheduler, /api/logs, etc.). The core functionality of qbit_manage is not affected - only the config viewer in the Web UI fails.

Config

commands:
  dry_run: false
  recheck: false
  cat_update: true
  tag_update: true
  rem_unregistered: false
  tag_tracker_error: true
  rem_orphaned: true
  tag_nohardlinks: true
  share_limits: true
  skip_qb_version_check: false
  skip_cleanup: false

qbt:
  host: qbittorrent:8082
  user: admin
  pass: !env_var QB_PASSWORD

Logs

https://gist.github.com/Grutorel/67322c83d0ce433ff6a5391b00449b8b

Screenshots

No response

Installation

Docker

Version Number

4.6.5

What branch are you on?

master

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions